New pid coefficients

Firmware/software/electronics/mechanics
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

New pid coefficients

Post by Mitteau »

Hi
I tested last version of STM32-firmware with new coefficients in Advanced flight.
Much much better behavior.
Thanks
Jean-Claude
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: New pid coefficients

Post by tobias »

We should probably have found this a long time ago :oops: but as the CF2 is already flying better then the CF1 we didn't see the improvement potential...
A big thanks to @theshaunkelly!
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: New pid coefficients

Post by Mitteau »

Unfortunately, my crazy is really crazy and still crashes. I fly in advanced mode with new PID coefficients. Here you can see the instant of the crash in a flight log including the command by xbox (ctrltarget...).
flight05.png
The values of the parameter are given in the attached file.
The time in abscissa is 12 for 1 second. Throttle (throttle for ctrltarget...thrust) and thrust are in %.
Motor M4 has 0 command until time 12. Then it runs and the crazy starts an uncontrollable roll... M4 is a new motor.
At start crazyflie was stopped horizontal. Beginning of the flight was correct.
The end is on the back.
I think there is some electrical problem due to mechanical shocks?
regards
Jean-Claude
Attachments
Stabilizer-20160531T15-19-30-1.ods
(33.32 KiB) Downloaded 213 times
theseankelly
Expert
Posts: 153
Joined: Mon Dec 28, 2015 3:23 pm
Contact:

Re: New pid coefficients

Post by theseankelly »

Hey Jean-Claude

1) what's advanced mode? Do you mean self level disabled?
2) are you flying indoors or outdoors?
3) does this happen with the old pid values?

Sean
http://www.thejumperwire.com
Tips, tutorials, and science about DIY electronics, drones, and embedded software.
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: New pid coefficients

Post by Mitteau »

Hi theseankelly

I used advanced mode as in Python GUI Flight mode : advanced. Modified flight parameters were:
-Max thrust 99%,
-Min thrust 12% (to detect a bad motor),
-Thrust lowering slew rate 99%.

I was flying indoors in my office room.

I was testing the new PID values, firmware compiled with CFLAGS+=-DEXPERIMENTAL_ATTITUDE_PID, pitch and roll KI=500, etc...

Best regards.
Jean-Claude
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: New pid coefficients

Post by Mitteau »

Hi Sean
New flight this afternoon to test althold. Althold mode is initiated at time 0, with initial thrust 100%. I installed the GPS deck so craft is rather heavy.The phenomenon appears quite similar, as can be seen underneath:
fllight06-500.png
and with larger ordinates:
fllight06-2000.png
The instability appears after 1 second, and I immediately stopped althold mode.
I sincerely hope that you can find some explanation. I begin to :?
Regards
Jean-Claude
theseankelly
Expert
Posts: 153
Joined: Mon Dec 28, 2015 3:23 pm
Contact:

Re: New pid coefficients

Post by theseankelly »

Does it do the same thing with the old PID values? Try setting the Ki terms to zero (just the rate ones that are currently 500). That graph looks like it could be integral wind up and overshoot.
http://www.thejumperwire.com
Tips, tutorials, and science about DIY electronics, drones, and embedded software.
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: New pid coefficients

Post by Mitteau »

i'll test it and be back soon.
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: New pid coefficients

Post by Mitteau »

Hello Sean
The afore tests were done with a payload, namely gps:
SAM_1363_P.JPG
I did 4 flights without payload:

Normal flight mode, free flight (no althold):
JeanClaude
flight12.png
Good. Normal flight mode, althold:
flight11.png
and with different Y-axis:
flight11bis.png
Advanced flight mode, new coeff, free flight:
flight13.png
Excellent. Advanced flight mode, new coeff. althold:
Please see next post.
Payload seems to play a role.
Regards
Mitteau
Expert
Posts: 248
Joined: Fri Jan 29, 2016 6:00 am

Re: New pid coefficients

Post by Mitteau »

flight14.png
Post Reply