ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

RC_Channel dead_zone is used in PWM range as well as in control/servo range

Open dongfang opened this issue 13 years ago • 3 comments

Class RC_Channel, when in RC_CHANNEL_TYPE_RANGE mode, features conversion of the "backend" radio PWM range [radio_min..radio_max] to a user defined range [_low .. _high].

The member _dead_zone specifies a value for which input below it should be considered zero. It is inconsistent whether dead_zone is a value in the [radio_min..radio_max] interval or the [_low .. _high] control_in interval or the [_low_out.._high_out] servo_out interval: in set_pwm(int16_t) _dead is compared to control_in (a [_low .. _high] value) in pwm_to_range() it is (via pwm_to_range_dz) added to radio_min (a [radio_min..radio_max] value).

Not too serious if the intervals are of about the same width. Are they?

dongfang avatar May 26 '13 00:05 dongfang

They are normally pretty close at least for the throttle channel. They're not close at all for the roll, pitch and yaw though. We should probably rewrite the RC_Channel library some time. It's very old and is overly confusing.

rmackay9 avatar May 28 '13 13:05 rmackay9

I was about to suggest the same rewrite myself. Maybe at a time in the summer, I will have some time with nothing to do than coding for 2 weeks. In that case I will volunteer :) Have some ideas already.

On Tue, May 28, 2013 at 3:20 PM, Randy Mackay [email protected]:

They are normally pretty close at least for the throttle channel. They're not close at all for the roll, pitch and yaw though. We should probably rewrite the RC_Channel library some time. It's very old and is overly confusing.

— Reply to this email directly or view it on GitHubhttps://github.com/diydrones/ardupilot/issues/303#issuecomment-18549615 .

dongfang avatar May 28 '13 20:05 dongfang

Thanks very much for spotting this Soren. The intervals were the same width for copter, but not for plane. For planes we had set a very small deadzone of 3 on the throttle channel to work around this problem. It should be fixed properly now.

tridge avatar Jul 13 '13 03:07 tridge