PID settings for quadcopter

Here is the place for all your dsPic or autopilot questions.

Moderator: lukasz

PID settings for quadcopter

Postby TheBoD » Mon Aug 01, 2011 2:21 am

Tom, I have a couple of questions on a quad using the gluonpilot that I would appreciate your feedback on .

I have built a quad using the same motors and ESC as you suggest on the quad page on the forum. I have it set up in a test rig to tune the PID values. I am getting good stability on the roll axis (Motor 1 & 3) but getting consistent downward pitch at the front end at take-off speed settings. The quad holds a stable downward pitch so the system is stable. I have modified the glunopilot ground station so I can see the values being passed to the ESC for each motor and I see the value increase for the front motor M2 increase as the front pitches down - which is what I would expect to see but it is not enough to bring the quad horizontal again.

I have the P values close to each other for the pitch and roll axes with a low value for I and a zero value for D value.

Current values - for pitch P = 0.04, I = 0.0001, D = 0. For roll p = 0.045, I = 0.0001, D= 0.

I have tried higher values of P but it just causes it to oscillate about the horizontal which is what I would expect.

I am considering swapping the M2 & M4 motors to see if it pitches upwards instead which would suggest that one motor is slightly more powerful than the other. If that is the case then I think I would need to include a tweak in the software to slightly increase the speeed of motor 2. I don't have much experience with PID settings so I am wondering how I could tune the PID pitch settings so that I don't need to tweak the software. I have tried multiple settings on the PID values and these values are giving me the best results.

(1) Have you seen a similar behaviour and if so do you have any suggestion on how I might adjust the PID values

(2) On the PID config screen there is a field called altitude error - do I need to set the PID values in this ?

Thanks for your help.
TheBoD
 
Posts: 37
Joined: Mon Dec 07, 2009 8:45 pm

Re: PID settings for quadcopter

Postby Tom » Mon Aug 01, 2011 8:27 am

I would make the same conclusions as you do.

I would propose to slightly trim using your RC-transmitter and see if that improves.

The downside of those cheap motors is that they are never 100% equal...

Also see if the weight is perfectly balanced.
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: PID settings for quadcopter

Postby Vanags » Sun Aug 07, 2011 11:27 am

TheBoD, I think you should check accelerometer calibration and quads weight center.
:)
Tom, what about X mode mixing. I try to convince myself to buy gluonpilot RTF :)
Vanags
 
Posts: 4
Joined: Sat Aug 06, 2011 7:51 pm

Re: PID settings for quadcopter

Postby Tom » Sun Aug 07, 2011 7:26 pm

X-mode mixing is just one extra line of code ;-)

If you are interested in plane, please buy a gluonpilot :-)
If you are mostly interested in quadrocopters RTF, there are better options out there. For gluonpilot its still experimental...
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium

Re: PID settings for quadcopter

Postby Vanags » Sun Aug 07, 2011 8:15 pm

Tom, i have seen and gutted only MultiWii and Baronpilot (all AVR) , so I know x-mode really is almost one line of code (actually 6- 4 motors+definition+#elif ,or if-else :) )
Thing is, I am not very familiar with dsPIC, and the gluon mixing routine is different.

I am interested in quadrocopter autopilot board RTF, but really gluonpilot is very interesting anyways.
Vanags
 
Posts: 4
Joined: Sat Aug 06, 2011 7:51 pm

Re: PID settings for quadcopter

Postby Tom » Mon Aug 08, 2011 7:16 am

It is dsPic, but all hardware-related code is already implemented.
If you want to change things, you only have to program regular c code.
User avatar
Tom
Site Admin
 
Posts: 1016
Joined: Fri Nov 13, 2009 6:27 pm
Location: Belgium


Return to Firmware

Who is online

Users browsing this forum: No registered users and 3 guests

cron