kostakis52 / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

Yaw PID does not apply any rudder. #382

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Give airplane a yaw P gain of 10. Set rudder mix to 0.
2. Tilt airplane on it's side to apply 1 g of lateral acceleration.
3. Observe no rudder activity.
4. Increase yaw P to 600.
5. Observe some rudder activity.
6. Reset APM
7. Observe Yaw P gain has been constrained back down to 44 on boot.

What is the expected output? What do you see instead?
Rudder should respond to lateral acceleration at reasonable P gains. It does 
not.

What version of the product are you using? On what operating system?
Ardupilot Mega w/ (I think) 2.5.3 firmware.

Please provide any additional information below.
I recommend multiplying the error (which is taken directly from the 
accelerometer) by 100 to 500 before it goes into the PID filter. I have done 
this for myself already, essentially setting the gain to 1200. It may or may 
not be having the jitters in the air, but I can't see it.

Original issue reported on code.google.com by Mr.Challinger@gmail.com on 18 Jul 2011 at 4:47

GoogleCodeExporter commented 9 years ago
the yaw output is based on circular motion, and not meant for knife edge.
ie yaw responce is to rotational force, not static acceleration.

Original comment by Meee...@gmail.com on 19 Jul 2011 at 8:07

GoogleCodeExporter commented 9 years ago
No, yaw response in a plane is to lateral acceleration. That's what coordinated 
flight is. 
http://en.wikipedia.org/wiki/Coordinated_flight
An airplane is in coordinated flight (i.e. the relative wind is parallel to the 
fuselage of the plane) when the ball on an inclinometer is in the middle. 
That's how pilots coordinate their flight.

I was using the example of tilting the plane on its side to apply 1g of lateral 
acceleration. This would be a very, very uncoordinated turn. The turn and bank 
indicator in an airplane shows 0.07g of lateral acceleration per ball width.

The APM code has this function built in. It takes the value straight from the Y 
accelerometer and puts it into the yaw PID. However, it looks as though it was 
never tested and is a couple orders of magnitude less responsive than it should 
be.

Original comment by Mr.Challinger@gmail.com on 19 Jul 2011 at 3:21

GoogleCodeExporter commented 9 years ago
Reasons to coordinate flight (straight from wikipedia):
it is more comfortable for the occupants (in this case, our occupants are 
probably instruments.)
it minimises the drag force on the aircraft (fly further, longer.)
it minimises the risk of entering a spin (my plane already mostly refuses to 
spin, but some airframes will spin at the drop of a hat.)

Original comment by Mr.Challinger@gmail.com on 19 Jul 2011 at 3:27

GoogleCodeExporter commented 9 years ago
This is a (possibly) a legitimate bug report.  Last time I checked yaw PID 
functionality on the ground it worked fine.  The results Mr.Chall is reporting 
are not the correct results.  I will investigate.

If using the yaw PID values the rudder should respond to rolling the airframe 
on the ground.  This response should be separate from (and opposite on the 
ground from) the response caused by using Rudder_Mix)

Original comment by dewei...@gmail.com on 17 Aug 2011 at 12:42

GoogleCodeExporter commented 9 years ago
By the way, I fixed this for myself long ago by multiplying error by 100.
So in calc_nav_yaw:
"[...] + g.pidServoRudder.get_pid(error*100, delta_ms_fast_loop, speed_scaler);"
I've been using 3.5 for my P after making this change.
I now have telemetry so I should be able to watch raw y accel during turns to 
get my rudder tuned.

Could you make this change if you haven't already?

Original comment by Mr.Challinger@gmail.com on 17 Dec 2011 at 8:13

GoogleCodeExporter commented 9 years ago
A patch has been pushed to the trunk, and should appear in the next hex when 
one is pushed.

Sorry for the long delay.  

Original comment by dewei...@gmail.com on 26 Dec 2011 at 8:41