It is said that the SERVOn parameter setting range can be set between 1000 and 2000.
However, I set the QGC SERVOn min and max values to 1000 and 2000, but it does not seem to be applied. How can I reflect it?
Hi @HanJIK,
What are you actually trying to achieve?
The servo-output limits in ArduSub use different parameters depending on how the output is configured. Here are the most common ones:
SERVOn_FUNCTION |
Control Parameters | Notes |
---|---|---|
MotorN |
RC3_MIN/MAX |
ArduSub <= 4.1.0-beta |
MOT_PWM_MIN/MAX |
ArduSub >= 4.1.0 (stable) |
|
RCIN9 (Lights 1 Level) |
RC9_MIN/MAX |
See also Lights Setup Page |
RCIN10 (Lights 2) |
RC10_MIN/MAX |
|
mount_tilt |
SERVOn_MIN/MAX |
Camera Mount Setup Page |
Disabled (Servo) |
SERVOn_MIN/MAX |
servo_x_... (BTN) |
thanks for reply
I am trying to change to a motor with output PWM value of 1000-2000.
If I change the 6 motors, if I change the RC3_MIN/MAX value from 1000 to 2000, is it reflected in all 6 motors? Does it mean that the SERVOn value does not need to be changed??
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.