Skip to content
This repository has been archived by the owner on Sep 27, 2018. It is now read-only.

Propulsion Microcontroller API

Whymarrh Whitby edited this page Nov 13, 2017 · 22 revisions

This page contains the commands used when communicating to and from the Wireless Communication Modules.

More details about the communication protocol can be found via the API Documentation Homepage.


Command 0x10 – Reset Motor Controller

Request Message:

  • Payload Size: 1 byte (null)
Byte Description Valid Range
0 Null Byte 0x00

Response Message:

  • Payload Size: 1 byte
Byte Description Valid Range
0 Null Byte 0x00

Command 0x11 – Set Motor Controller Configuration

Request Message:

  • Payload Size: 2 bytes
Byte Title Description Valid Range
0 Register Parameter being changed See Qik 2s12v10 User Guide parameter numbers
1 Value New configuration value See Qik 2s12v10 User Guide parameter allowed values

Response Message:

  • Payload Size: 2 bytes
Byte Title Description Valid Range
0 Register Parameter that was changed See Qik 2s12v10 User Guide
1 Value New configuration value Varies

Command 0x12 – Get Motor Controller Configuration

Request Message:

  • Payload Size: 1 byte
Byte Title Description Valid Range
0 Register Which parameter to read See Qik 2s12v10 User Guide

Response Message:

  • Payload Size: 2 bytes
Byte Title Description Valid Range
0 Register Which parameter was read See Qik 2s12v10 User Guide
1 Value Parameter configuration Varies

Command 0x13 – Set Motor Speeds

Request Message:

  • Payload Size: 4 bytes
  • Used to set the speed of both motors simultaneously
Byte Title Description Valid Range
0 to 1 M0 Speed Speed to set M0 signed 16 bit, -127 to 127
2 to 3 M1 Speed Speed to set M1 signed 16 bit, -127 to 127

Response Message:

  • Payload Size: 4 bytes
  • The response from the microcontroller to a set motor speed is to reply with the new motor speed to confirm the set was successful
Byte Title Description Valid Range
0 to 1 M0 Speed New M0 Speed signed 16 bit, -255 to 255
2 to 3 M1 Speed New M1 Speed signed 16 bit, -255 to 255

Command 0x14 - Get Motor Currents

Request Message:

  • Payload Size: 1 byte
Byte Description Valid Range
0 Null Byte 0x00

Response Message:

  • Payload size: 4 bytes
  • Reply from the microcontroller contains the current of both motors in milliamps.
Byte Title Description Valid Range
0 to 1 M0 Current Current in milliamps signed 16 bit, > 0
2 to 3 M1 Current Current in milliamps signed 16 bit, > 0

Command 0x15 – Get Errors

Request Message:

  • Payload Size: 1 byte (null)
  • Note: The act of reading the errors will clear them from the device.
Byte Description Valid Range
0 Null Byte 0x00

Response Message:

The table below explains the individual bit meanings of the single byte of the payload.

Bit Description Valid Range
7 (MSB) Timeout 0 or 1
6 Format Error 0 or 1
5 CRC Error 0 or 1
4 Serial Hardware Error 0 or 1
3 Motor 1 Over Current 0 or 1
2 Motor 0 Over Current 0 or 1
1 Motor 1 Fault 0 or 1
0 (LSB) Motor 0 Fault 0 or 1

Command 0x1F – General Error Message

Request Message:

  • Not applicable. A general error message is sent when a request has not been understood by the module (such as a CRC16 failure) or some other error occurred preventing a normal reply to a message.

Response Message:

  • Payload Size: 1 byte

The table below explains the individual bit meanings of the single byte of the payload.

Value Description
0x01 CRC Error
0x02 Speed Command out of Range
0x03 Command Not Available