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 6 Next »

Modules

precharge_control

  • receives can message for precharge

  • begins precharge (sets gpio pin)

    • acks the precharge message (checks the gpio state after setting it, if it’s the same, ack status OK)

  • receives can message for discharge (power-off sequence, bms faults)

    • acks the message

  • receives fault events for discharge(internally generated if the mci’s fault)

  • sends precharge complete message when precharge is complete (interrupt)

  • keeps a global state of the precharge status (the interrupt should be triggered on both rising and falling)

mci_data_broadcast

  • listens on the CAN network for mci data. (interrupt driven)

  • sends it on the car’s internal CAN network. (can happen when the interrupt goes off)

relay_rx - not needed by mc_interface

  • sets gpio state

  • will have a guard (precharge status can be used here)

    • Need to successfully disable

  • reads from it

  • acks message

  • will be a library

drive_rx

  • will be a library (has its own storage)

  • receive messages (only drive state) and keep a global state, also raise events

pedal_rx

  • will be a library (has its own storage)

  • receives pedal messages (brake and throttle values) (in one message)

  • stores them in its storage

  • has a watchdog timer (sets to 0 brake 0 throttle if times out)

cruise_rx

  • receives cruise messages: on, off, increase, decrease

  • raises event

drive_output_fsm

  • states:

    • off

      • off → drive: drive event gets raised from a drive state message.

      • off → reverse: reverse event gets raised from drive state message.

    • drive

      • drive → off: must happen immediately, can happen using a method and calling fsm_process_event explicitly.

      • drive → reverse: reverse event gets raised from drive state message. (filtered at center console)

      • drive → cruise: cruise control ON message gets received.

    • reverse

      • reverse → drive: trivial (filtered at center console)

    • cruise:

      • cruise → cruise:

        • increase/decrease target speed

      • cruise → drive:

        • cancellation: through brake/throttle press

  • architecture:

    • have a repeating soft_timer for outputting to the motor controller.

    • body of soft_timer will be as follows:

      • if internal state is drive/reverse, make drive/reverse commands.

      • if internal state is cruise, make cruise commands and handle cruise logic (checking pedals)

    • soft_timer is cancelled when we’re in off.

    • uses heartbeat_rx library

Incoming CAN Messages

Message ID

Parameters

CAR_DRIVE_STATE

u_8 drive_staet

BEGIN_PRECHARGE

THROTTLE_OUTPUT

SET_RELAY_STATES

BRAKE_PRESSED

CRUISE_CONTROL_COMMAND

POWERTRAIN_HEARTBEAT

Outgoing CAN Messages

Message ID

Parameters

DESCRIPTION

PRECHARGE_COMPLETED

no data

CRUISE_CONTROL_CANCELLED

no data

MOTOR_CONTROLLER_STATUS

u64

MOTOR_CONTROLLER_DATA

u32 type, u32 data

  • No labels