ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

ADRC: Active Disturbance Rejection Control

Open MichelleRos opened this issue 2 years ago • 8 comments

This adds the ADRC controller as an option for Copter attitude control.

Thanks to @xianglunkai for his earlier PR #20079 which this is adapted from.

MichelleRos avatar Mar 07 '22 09:03 MichelleRos

I suggest fix some little bugs.

float fal(float e, float alpha, float delta) { if(is_zero(delta)){ return e; }

if(fabsf(e) < delta){
    return e / (powf(delta, 1.0f-alpha));
}else{
    return powf(fabsf(e), alpha) * sign(e);
}

}

and....float sign(float val) { if(val > 0.0f) return 1.0f; else if(val < 0.0f) return -1.0f; else { return 0; } }

xianglunkai avatar Mar 07 '22 14:03 xianglunkai

I suggest fix some little bugs.

thanks, added

tridge avatar Mar 07 '22 19:03 tridge

Should add AP_HAL_ADRC_RATE_CONTROLLER_ENABLED in Tools/scripts/build_options.py and use it.

this is just an experiment, it would be structured quite differently if we were to consider it for merging into master

tridge avatar Mar 07 '22 19:03 tridge

@xianglunkai Thanks for the fixes. Did you get the equations you used from a specific paper by any chance? I've looked at some ADRC papers and they have similar maths but not the exact same - seems to be adapted to each specific application?

MichelleRos avatar Mar 08 '22 03:03 MichelleRos

I suggest you could take a look at this paper about ADRC Jiachi_Zou_Thesis 2018 ADRC UAV Github.pdf .

xianglunkai avatar Mar 08 '22 03:03 xianglunkai

@xianglunkai Thanks. I'll have a look.

MichelleRos avatar Mar 08 '22 04:03 MichelleRos

Good to know that my thesis helps!

FYI, here is a test video I did before with ADRC: https://www.youtube.com/watch?v=77-_nF-qqpA&t=191s And the test code can be found here: https://github.com/JcZou/StarryPilot/blob/master/starry_fmu/Framework/source/Control/adrc_att.c

In yours implementation, fal non-linear control law is used, which is standard method introduced by ADRC. However, based on my experience, a well-tuned PID + ESO would get a better performance, as fal is relatively too sensitive for the error.

JcZou avatar Mar 18 '22 00:03 JcZou

@xianglunkai 微信

lixiaowei123 avatar Jul 28 '22 08:07 lixiaowei123