Communications
An overview of supported microDRIVE communications protocols.
The microDRIVE units support the following control and telemetry protocols:
- CAN Bus 2.0B Protocols
- DroneCAN (previously known as UAVCAN v0.9)
- DShot
- DShot150 to DShot600 baud rates
- Bi-directional DShot for RPM filtering
- DShot UART telemetry
- PWM servo pulse (1000-2000 us)
Settings that affect communications on the microDRIVE can be found below.
If CAN Bus is enabled within communication settings, the following DroneCAN settings can be adjusted.
CAN Bus must be enabled within the microDRIVE settings for the unit to connect.
The following instructions outline how to operate the ESC using DroneCAN via a suitable SLCAN adapter. Autopilots such as the Pixhawk Cube running Ardupilot can be configured to act as a SLCAN adapter. Ardupilot-specific setup instructions for DroneCAN can also be found here.
In accordance with the CAN wiring diagram, each unit necessitates the connection of CAN H, CAN L, and CAN GND to the control point. It is imperative to ensure the correct termination of both ends of the CAN network to achieve optimal performance. Notably, the units have a configurable internal termination, which should be enabled as required.
Once the units are powered on, they can be effectively tested using the DroneCAN GUI tool. This tool serves as an interface for establishing connections, conducting tests, and monitoring telemetry from devices equipped with DroneCAN capabilities. Utilising a DroneCAN-capable device, such as a Cube Orange running Ardupilot, as a master node is a prerequisite. Once a successful connection is established with the master node, users are presented with the following screen:
Overview:
Section | Purpose |
---|---|
1 | Setting for the master node ID. Required as the first setting to adjust when establishing the connection. |
2 | Start Dynamic Node Allocation server (DNA). ESCs will automatically connect to the network if CAN is enabled and the server is running. |
3 | List of connected Nodes in the current network. |
4 | Panels for access to telemetry viewers and ESC control panel. |
5 | The output of debug messages from devices connected to the network. |
6 | List of IDs of connected nodes. |
ESC Operations
Once the ESC is connected to the network successfully as a node, further information can be accessed by double-clicking on it. The following screen is displayed:
Overview:
Section | Purpose |
---|---|
1 | Selected node information, including hardware/software version, serial number (UID) and current status. |
2 | Restart Button. Trigger restart of the attached node. This will occur after a small timeout while the unit prepares for the shutdown. Blocked if the motor is armed. |
3 | Update Firmware Button. Select firmware for updates on this node. The file will be automatically transmitted, and a reboot will be triggered for installation. The result of the firmware update will be reported upon reboot. Blocked if the motor is armed. |
4 | Fetch All Settings Button. Fetch all the settings on the ESC. Blocked if the motor is armed. |
5 | Store All Settings Button. Save all the settings. Required after modification of settings, will trigger a reboot to apply settings. Blocked if the motor is armed. |
6 | Erase All Settings Button. Reset settings to defaults (defaults set by firmware). Blocked if the motor is armed. |
7 | Settings are listed after fetch. Double-click on the setting to adjust. |
When using the DroneCAN GUI to run the ESC, the following panel is used to operate connected ESC nodes (click the Panels drop-down menu, ESC Panel).
While this panel is open, the master node will exclusively send out motor output packets that clear any signal errors.
Overview:
Section | Purpose |
---|---|
1 | Channel Output Setpoints. Outputs are used to control the individual setpoints for channel outputs. Each ESC requires DroneCAN ESC Index setting to be applied to the desired channel number. The default is 0. The 0th channel represents the leftmost channel. The output range allows for full forward and full reverse movement. However, it's important to note that the ESC will only accept reverse setpoints (negative values) in Reversible mode. |
2 | Toggle to output the Armed Command message. Required if Require Armed Status DroneCAN setting enabled. |
The exact structure is currently undergoing integration and testing and may change in the future. Please refer to changelogs for more information.
To quickly reveal error conditions and warnings, the DroneCAN Status Message 1034 error_counter field is used as a custom error/warning flag bitfield instead of counting total errors. This deviates from the DroneCAN specification.
When there are no errors, this field will always read 0. When an error or warning condition is active, the Most Significant Bit (MSB, bit index 31) is set to signal that this is a custom warning. From there, the flags are set to true according to the following conditions.
Bit Position | Error/Warning | Description |
---|---|---|
0 | Over Temperature | Temperature has exceeded the configured temperature limit |
1 | Bus Over Current | Bus current has exceeded the configured bus current limit |
2 | Phase Over Current | Phase current has exceeded the configured phase current limit |
3 | Over Voltage | Bus voltage has crossed over the over-voltage threshold |
4 | Under Voltage | Bus voltage has crossed under the under-voltage threshold |
5 | Excess Voltage Ripple | Bus voltage ripple is outside tolerances. This can lead to shorter lifetime on the capacitors. This can also signal unit degradation and require investigation. |
6 | Signal Error | Set if signal receive has timed out |
7 | Motor Saturated | Detected a motor saturation and started reducing output drive (foldback) until control is regained |
8 | Motor Over Temperature | Motor temperature has exceeded the configured motor temperature limit |
9 | RPM Limit Reached | Controller has reached the configured maximum rpm limit |
10 | Error Active | Controller has entered error state |
11 | Output Shorted | Bridge detected as shorted during the startup short circuit test |
12 | Startup Check Failed | Bridge and Comparators have failed startup checks |
31 | Custom Status | Set to true to indicate this custom bitfield is in use |
The DroneCAN Status Message 1036 status_flags field is used to communicate more states. This is at a lower frequency to the 1034 Status Message, and is used for less time critical statuses.
Bit Position | Error/Warning | Description |
---|---|---|
0 | Motor Armed | Controller is in an armed state and can drive the motor |
1 | Motor Running | Controller is actively driving the motor |
2 | Motor Parked | Controller is parked |
3 | Active Free Wheeling Engaged | Active Free Wheeling has been engaged |
4 | Ignoring Calibration | Unit calibration values are being ignored |
The format is currently undergoing integration and testing, it may change in future.
When the telemetry output is enabled and the format is set as UART telemetry, the following packet format is output through the telemetry line at the configured rate.
Settings that affect telemetry on the microDRIVE can be found below.
The settings applied to the UART connection that supplies the telemetry packet can be found below:
- Baud Rate: 115200 Baud
- Word Length: 8B
- Stop Bits: 1
- Parity: None
- No Flow Control
The following packet is output at the configured rate. No partial packets are transmitted.
Data Field | Size | Comments |
---|---|---|
Bus Voltage | 32-bit Float | The measured input voltage to the ESC. Units are Volts. |
Bus Current | 32-bit Float | The measured input current to the ESC. Units are Amps. Negative values indicate regenerative current. |
Bridge Temperature | 32-bit Float | The temperature of the 3-phase bridge. This is the primary heat source with the ESC. Units are in degrees Celcius. |
ERPM | Unsigned 32-bit Integer | The current applied speed of the motor. Reports electrical RPM when the motor pole pair count is set to 1; mechanical RPM otherwise. |
Input Duty Cycle | Unsigned 16-bit Integer | The requested duty cycle, as reported by the input signal system. 0-100%. |
Output Duty Cycle | Unsigned 16-bit Integer | The current applied duty cycle to the 3-phase bridge. If this does not equal the input duty cycle, the ESC is actively limiting the output. 0-100%. |
Error Flags | Unsigned 32-bit Integer | This indicates the currently active error flags during operation, which should be seriously reviewed. See the Errors 1 guide within Diagnostics. |
Reserved | Unsigned 16-bit Integer | Reserved for future use. Value fixed at 0. |
Checksum (CRC32) | Unsigned 32-bit Integer | - |