# PWM servo control from cockpit

**URL:** <https://discuss.bluerobotics.com/t/pwm-servo-control-from-cockpit/23556>\
**Category:** BlueBoat\
**Created:** [September 5, 2026, 3:44pm UTC](https://discuss.bluerobotics.com/t/pwm-servo-control-from-cockpit/23556 "2026-09-05T15:44:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgrtmosina](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sgrtmosina](https://discuss.bluerobotics.com/u/sgrtmosina)\
**Post date:** [September 5, 2026, 3:44pm UTC](https://discuss.bluerobotics.com/t/pwm-servo-control-from-cockpit/23556/1 "2026-09-05T15:44:37Z")

</div>

Hello,

I built a winch for my boat to lower the sonar. I connected the BLDC servo motor via ESC to output 5 in the navigator.

I would like to set the control so that the servo works on 2 buttons on the joystick . I’d like to configure the controls so that the servo with two buttons on the joystick. When I hold down button, the winch retracts/unrolls, and when I release it, it stops.

Could someone tell me what to set in PWM OUTPUTS in BlueOS and in button mapping in Cockpit?

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [September 5, 2026, 8:22pm UTC](https://discuss.bluerobotics.com/t/pwm-servo-control-from-cockpit/23556/2 "2026-09-05T20:22:17Z")

</div>

Hi @sgrtmosina,

You’ll want to follow the “momentary PWM” example from the bottom of [this post](https://discuss.bluerobotics.com/t/relays-on-navigator/15823/12), except instead of one data lake variable and button assignment you’ll want two (e.g. “winch up” and “winch down”), and then the compound variable can be defined as something like `1500 + 400 * ({{ winch-up-id }} - {{ winch-down-id }})`, where the 400 should be half of your ESC’s input range (e.g. for 1000 to 2000 \mu s pulse durations you would use 500 instead), and if it the buttons do the opposite of what you want you can turn that `+` to a `-` (or set the `SERVOn_REVERSED` parameter to true).

Hope that helps! Feel free to follow up if it doesn’t work as expected, or something is still confusing.

---

<div class="post-metadata">

**Author:** ![sgrtmosina](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sgrtmosina](https://discuss.bluerobotics.com/u/sgrtmosina)\
**Post date:** [September 25, 2026, 1:09pm UTC](https://discuss.bluerobotics.com/t/pwm-servo-control-from-cockpit/23556/3 "2026-09-25T13:09:30Z")

</div>

It works. Thank you very much.
