Ardusub SERVO output range setting

3 posts were merged into an existing topic: BATTERY_STATUS MAVLink message

Yes, setting RC3_MIN/MAX will set the limits for all the thrusters, and the corresponding SERVOn parameters for the outputs assigned as MotorN are ignored.

I modified the RC3 max and min values to 2000 and 1000, but the values in SERVO_OUTPUT_RAW do not exceed 1900.

Please don’t delete a message and then post it again just to create extra notifications.

I’ve just tested this and found that it indeed does not seem to allow expanding the range, although reducing the range works fine. In the ArduSub source code the manual_control messages from the joystick are converted to rc_channel_overrides, and apparently there are hardcoded limits of 1100-1900 in that conversion code.

That’s unnecessarily restrictive, and is something that should get fixed, so you’re welcome to post a GitHub issue about it, or I will within the next few days.

I will post the above on the github issue board!
When will it be fixed?

Hopefully within the next couple of weeks, but no guarantees, particularly given it’s non-critical and isn’t important to most ArduSub users. It will be fixed when our software team have time to fix it, unless you (or someone else) decide to fix it earlier.

Are you saying that the hardcoded part you linked is a bug?
If it is possible to reduce the PWM value, could you possibly know a function that receives and reflects the PWM value?

It’s unnecessarily restrictive - whether or not that counts as a bug depends on your interpretation.
The important part is that it could be changed to be less restrictive without negatively impacting the default/normal functionality, so it would be an improvement to do so.

Note that we’ve since found that there are also other relevant parts of the code that use the same hardcoded limits (e.g. the * 400 in this line), and finding and fixing all relevant sections may be challenging.

Yes, reducing the range works fine, as discussed above.

I’m not certain what you mean by this.

If it’s helpful the SERVO_OUTPUT_RAW MAVLink message provides the PWM values being sent to the thrusters, which can be checked in QGC’s MAVLink Inspector, or received by code if you’re not using QGC.

What I understood was that if a PWM value range was specified, the thruster was operated within that range.
I am curious about the method ex setpwm(x, y) that applies PWM.

This one, or something else? To manually set the PWM of a single output requires the MAV_CMD_DO_SET_SERVO MAVLink command, but that’s only possible if the output is configured as a servo (and not as a motor, or lights, or an input or relay or something).

there are hardcoded limits of 1100-1900 ㅣWhat does this part do? Does this part have a function other than receiving the value from the joystick and applying it?

That converts the joystick axis values into the motion-focused RC Channels overrides.

Internally ArduSub operates on the assumption that all motor control commands are from radio control (RC) signals. RC has different channels that signals can be sent on, and the first 6 channels in ArduSub are used for motion commands (as discussed in our RC Input and Output docs). Those channel values are then considered in the context of the joystick gain, flight mode, vehicle frame, and motor servo limits (RC3_MIN/MAX) to set the output values for the servo outputs that are configured as motors.

Since we’re not actually using RC communication, we use RC channel overrides to provide equivalent signals to ArduSub.

Thank you~~~~~~!!!
Is it possible to use a PWM range above 1900 with just the hardcoded part fix? Do you have any other linked code?
Have a nice day~~

As above:

Some of them won’t be essential to fixing the issue (although fixing some and leaving others could cause issues elsewhere). We haven’t gone looking for every case of it, or determined exactly what is required for enabling a larger output range. It’s possible it’s just the two things that have been linked to already, but also very possible there are other limitations elsewhere.

8 posts were split to a new topic: ArduSub Horizontal+Vertical Thruster Coupling

thank you.
When a value other than MOT_PWM_MAX / _MIN value ‘0’ is applied among the ardusub parameters, is there a conflict with the RC3_MAX / _MIN / _TRIM value?
Which of the above two values has precedence?

In ArduSub 4.0.x, and possibly also the current 4.1.0-beta MOT_PWM_* are ignored, and RC3_* are always used (which is a bug). In 4.2.0-devel if MOT_PWM_* are 0 then RC3_* are used (as per the MOT_PWM_* descriptions), otherwise the MOT_PWM_* values are used.

Is it still not reflected in regards to PWM??

I don’t believe the PWM range is expandable yet, but have asked internally and will follow up with either confirmation or an issue link that you can track (instead of needing to ask for status updates) :slight_smile:

It has not been done yet, but I found your GitHub issue and passed it on to our main ArduSub developer, so any updates that occur will be noted there :slight_smile:

I also added a comment to the issue linking back to this forum post, so there’s some additional context provided :slight_smile: