Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Purpose:

The steering board allows the driver to control important features of the vehicle as listed below:  

  • Horn 

  • Lights 

  • Cruise control 

  • Left/right signal 

In the car we have a steering stalk. The steering board needs to detect the stalk movement to a certain position and act accordingly (ie. using the left signal).

Steering design:

Here is the steering interface of the previous car https://uwmidsun.atlassian.net/wiki/spaces/ELEC/pages/846266737/Steering%2BInterface%2BMS%2B14. MSXV steering will be based on this design.

Necessity:

The steering board is critical because it implements necessary safety features that the car needs such as the horn, signals, and lights. It is also critical to racing comfort by implementing cruise control.

Implementation:

The steering project will consist of three C files. main.c, steering_analog_task.c, steering_digital_task.c.

main.c:

Main.c should initialize all the other tasks. The file should look like the standard main.c for every project. Use scons new --project=steering to make a new project.

Medium Cycle:

  • Runs can_rx_task

  • Runs steering_analog_task, steering_digital_task concurrently

  • Runs can_tx_task

steering_analog_task.c:

This file should provide an init function for main.c to initialize.

The init function should be used to set up the adc readers (with their associated settings) for each of the analog signals.

The steering_analog_task is responsible for three analog signals: control stalk, daytime running light (DRL) on, and DRL off. For each change in signal, the task will send the appropriate CAN message. You will need to edit the steering .yaml file to change the CAN auto generation. After that you can use the setter and getter header files to fill in your CAN messages.

steering_digital_task.c:

This file should provide an init function for main.c to initialize.

The init function should be used to set up the gpio settings to correctly register the digital signals.

The steering_digital_task is responsible for the horn, cruise control (cc) on/off, cc increase speed, cc decrease speed, and regen brake toggle. For each digital signal, the task will send the appropriate CAN message. You will need to edit the steering .yaml file to change the CAN auto generation. After that you can use the setter and getter header files to fill in your CAN messages.

CAN Messages:

Steering will send two different CAN messages.

analog_signal:

The analog_signal CAN message will send four bytes: lights on/off and right/left signal.

From left to right, first two bytes should be the light id byte followed by the state byte for on/off. The next two bytes should be the id and state bytes for right/left signal.

This will only work if there are specified values where state doesn’t change when another event is being processed.

data for analog_signal: 8 bytes (4 empty, 4 filled) (note that these are just example values and may not appear in the car itself)

  • 0x00000000FFEEDDCC

  • 4th byte: example of possible light id

  • 3rd byte: example of possible state for on/off

  • 2nd byte: example of another possible light id

  • 1st byte: example of state for right/left signal

digital_signal:

The digital_signal CAN message will send three bytes: horn, cruise control (toggle on/off, increase speed, decrease speed), regen brake toggle.

From left to right, first byte will be the state of the horn. Second byte should be the cruise control command. Third byte should be the regen brake toggle command.

  • 0x0000000000FFEEDD

  • 3rd byte: example of horn state

  • 2nd byte: example of cruise control command

  • 1st byte: example of regen brake toggle command

Disclaimer: Project design is based off old MSXIV steering project (https://github.com/uw-midsun/firmware_xiv/tree/master/projects/steering headed by Avery Chiu) and is subject to change for future cars. Please see firmware leads for most up to date design.

  • No labels