Hi all,
I have a question regarding gain scheduling based on GPS speed.
I've read in the autopilot Field Guide table 29 on page 71 that:
pidGnSchVar < pidGnSchMin | pidGnSchVar is outside of the range of allowed values for this PID record. No calculation takes place.
pidGnSchVar > pidGnSch3 | pidGnSchVar is outside of the range of allowed values for this PID record. No calculation takes place.
In simulation I can see that outside of the gain schedule range, the loop holds the last calculated value before the gain scheduled variable is outside of the allowed range.
In order for me to choose the right values for the range of the gain schedules, I would like to know what happens to the ground speed and air speed readings in case of errors / malfunctions.
Say I gain schedule loops based on GPS speed, what happens to the GPS speed indication if GPS lock is lost?
Will the GPS speed be set to 0?
Meaning that if I have a gain schedule active at GPS speed = 0, the gains of that schedule are used?
In order to have reliable behavior during GPS failures it might be better to have GPS speed = 0 outside of the allowed range in that case?
Many thanks in advance,
Marijn Hoogendoorn
Tags:
Views: 61
Hello Marjin,
Thank you for your question!
GPS speed remains at the last known value during a loss of GNSS event.
Depending on the difference in your gain scheduling between high GPS speeds and low GPS speeds, this might in fact be desirable, as an instantaneous switch in your gains from the gains for high speed to gains for low speed could be problematic.
I would not recommend scheduling your gains based on GPS speed at all really, as your aircraft dynamics on a multirotor and on a fixed wing depend on airspeed, not ground speed. Having said that, sometimes you do not have access to airspeed, and for such vehicles, it may be inevitable. Nevertheless, even for hovering vehicles, I would recommend scheduling your gains based on your load instead of your speed.
Now, if you still did want to switch to your speed=0 gains during GNSS loss, you could write a thread to set GPS speed to 0 while GNSS is lost. Since during a loss of GNSS, GPS speed is not updated, a thread will work nicely.
I tried the following in simulation and found it to work successfully:
thread 3
waitEqual [gpsOK], 0
[gpsSpeed]=0
skipEqual [gpsOK], 1, -2
repeat -2
Cheers,
Matias
Hi Matias,
Thanks for your elaborate reply!
My question was mainly to get an understanding of the gain scheduling behavior in cases of sensor faults, losing GNSS lock was the most obvious example.
I did some more simulation testing in the meantime, and together with your answers I now have a clear picture of how the system will respond in those cases.
Most of our loops are indeed scheduled on airspeed, with the exception of the loop controlling the nose wheel while on the ground. (It's a large fixed wing UAV)
I think for this particular loop, using the gain schedule of the last known value during a loss of GNSS event would indeed be best.
Else your solution with the thread would be a good option to give deterministic behavior in case of GNSS failures. Thanks!
Cheers,
Marijn
© 2024 Created by MicroPilotNingAdmin. Powered by