Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Centre console is the board which contains the main drive state logic for the entire car’s electrical system. It governs starting the system and controlling the power states, as well as the drive state of the car. When the car is off (Main Battery disconnectedRelays to main battery are open, and car is powered off the aux battery), this board, along with pedal BMS carrier and power distribution are the only ones which are powered, so that they can be used to start the broader systemcar.

The car is powered on when the power button is pressed. Initially this is “aux power”, which means that car is powered by a supply separate to the main batteries. This means minimal functionality is available, and is good for testing initial startup. If the brake is pressed and the power button is pressed at the same time, the car will enter the main power state, powered by the main electrical system, and full functionality will be available.

TODO:

Inputs

Buttons

  • Power Button

    • Used to control power state, along with pedal

  • R, N, D → drive state control buttons

  • Hazard button → Latching, sends message to power distribution to strobe turn lights

  • Regen Braking Enable:

  • DRL Lights?

Buttons will be handled as gpio interrupts. R, N, D will be registered to send notifications to the Drive state FSM. Power button will send a notification to the Power State FSM.Centre console also provides feedback on the state of the car through:

  • Buttons to change state

    • Drive, Reverse, and Neutral

    • Power button

    • Regen Braking button

    • Hazard Button

  • three 7-segment displays with the below quantities

    • Speedometer (speed in km/h)

    • Battery Percentage Indicator (Percent remaining charge)

    • Cruise Control indicator (desired speed in km/h)

  • Indicator LEDS

    • One for each of the above buttons (P/D/N/R/Haz/Reg)

    • Left turn signal

    • Right Turn Signal

    • Cruise control enabled indicator

CAN Signals

TX:

  • power_direction: (POWER_ON or POWER_OFF)

cc_cruise_info → MCI

Centre Console Functionality

Module: cc_buttons

Buttons should be read in the fast cycle. They are connected to the pca9555 gpio expander, and must be read over i2c. This read function should just send notifications to the requisite tasks.

  • Power Button, hazard, regen: send notifications to main task

  • R, N, D → Send notifications to Drive FSM

Module: refresh_dashboard:

Static variables:

  • cruise_control_state

  • target_velocity

  • regen_braking_state

  • power_state_to_transmit

Functions:

  • update_indicators()

    • Gets notification value from button presses, updates indicator lights and output can_messages

      • Power button: when pressed, toggles power_state_to_transmit value, sets toggled value in CAN message to P

      • Regen Brake : when pressed, toggle regen brake state, update indicator and can message based on

  • update_displays()

    • Reads values from CAN messages, uses values

  • cruise_control_monitor()

    • Checks for cruise control inputs from steering

    • Updates

Called

This module needs to read/display

All others will be sent to the main task, and will be processed in the main loop.

...