|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
When to send DSHOT_CMD_EDT_ENABLE, and whether the ESC has answered. More...
#include <dshot.h>
Data Fields | |
| uint8_t | left |
| uint8_t | asks |
| uint32_t | due_ms |
| bool | answered |
| bool | asked |
When to send DSHOT_CMD_EDT_ENABLE, and whether the ESC has answered.
One ask is DSHOT_CMD_REPEATS frames of the command in a row. An ESC only acts on a command while its motor is stopped, and AM32 only once it has armed itself on about a second of zero throttle. Every run on this bench starts from silence – a disarmed bench sends nothing, and AM32 restarts after 0.5s without a signal – so an ask made only in a run's first 10ms lands before AM32 can take it and extended telemetry never comes on.
So the ask is repeated, every DSHOT_EDT_RETRY_MS while the throttle is at zero, until an extended frame arrives or DSHOT_EDT_ASKS have gone without one. An ask only starts, and only continues, on a frame whose throttle is zero: a throttle the operator has asked for goes out on that frame, and an ask it interrupts is abandoned and started again from its first repeat.
Two lifetimes. What a run has asked and heard is owed again on every run, because an ESC forgets the setting when it restarts. asked follows the binding: from the first repeat of the first ask, replies are read as extended telemetry, because an ESC that kept power kept the setting and AM32 answers the command once, on a reply after its sixth repeat.
| bool dshot_edt_t::answered |
an extended frame arrived this run
| bool dshot_edt_t::asked |
an ask has started since the binding
| uint8_t dshot_edt_t::asks |
asks completed this run
| uint32_t dshot_edt_t::due_ms |
when the next ask may start
| uint8_t dshot_edt_t::left |
repeats still to send in the ask under way