M5 Power Module
M5 Power Module, M5 Power Module

Commands and Responses

The motor controller firmware also supports custom commands that allow for the instantaneous setting of multiple controllers on a party line comms bus.

PROPULSION_COMMAND: 0xaa

The propulsion command is an application custom command which is sent as a write request to CSR address 0xF0 (the custom command register. It has the following data payload format:

  • 0xAA R_ID THRUST_0 THRUST_1 THRUST_2 ... THRUST_N

Where:

  • 0xAA is the command byte
  • R_ID is the NODE ID of the thruster to respond with data
  • THRUST_X is the thruster power value (-1 to 1) for the thruster with motor id X

Typically this is sent as a group multicast to address 0x81 which is reserved for thrusters.

RESPONSE_THRUSTER_STANDARD: 0x02

The standard thruster response is typically used in conjunction with the multicast PROPULSION COMMAND to retrieve data from each thruster in the system in a round robin fashion.

When the FLAG byte is set to 0x02 the RESPONSE_THRUSTER_STANDARD data payload is sent.

The format of this payload is defined by the following structure:

Response_Thruster_Standard {
    /** Measured shaft rotational velocity */
    float rpm;
    /** Bus voltage (Volts) */
    float bus_v;
    /** Bus current (Amps) */
    float bus_i;
    /** Temperature (Degree C) */
    float temp;
    /** fault flags */
    uint8_t fault;
}

Please see the example thruster.py for an illustration of how to use the PROPULSION_COMMAND and parse the RESPONSE_THRUSTERS_STANDARD response packet.

Document Path: M5 Power Module Operator's Manual > Software Guide > Programming > Commands and Responses