Do_Winch mission waypoints not working with daiwa winch

How does the DO_WINCH command work? is it supposed to use PWM to control the winch, and use the feedback from the serial port to know when to stop/deliver/etc?

Recently I’ve gotten my daiwa winch working as per the documentation: Daiwa Winch — Copter documentation.

I also have data coming through on WINCH_STATUS:


The problem is, even though the winch works fine through PWM controls, the DO_WINCH mission waypoints don’t do anything other than releasing the clutch of the winch.
I’ve tried to test this on the bench and also have similar results.

Here’s the code i’m using to send command 42600 (MAV_CMD_DO_WINCH: Messages (common) · MAVLink Developer Guide)

import time
from pymavlink import mavutil


autopilot = mavutil.mavlink_connection('udpin:')

msg = None

# wait for autopilot connection
while msg is None:
        msg = autopilot.recv_msg()

print (msg)

# The values of these heartbeat fields is not really important here
# I just used the same numbers that QGC uses
# It is standard practice for any system communicating via mavlink emit the HEARTBEAT message at 1Hz! Your autopilot may not behave the way you want otherwise!
6, # type
8, # autopilot
192, # base_mode
0, # custom_mode
4, # system_status
3  # mavlink_version

1, # autopilot system id
1, # autopilot component id
0 # unused parameters for this command

The mavproxy screen shows that the message gets sent properly:


I’ve tried to use all kinds of inputs in winch actions (Messages (common) · MAVLink Developer Guide), including winch length control, winch deliver, winch retract, etc. all result in only relaxing the clutch.

Does everything look set up properly here? Is do_winch working correctly for anyone else?

bumping this. if anyone thats wrote the libraries/had close experience with them can comment i’d be ever grateful. my CS literary skills arent that developed yet

Pinging @rmackay9, this is the question that Hush Aero contacted you about. All parameters are set to documentation including rcx_option to 45 for winch control.

Side note, rcx_option 45 isnt denoted in the parameters list


Hi @ohitstarik,

I think maybe the arguments are offset by 1 field when sending the command.

We’ve got an AP mavlink interface guide here on the wiki and perhaps the most similar command is the do-set-servo.

I think maybe you’re missing the “confirmation” field which can be set to anything (e.g. 0) so all the args are shifted by one field.

By the way, you can also test using MAVProxy’s long command. Below most commands described on our wiki I’ve put a copy-and-paste-able command for MAVProxy.

Thanks for the note on the missing auxiliary function, I’ve created a PR to fix this.

I’ve also created this wiki PR to add more instructions on setting up a winch in SITL and how to control it via MAVLink.

Hey @rmackay9 . I’ve gotten the winch moving with mavproxy long commands in both SITL and real life with a bench mounted vehicle+winch.

The problem is that the winch isnt able to move with DO_WINCH commands from missionplanner/auto mission waypoints while in flight. How can we debug/fix this?

I also cant send a winch deliver command from mavproxy to the bench vehicle, or SITL.
I have a feeling this is because SITL is PWM only (no telemetry) and the bench vehicle is not in flight so the deliver command fails. Is that about right or should we be able to use the do_winch deliver command while on the table? Is there any way we can make it so we can do winch deliver while testing on the table?

Hi @ohitstarik,

Great that you’ve got it working with the mavlink commands.

The do-winch command should also work while the vehicle is in Auto mode and it doesn’t matter if its on the table or not. Do commands placed after a navigation command (e.g. WAYPOINT command) will start running as soon as that navigation command completes… so it might help to make the do-winch command the first command in the list and then set MIS_RESTART = 1 and then each time you switch the vehicle to Auto mode the command should start.

It’s odd that you can’t get the winch to move using MAVProxy. I’ve created [this wiki page](https:// don’t quite understand the contradiction when you say, “I’ve gotten the winch moving with mavproxy long commands in both SITL and real life” but then say, “I also cant send a winch deliver command from mavproxy to the bench vehicle, or SITL”. ) which gives the exact commands to run and I’ve tested it and it seems to work.

Sorry, let me rephrase.

Sending MAVlink messages that unwind the winch by x meters works fine. However, when I try to send a MAVlink command that would “deliver” a package (unwind until it hits the floor, then reel the line back up), I get the above message, “Got COMMAND_ACK: DO_WINCH: FAILED”. The long command I try to send is:

message COMMAND_LONG 0 0 42600 0 0 4 0 0 0 0

this returns “Got COMMAND_ACK: DO_WINCH: FAILED” on both the SITL and the vehicle on the bench.

the long commands that just release x amount of line:

message COMMAND_LONG 0 0 42600 0 0 1 5 0 0 0 0

work just fine on both SITL and on the vehicle on the bench.

I appreciate the method on the auto missions. I’ll test once I’m in the office Monday.

Hi @ohitstarik,

ArduPilot doesn’t support the Action “4” (that mavlink item was added relatively recently). I don’t think that there is any way that a simple PWM winch nor Daiwa winch could support it actually.

ArduPilot does support Payload Place though which uses the motor output to detect when the package has hit the ground.

1 Like

Hey @rmackay9, I see. This explains it. It should be capable though, no? Since the daiwa winch has a force sensor it should have all information required to lower the package and sense when the package has been dropped. Thats a separate project though. This explains the problem i’m having.

I appreciate you for your time!

Hi @ohitstarik,

Yes, you’re right that we could implement the deliver action so I’ve created a to-do item here. I can’t promise when anyone will get to this but who knows… I have a search and rescue competition in Oct so I might work on this. If you wanted to work on it I could give some advice. I mentioned in the issue that would could add it as part of Payload Place mission command but I think it would be better to implement it separate from that.

Advice would be great, i’m interested in working on it. Im dropping a comment on the git for that, hope thats alright. Appreciate it @rmackay9