-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ahrs_int_cmpl_quat frequency scaling #371
Conversation
Drumettaz said:
The ratio is not always 1, although as you said it's the case for aspirin. |
…CORRECT_FREQUENCY Allow tuning of the rate and bias gains. Scaling correction by AHRS_CORRECT_FREQUENCY should also give you roughly correct tuning for 100Hz fixedwings, see #240.
double gain scale to allow for a nicer range of the gains
not tested in flight yet...
beware of the usual arithmetic conversions!!
so it doesn't misbehave if you switch the gravity heuristic off in between
Just a (partial) paste from email so we don't loose it:
At least to some extent... yes. Not sure over what range this actually can scale. Assuming we want to calculate a correction that essentially stays the same regardless of the frequency the update is running at, then you basically only care how long ago you added the last correction. At what time this correction is actually applied doesn't matter as long as it is applied when the next attitude is computed and never applied twice... Different examples:
|
Hi Loic, I don't really have time to implement, let alone test this at the moment... Scaling bias with weight² sounds right. |
Nice! About the oscillations, might be overflows... we should implement the same in the float version and compare... And yes, setting cut-off frequency directly would indeed be nicer, someone just needs to implement that ;-) |
…er parameters are now cut-off frequency and damping instead of gains. Defaults values set to 100 s response time.
Hi, Here it is:
About oscilations at the begining of the bias correction, I think they come from calculation errors when attitude angles hit singularities (once every 6 seconds at 60°/s...)
Further developments:
Best regards |
Hm... Singularities? There shouldn't be any with these quaternion computations... And why call it accel_inv_[omega|zeta] and not just accel_[omega|zeta]? Don't think it hurts to be able to set these parameters while the systems is running... |
It really depends on the implementation you tested, but the oscillations in -Christophe On Fri, Mar 8, 2013 at 11:31 PM, Felix Ruess [email protected]:
|
Would it be possible to have the omega and zeta parameter in real units (i.e rad/s and no units between 0 and 1) ? I think it makes it more easy to tune. |
I'm working on a new version with omega and zeta parameters in universal units. |
…physical units, accel weight sent to telemetry
- accel and mag cutt-off frequency and damping in physical units - accel weight sent to telemetry
get latest code for testing, relevant fixes from master: - horizontal guidance fixes - use normal stabilization subsystem in NPS, was always euler in NPS before
…zeta nominal and min/max settings adjusted
- feedback_frac for both accel and mag correction - omega and zeta nominal and min/max settings adjusted
relevant fixes/features from master: - don't bypass normal ahrs estimation in NPS by default - use horizontal guidance ref by default (and for HOVER mode) - abs(c_route) and abs(s_route) instead of abs(route) in north and east route components calculation - guidance_h gains for Quad_LisaM_2 example
…b.com/paparazzi/paparazzi into ahrs_int_cmpl_quat_correction_scaling
Good idea. Made the gravity_heuristic_factor configurable (set to zero to disable). |
Does anyone else have some more input about default settings for the gravity_heuristic_factor? It is currently set to 30, but maybe the default should be lower (probably not completely zero/off)? |
Thanks a lot for the tests Loic! Also the filter value of this should probably depend on the update frequency as well... |
Also did you use the latest version? The weight should go exactly to 1.0 when setting the gravity_heuristic_factor to zero. |
No, that curves come from the tests I did last Thursday. |
In quite a few cases you don't want to do additional filtering the imu subsystem, in order to not introduce lag. In any case, could you maybe test again with a stronger filter on the norm (increase the FIR_FILTER_SIZE) and a factor of 10 or 20? |
Hello Felix, i have some time to do tests today. I lost the start of this thread. |
git remote update There are several tests you could do:
|
Hi Felix and Loic, i do a simple flight today and do some fast maneuver. As i understand this branch is intended to solve the problem of giro bias right ? For example, i put full pitch or full roll + throttle and then i put reverse pitch or roll to stop the horizontal speed and when i release the sticks the quad not stay horizontal. I need to use some pitch / roll to put quad horizontal. After some time it work fine again and when i release the stick the quad stay perfect horizontal. My frame a HK flywheel clone without imu damp. BTW, for reference, i fly other autopilot using unbalanced props and the stabilization work very well (stay horizontal when i release the sticks). |
@agressiva No, this doesn't "solve" the problem of gyro bias. That is not really possible with such a simple filter when you have bias drift AND trajectory accelerations. Did you check/log the weight reported in the AHRS_QUAT_INT message? @Drumettaz I'm still wondering if we should add another gain which to make only the gyro bias correction tuneable... so you can set it according to your expected bias drift or lower it if you expect to do a lot of fast maneuvers... |
Yes, the gyro bias is to be corrected. One of the purposes of this branch is to let the user configure the amount of confidence given to the accelerometer to correct the gyro biais. You may try higher FIR_FILTER_SIZE to filter the accelerations due to vibrations. If not succesfull, you can rise accel_omega. Then the bias will be corrected faster, but with less dynamic accuracy of the angles. A good compromise can be found between static and dynamic accuracy. How to find that compromise?
This can also be seen in simulation with nps using quad_lisa_m2 model. |
Not only the bias, but also more importantly the attitude angles. |
flixr said: " I'm still wondering if we should add another gain which to make only the gyro bias correction tuneable... so you can set it according to your expected bias drift or lower it if you expect to do a lot of fast maneuvers..." If we look at the simplified schematics at the begining of the discussion, where would you put that gain? |
In the simplified schematics that would probably be the K2 gain... but you can't set that independently of the rate correction, since if you change the cut off freq (w0) you also change K1. The gravity heuristics lower the correction of the attitude AND the bias... but just for the sake of argument assume that you have no gyro bias drift (in reality probably rather something quite low). It will then falsely also correct the gyro bias, where you would only want to correct the attitude angles... |
In case you have a good gyro, with very stable bias. You can reduce accel_omega, which reduces K1 and K2 gains. When K1 and K2 gains are reduced, it doesn't reduce the bias correction, it reduces the bandwitdh of the bias correction. It will take more time for the accelerometer to correct the gyro bias. |
Reducing omega is not what you want... you can still have lot's of noise on the gyro and hence integrate to a wrong attitude and you want to correct that using the accel. But you don't necessarily want to "correct" the bias. |
Hello felix, i do some flight using FIR_FILTER_SIZE = 16 and AHRS_GRAVITY_HEURISTIC_FACTOR = 50 Tomorrow i will reduce the GRAVITY_HEURISTIC back to 30 and then back to 10 and report the result. |
Starting to use int_cmpl_quat in a fixedwing of mine, let's see and keep an eye on PFD and a finger on the mode Manual RC switch ;). Test findings comming month(s)... |
merge to get latest features/fixes from master for conflict resolution and testing
@agressiva, any updates? |
Hy felix, my hexacopter was stolen last week. unfortunately i cant do more test for a few mounts. @agressiva, any updates? I would like to merge this rather sooner than later... (meaning in the next days). If we find better default values we can still change them after merging to master... — |
Very sorry to hear that Eduardo, that really sucks...
Thanks a lot for testing again! |
…scaling ahrs_int_cmpl_quat frequency scaling Proper scaling of corrections. Using AHRS_PROPAGATE_FREQUENCY, AHRS_CORRECT_FREQUENCY and AHRS_MAG_CORRECT_FREQUENCY. Hence this will also give you correct gains for 100Hz fixedwings, see #240. Allow tuning of the accel and mag correction natural freqency and damping. Tunable gravity_heuristic_factor (set to zero to turn it off and replaces the boolean AHRS_GRAVITY_UPDATE_NORM_HEURISTIC) If you have high vibrations, reduce this factor or completely turn it off...
Proper scaling of corrections.
Using AHRS_PROPAGATE_FREQUENCY, AHRS_CORRECT_FREQUENCY and AHRS_MAG_CORRECT_FREQUENCY.
Hence this will also give you correct gains for 100Hz fixedwings, see #240.