coby7016 / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

APM Planner shows incorrect values for PID #189

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using the new APM Planner I see strange behaviours when setting PID for  
Roll/Pitch.
Example:
Open PID screen
Set Roll and Pitch P to 0.44
Set Roll and Pitch I to 0.023
Update PIDs
Close and re-open planner
heck PIDs: P = 0.4394531 for both
           I = 0.02246094 for both

This was also happening with previous mission planner but only when going over 
second decimal eg: 0.17 worked good, 0.175 returned bad value.
My regional settings are Default for English/Us:
English/US
Decimal Simbol .
Number of digits after decimal 2

Emile

Original issue reported on code.google.com by emile.ca...@gmail.com on 6 Jun 2011 at 6:06

Attachments:

GoogleCodeExporter commented 9 years ago
This issue also affects APM. I have seen it in Servo Roll P and Servo Yaw P.

Original comment by d...@w1ngz.net on 6 Jun 2011 at 4:09

GoogleCodeExporter commented 9 years ago

Original comment by Meee...@gmail.com on 7 Jun 2011 at 12:20

GoogleCodeExporter commented 9 years ago
this is a rounding problem on the apm side, and there is nothing i can do about 
it, apart from maybe hide it from you. the saved value on the apm is the one on 
the left, the up down box's will always round to 3 sig fig, this is just to 
simplify things

Original comment by Meee...@gmail.com on 7 Jun 2011 at 12:52

GoogleCodeExporter commented 9 years ago
Is the saved value really 0.4394531, or is that just a manifestation of it 
stored as/sent over mavlink as a float?

Maybe there needs to be rounding on both sides of the link.  Both in APM and in 
the mission planner.

If you send 0.44, it should be "used" as 0.44.  Not 0.4394531 (which is likely 
caused because of float precision differences.)

Just my 2 cents on the subject.

chris.

Original comment by ch...@chrisandtennille.com on 7 Jun 2011 at 2:39

GoogleCodeExporter commented 9 years ago
I agree. If we reset PID values to default values and use MP, we see correct 
values.
If we save from MP, values get wrong. So it is not how it is stored or 
displayed, but how it is saved. Either it gets casted as a float in Arduino, or 
it is casted wrong in .NET.
Also if you click on arrows when 0.4394531 is displyed, the value goes up to 
4.3 or something really wrong....

Original comment by emile.ca...@gmail.com on 7 Jun 2011 at 4:17

GoogleCodeExporter commented 9 years ago
emile, what os are you using. in the up down box's mine only ever shows 3 sig 
fig, apart from if i type something else into it.

Original comment by Meee...@gmail.com on 8 Jun 2011 at 3:04

GoogleCodeExporter commented 9 years ago
ok this error is caused by the conversion from a 32bit float to a 16 bit float. 
The planner sends as a 32 bit float, which is required by mavlink. on the apm 
the 32 > 16 bit conversion is done and that is where the loss is occuring.

the error is only 0.000469, and not really worth worrying about.

Original comment by Meee...@gmail.com on 8 Jun 2011 at 3:52

GoogleCodeExporter commented 9 years ago

Original comment by Meee...@gmail.com on 15 Jun 2011 at 3:05