How to use servos correctly?

Hi @Robi_Sen,

This is correct

You shouldn’t need to change this - ArduSub has it set to 4 by default, and the first three can be controlled using the joystick controls (the servo_n_* functions), or you can control all 4 using pymavlink. Out of interest, do you know where you got the impression that you should change it?

Assuming you want to control your servo by fully turning it in each direction, that should be fine. If you want to control it in smaller steps then you likely want servo_1_inc and servo_1_dec to increment/decrement the set angle.

From your image I assume you’re using a Pixhawk 4. The IO-PWM-in connection in your photo is for motor control - if the thrusters are working correctly then presumably you’ve correctly connected that to the I/O PWM OUT port of the Pixhawk 4. Servo connections go through the AUX pins, and it looks like you haven’t connected the FMU PWM OUT port from the Pixhawk 4 to the FMU-PWM-in port of your power management board (PM board), so there’s no way for the servo signal to get through. I expect plugging in that cable should solve your problem, since the rest of your setup seems fine :slight_smile:


On an unrelated note, if you’re not already on it I’d suggest using the ArduSub 4.2 firmware (Development instead of Stable), as it includes some changes to enable the leak detector and pressure sensor functionality with a Pixhawk 4 (as per here).

1 Like