Skip to content

Motor Control Board

BL-CZY edited this page Sep 5, 2026 · 2 revisions

Overview

  • Board used: STM32f767zi
  • Function: Controls the motor

Sensors used

sensor pins address wiring_photo type extra_info
Inter-board communication Can Bus PB8, PB9 - - CAN -
Motor PB3, PB4 - - CAN -

Testing Objectives

State Machine Actions

There are 2 two boolean flags:

  • setup_complete: whether the motor controller has been configured.
  • operational: whether the controller is in the operational state.
Event Preconditions Action (with letter) Postconditions
MotorControllerSetupCommand None Run the setup sequence (run_setup_sequence()), mark setup_complete = true, and send MotorControllerSetupComplete over CAN. setup_complete = true
operational unchanged, i.e. still false)
MotorControllerSetOperationalCommand setup_complete == true Run the operational sequence (run_operational_sequence()), mark operational = true, and send MotorControllerOperational. If already operational, just send the status message. operational = true
setup_complete remains true
StartPropulsionAccelerationCommand operational == true Send Messages::TestModeCommand(200) to the motor, wait 3 seconds, then send PropulsionAccelerationStarted. State unchanged
StartPropulsionBrakingCommand operational == true Send Messages::QuickStop (NMT command), wait 100 ms, then send PropulsionBrakingStarted. State unchanged

CAN Message Transmission

All motor commands (send_motor_command) are enqueued into the MOTOR_COMMAND_CHANNEL, which is consumed by the motor_control_loop task. That task translates each Messages variant into either an NMT frame (for state transitions) or an SDO frame (for parameter writes) and transmits it over the CAN bus.

Clone this wiki locally