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?
You’ll want to follow the “momentary PWM” example from the bottom of this post, 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.