mrAyaz / ardupilot-mega

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

Throttle channel in Mission Planner loses resultion #486

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
No matter what Throttle gain is set to, the full resolution of the throttle 
channel is not passed to the simulators.

This may be due to this line in Simulation.cs

  throttle_out = ((float)MainV2.cs.hilch3 + 5000) / throttlegain;

The result is either available throttle range is compressed into the middle 
where 0.0 and 1.0 are far above the bottom, and below the top, of the actual 
rang, or if Throttle Gain is set too high, it maximum throttle is not reached.

Original issue reported on code.google.com by justinbe...@gmail.com on 16 Jan 2012 at 8:48

GoogleCodeExporter commented 8 years ago
so what are you actualy saying?

Original comment by Meee...@gmail.com on 16 Jan 2012 at 10:52

GoogleCodeExporter commented 8 years ago
throttle is scalled from 0-10000, why are you scaling throttle from anything 
but the default?

Original comment by Meee...@gmail.com on 16 Jan 2012 at 10:53

GoogleCodeExporter commented 8 years ago
Throttle is by default scaled by 10000, but then the lower 1/4 and upper 1/4 of 
the range of 0-100 reaches X-plane as 0.0 In other words when ArduPlane sets 
the throttle to (10%), X-Plane sees 0.0. When it sets it to (90%) X-Plane sees 
100%. 
ch3 out might be set in eeprom to be 1100 for 0% and 1900 for 100% for a 
particular radio. 1100 thru 1300 all maps to 0%, then it increases linearly, 
and tops out way below 1900.

Increasing to 15000 helps, but it is still impossible to get from 0-100 to map 
to 0-100 in X-Plane.

Sorry if this isn't clear. I feel the reason is the line of code in mission 
planner that I included with the magic number of 5000 in it.

Original comment by justinbe...@gmail.com on 16 Jan 2012 at 11:02

GoogleCodeExporter commented 8 years ago
Hi Justin, verified the issue
and the fix is this
throttle_out = ((float)MainV2.cs.hilch3 / 2 + 5000) / throttlegain;

hil / 2 = -5000 to 5000  + 5000 = 0.0-1.0

Original comment by Meee...@gmail.com on 20 Jan 2012 at 4:53

GoogleCodeExporter commented 8 years ago

Original comment by Meee...@gmail.com on 20 Jan 2012 at 4:55