I have a jet drive catamaran that I want to move in a lawnmower pattern. Ideally, I want to use wp_pivot_angle and associated settings to decelerate the boat to a stop at each waypoint before performing the turn. Only issue is the boat’s jet drives use a servo actuated reverse bucket. What is the best way to set up ardurover so that it knows to drop the bucket and throttle up when reversing?
That sounds like a unique problem to solve, and not one that is supported so far as I know.
I can picture a way to potentially script the behavior, but it’s a little ugly (at least the way I can picture approaching it) and would require some development and testing.
@rmackay9 is pretty busy at the moment, but is certainly the best versed in Rover/boat behavior if he has the time to take a look at this.
How is your jet drive exactly working. If you want to reverse you first take throttle to zero, than you move the reverse bucket servo from full forward to full reverse, than you rise throttle again?
In normal forward drive mode you use different throttle inputs of the two jet drives for steering and you don’t use any other steering methode?
Than this all sounds like a skid steering.
The more I ponder this, the more complex a problem it seems to be. We do have ATC_BRAKE, which commands reverse throttle for deceleration. So a simple Lua mixer could cause any reverse throttle command to drop the bucket and apply forward throttle but…
I think there’d be some significant integrator windup as the reverse bucket drops, causing a simple mixer to accidentally produce acceleration until the reverse bucket is sufficiently in place. So we’d need a little more sophistication in the mixer to avoid that.
How fast does the reverse bucket actuate? Can it be successfully deployed while the throttle is off idle?
The jet drive esc works like a airplane esc with no reverse feature. Right now when I want to reverse, I flip a switch which drops both buckets over the jet exhaust nozzles and then throttle up. The bucket mechanism drops in about a second and is completely independent of the rest of the jet so you can actuate it at any throttle setting. When driving normally, I have throttle for forward and left and right vectors both jets. Left right also adjusts the power of each jet to help with the turn. In order to do skid steering, I would need only one jet to drop the reverse bucket
Here’s a video of the boat running. Don’t worry about the flexing, that was a temporary solution. https://www.youtube.com/watch?v=T_ZY0gY3XMs
https://www.youtube.com/watch?v=IFQc7KV5nmg
What are the existing inputs and outputs? Describe the channel layout and mixing.
Here are the channel outputs:
- throttle left
- throttle right
- rudder(left hull)
- rudder(right hull)
- RCIN_A(reverse buckets)
- RCIN_B(bow lateral thruster)
- RCIN_B(bow lateral thruster)
- RCIN_C(stern lateral thruster)
- RCIN_C(stern lateral thruster)
I have no idea how to support the lateral thrusters so I’m not gonna worry about it.
Ok, there’s nothing wrong with having both steering and left/right throttle outputs all on one frame, so vectored thrust is no problem.
The thing to tackle is reverse throttle. Answer my questions above regarding bucket deployment.
Also, can the buckets be deployed separately (with a minor wiring change)? Or are they on a single servo?
Buckets can drop within 1 second and can be dropped at any throttle output. Each bucket has its own servo. They can be deployed separately but right now I have them mapped to the same RCIN since I don’t know how else to do this.
What autopilot is installed?
Speedybee F405 wing but I have a few matek h743s.
Unless someone else can think of a creative solution, you’ll need one of those H7s to get the behavior you want, along with a Lua script.
I figured. It’s time to start learning.
My initial hack at it would be to assign ThrottleLeft and ThrottleRight to “synthetic” outputs (like SERVO15 and SERVO16).
Then assign the actual throttle and bucket servo outputs to scripting functions (94-97).
Monitor the throttle outputs via get_output_scaled
and set the scripted outputs to the absolute value of the polled values.
If the scaled output value is less than 0, drop the bucket for the associated side. Otherwise, retract.
Schedule the script at 10ms intervals so that it doesn’t too negatively impact the control loop.
Refine from there.
Sounds reasonable. I will look into it.
And set ATC_BRAKE = 1
Just a simple idea in addition to @Yuri_Rage approach, how I would pursue it as a first idea:
Use the throttle functions of the jet drives as brushed with relay output:
https://ardupilot.org/rover/docs/common-brushed-motors.html
The respective separate “relay” output must then trigger the servo output for the associated bucket.
You use the jet drives as normal skid steering
https://ardupilot.org/rover/docs/rover-motor-and-servo-configuration.html
The PILOT_STEER_TYPE remains as normal
https://ardupilot.org/rover/docs/rover-steering-input-type-and-reversing-behaviour.html
That’s a pretty good idea. Just realize that the relay pins operate as GPIO, so you’d still need either some extra hardware or a script to control the actual bucket servos.