ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11.01k stars 17.55k forks source link

SERVOn_MIN and SERVOn_MAX have no effect when using RCINn #18379

Closed drtrigon closed 2 years ago

drtrigon commented 3 years ago

Bug report

Issue details

SERVOn_MIN and SERVOn_MAX seem to have no effect when using RCINn in SERVOn_FUNCTION.

Example: I configure a gimbal e.g. SERVO8_FUNCTION=mount_tilt and SERVO9_FUNCTION=mount_roll and then use the min and max to configure the travel. When I now switch to SERVO8_FUNCTION=RCIN9 and SERVO9_FUNCTION=RCIN10 the given min and max do not apply anymore. Instead it just uses what comes from the RC receiver.

I think that is wrong behavior. Consider the fact that the RC channels do get calibrated so the calibrated range should be mapped to the configured output range. Currently it just seems to be kind of pass-trough behavior.

In my case I would like to use this to extend the PWM values to a range that my RC cannot generate (but the FC can).

This might be related or the same issue than https://github.com/ArduPilot/ardupilot/pull/7133, https://github.com/ArduPilot/ardupilot/issues/9830, https://github.com/ArduPilot/ardupilot/issues/10488 (is a Sub-4.2 milestone)

Version 4.0.7

Platform [ ] All [ ] AntennaTracker [X] Copter [ ] Plane [ ] Rover [ ] Submarine

Airframe type Quad X

Hardware type Matek H743 Wing

IamPete1 commented 3 years ago

It is by design to be direct passthrough. We could add a new set of output RC x Scaled where they could apply the min, max, trim and reversing.

It sounds like in your case your just trying to control the gimbal? How about using the MNT_RC_IN_ROLL/MNT_RC_IN_TILT/MNT__RC_IN_PAN params?

drtrigon commented 3 years ago

It is by design to be direct passthrough. We could add a new set of output RC x Scaled where they could apply the min, max, trim and reversing.

Yes, please!

Even though it is somehow strange to have to select the correct input in order to have the output to scale. But meanwhile I read through the other issues and do somehow understand the historic implications. So I like this proposal!

It would be great when the docu could contain some hints about these details, e.g. the pass-through behavior.

It sounds like in your case your just trying to control the gimbal? How about using the MNT_RC_IN_ROLL/MNT_RC_IN_TILT/MNT__RC_IN_PAN params?

Yes, but I have some needs that ArduPilot cannot fullfil as I have to conclude from docu:

If you have some hints on how to do this it would be very welcome!

drtrigon commented 3 years ago

In what release will this be?

lthall commented 3 years ago

I was trying to do the same things and was frustrated by this too.

These parameters MNT_RC_IN_ROLL/MNT_RC_IN_TILT/MNT__RC_IN_PAN specify the inputs not the outputs. As far as I could tell there was no way to pass them to the output directly to MountPan and MountTilt.

It would be good to remove these remote servo setting parameters and use only RCXX_OPTION and SERVOXX_FUNCTION to define the inputs and outputs. Even for roll, pitch, yaw and mode channels.

drtrigon commented 2 years ago

@IamPete1: What about bringing this to a dev call?

drtrigon commented 2 years ago

@IamPete1: Can you explain to me what the label "good first issue" means? Do I have to take further action? Or what does happen next?

IamPete1 commented 2 years ago

@drtrigon It marks it as something relatively straight forward that a new developer could take on.

IamPete1 commented 2 years ago

Closed by https://github.com/ArduPilot/ardupilot/pull/21347 we now have output function RCIN1Scaled ... RCIN16Scaled

drtrigon commented 2 years ago

Brilliant!

Thanks @IamPete1 and everybody involved into #21347 !