Hi PX4 Community,
I am working on implementing closed-loop feedback control for a motor in a rover (ground vehicle) using PX4. I have two questions and would appreciate guidance on best practices or architectural considerations:
1.Where to Integrate PID Feedback Control
I noticed that the final motor PWM output in PX4 is determined by the mixer module, which appears to operate in an open-loop manner. To add closed-loop PID control for a specific motor, where should the feedback logic be integrated? For example:
Should the PID controller be placed before the mixer (modifying inputs like thrust/torque commands)?Or should it directly adjust the PWM output after the mixer?
2.Correct Method to Obtain Motor RPM Feedback
What is the recommended way to retrieve motor RPM for feedback?
Use the rpm_capture
driver (e.g., via PWM input capture)?Or utilize NuttX’s quadrature encoder driver?
The mixer documentation mentions handling sensor/actuator configurations, but I’m unsure if there’s existing support for RPM feedback in rover applications.Any references to code modules (e.g., mixer implementation, sensor drivers) or design patterns in PX4 would be extremely helpful. Thank you for your advice!