Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoAdd per-motor DShot direction configuration and bounded test pulses
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1.
|
|
/agentic_review |
|
RAM / Flash usage vs. base commit
See RAM/flash optimization guide for techniques to reduce usage. |
|
Code review by qodo was updated up to the latest commit 2af2025 |
|
Test firmware build ready — commit Download firmware for PR #12011 250 targets built. Find your board's
|
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit e57053d |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 5018715 |
|
Hello @Raffi1202 and thank you for that PR. Its a very nice QoL feature for copter pilots. I would like to address a few things though. Critical parts firstFeature freeze: INAV 10 is feature locked. But as I can see, there is no change in the Config scheme so its technically possible to consider it for 10.1. But this will need a version/feature gating in the INAV configurator so Configurator 10.1 will not show the Interface for a 10.0 FC. Compatibility has to be considered both ways. Alternatively rebase the PR to 11.x but you will need to followw up if conflicts happen. Setting dshot config: that is the part that I do not like. Reading, writing and saving settings to an ESC should not be done by a 3rd party (that is INAV in that case). There are multiple different ESC firmware variants out there where we do not know their capabilities of each version. Writing the config without knowing what's there is a no-go. The alternative: the reverse flag in the actual dshot init (DShot-Cmd 20/21 ( OptimizationCondensse into a single MSP message: With these changes, the same thing can be achieved and the bitmask then only needs to be wired to the dshot control loop to define if each motor gets a normal or inverted direction signal with each dshot message. This can be defined at boot time. That should significantly reduce the flash demand for the same feature. Some implications to consider
Happy to discuss before you start refactoring. |
|
Agreed on all three points. Proposed rework, before I touch code: Branch. Retarget both PRs to Setting instead of ESC config. Drop DShot 7/8/12 and all three MSP codes (0x2235-0x2237). New Per-motor addressing. The command queue in When it is sent. 20/21 are volatile, so the FC has to re-apply them:
An ESC that resets in flight falls back to its stored direction; it also will not re-arm while throttle is non-zero, so that motor is lost either way. No runtime scheme fixes that, and neither did the persistent variant - I will state it in the docs. Turtle. Configurator. No separate dialog. The mixer motor wizard (#2580) already spins each motor via Flash. Removes the sequencer, the SITL simulation, the state machine test and the MSP handlers; adds one setting, per-motor queue entries and the arm/disarm hook. Net should be well under the current +900 lines. Open question: periodic re-send while disarmed, or a hard arming block until the direction has been sent after battery detection (vbat present + ESC boot delay)? The re-send is simpler and covers the same cases without a new arming flag. |
|
This sounds good to me. Resending is fine It will also make sure that the setting is persistent if a EEPROM save interrupts dshot that was a topic in the past. The Motor loss on brownout is acceptable in my opinion. Even right now when an ESC resets mid flight it would take a few seconds to come back and in 99% of cases the copter reaches the ground before that happens. From my perspective, that's a solid plan and I am looking forward to the update. |
|
Superseded by #12022 (maintenance-11.x, bitmask + DShot 20/21 as discussed above). |
Problem and behavior
Add per-motor DShot direction configuration and a bounded test pulse for an integrated Configurator wizard. Commands 7/8 and SAVE_SETTINGS (12) target only the selected motor; other outputs stay at zero during the operation. Settings live in the ESC. Completion means commands sent, not confirmed persistence.
Existing arming rules are unchanged: no new arming flag or persistent lock. Requests are rejected while armed or ordinary motor testing is active. Arming cancels the operation before the next output frame and restores normal output ownership. Ordinary motor testing works normally after the operation. Cancellation retains tokens so delayed retries cannot restart it.
The fixed DShot120 test pulse expires after 1.5 seconds independently of USB/UI. Duplicate tokens cannot repeat a save or extend/restart a pulse. SITL uses the same sequencer and reports simulation explicitly.
Integration
Validation
Hardware test plan and limitations
Physical hardware has not been tested. With all propellers removed:
See docs/development/msp/esc-direction.md for protocol details.