Versions Compared

Key

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

Input states is provided by centre_console and pedal CAN messages:

Code Block
drive_output: (from centre_console)
  target_velocity: uint32_t (m/s)
  drive_state: uint8_t (DRIVE, NEUTRAL, REVERSE)
  cruise_control: uint8_t (bool)
  regen_braking: uint8_t(bool)
  precharge: uint8_t(unused)
pedal_output: (from pedal)
  throttle_output: float32 (0 to 1)
  brake_output: float32 (0 to 1)

The expected output is a can message to the wavesculptor from MCP2515

Code Block
message_id: 0x01
  current: float32
  velocity: float32

Message Behaviour

state

Input state

Drive state

Expected

Notes

throttle 0, brake 0

regen off, cruise off

Drive/Reverse/Neutral

current 0

velocity 0

throttle 0>0, brake 0

regen off, cruise off

Drive

current [throttle_outputl]

velocity 20,000

Neutral

current 0

velocity 0

state Drive

throttle 0.5, brake 0

Reverse

current [throttle_outputl]

velocity -20,000

throttle any, brake >0

regen off, cruise off,

Drive/Reverse/Neutral

current 0.5

velocity 20,000

state Neutral

throttle 0.50

throttle 0, brake 0

regen on, cruise off

Drive/Reverse

current 1

velocity 0

Neutral

current 1

velocity 0

Should this be

current 0

velocity 0?

throttle >0, brake 0

regen offon, cruise off

Drive

current [throttle_outputl]

velocity 20,000

Neutral

current 0

velocity 0

state Reverse

throttle 0.5, brake 0

regen off, cruise off,

current -0.5

velocity 0

state Drive/Neutral/ReverseReverse

current [throttle_outputl]

velocity -20,000

throttle any, brake >0

regen on, cruise off

Drive/Reverse

current 1

velocity 0

Neutral

current 1

velocity 0

throttle 0, brake 0

regen on, cruise on

Drive/Reverse

current 1

velocity [target_velocity]

Neutral

current 1

velocity 0

Should this be

current 0

velocity 0?

throttle >0, brake 0

regen on, cruise on

Drive/Reverse

current 1

velocity [target_velocity]

Neutral

current 0

velocity 0

throttle any, brake >0

regen offon, cruise off, on

Drive/Reverse

current 1

velocity 0

Neutral

current 1

velocity 0

Timing is ok

no watchdog timeouts with message every 100ms

ooutput is ok

ooutgoing motor controller messages are ok, sent every 100ms