ardupilot
ardupilot copied to clipboard
Custom Controller Backend Example: INDI and ADRC
This is PR adds new INDI and ADRC controller to the as a custom controller backend. This is a continuation of work done in https://github.com/ArduPilot/ardupilot/pull/21216.
These controllers were flight tested in their original implementation, but they have not been flight tested using the custom controller framework.
The readme file is also updated to reflect these new backend additions. I also a fixed a section related to the controller reset.
@esaldiran nice work!
Where are the autotests in here to make sure the controllers can actually fly (and continue to fly into the future) the vehicle?
I am going to add autotest. But, right now INDI backend can only be flown with quad frame class in x type due to inverse mixer calculation. I am trying to extend this to support all frame types under quad class.
hi,the code have a issue.
FAST_TASK(run_rate_controller), #if AC_CUSTOMCONTROL_MULTI_ENABLED == ENABLED FAST_TASK(run_custom_controller), #endif
when run run_custom_controller ,the run_rate_controller is running
hi,the code have a issue.
FAST_TASK(run_rate_controller), #if AC_CUSTOMCONTROL_MULTI_ENABLED == ENABLED FAST_TASK(run_custom_controller), #endif
when run run_custom_controller ,the run_rate_controller is runningI suppose this is intended, as the original controller should run right before the custom controller to generate the primary controller outputs.
BTW, is there a guide on tuning the parameters for ADRC? The SITL runs fine, but when I run it on a real copter, it oscillates like crazy, and tuning the b parameter only changes the frequency of the oscillation. I tried b within range 50-300, the oscillation persisted.
BTW, is there a guide on tuning the parameters for ADRC? The SITL runs fine, but when I run it on a real copter, it oscillates like crazy, and tuning the b parameter only changes the frequency of the oscillation. I tried b within range 50-300, the oscillation persisted.
@zhouzhiwen2000 I haven't read through ADRC formulation in detail but the implementation is based on PR https://github.com/ArduPilot/ardupilot/pull/20243 and it references the following master thesis Robust active disturbance rejection control scheme for quadrotor UAVs experimental prototyping
hi,the code have a issue.
FAST_TASK(run_rate_controller), #if AC_CUSTOMCONTROL_MULTI_ENABLED == ENABLED FAST_TASK(run_custom_controller), #endif
when run run_custom_controller ,the run_rate_controller is running
@lixiaowei123 This is by design. If the user wants to test a single axis(roll-pitch-yaw), we want the other axes to be controlled by the main controller.
BTW, is there a guide on tuning the parameters for ADRC? The SITL runs fine, but when I run it on a real copter, it oscillates like crazy, and tuning the b parameter only changes the frequency of the oscillation. I tried b within range 50-300, the oscillation persisted.
@zhouzhiwen2000 I haven't read through ADRC formulation in detail but the implementation is based on PR #20243 and it references the following master thesis Robust active disturbance rejection control scheme for quadrotor UAVs experimental prototyping
OK, I will check that out, thanks.
I think we do need flight testing on these though (and setting default parameters to something sensible) - when I did testing on my ADRC PR, the performance was a little sketchy and we couldn't figure out what tuning to do in order to make it more flyable. People are fairly familiar with how to tune PIDs (and there's lots of tuning guides available), but ADRC doesn't work the same.
In order for ADRC to be a usable controller, we'd need advice somewhere on how a person can tune it to work with their specific vehicle. A parameter description like "ADRC pitch axis ESO bandwidth(rad/s)" (which I think I just got from the original PR I based mine on) won't make sense to a lot of people - they won't know whether they should increase or decrease it to improve performance.
But since this is for test controllers in any case, if you don't know ADRC, we probably could just keep it as is and someone who knows how to tune it can hopefully add some further info.