Skid Steer + Ground Steering boat

LOL! Since I don’t know Lua, I never considered it. What’s that saying, if all you have is a hammer, everything looks like a nail? I’m there…

1 Like

That must be a newer sanity check. I remember running such a configuration in the past, but I do not remember with which firmware version. I now use a LUA script to control the active castor wheel on my rover.

1 Like

I do this on my boat, skid steer + two rudders using the ground steering for rudders and left/right esc. Works for me, I think I have all arming checks off though. I don’t recall any messages like you’re seeing. I can attach the parameters if you want to see?

As others say, AP doesn’t officially support both skid-steering and ackermann steering on the same vehicle (issue is here). The underlying difficulty is that ackermann steering must be scaled by the vehicles speed (the rudder response grows as the vehicle speeds up) while skid-steering is not scaled.

Looking at the code though I think we may have accidentally resolved the problem because the scaling is applied independently within the ackermann output method and that’s a local variable so it shouldn’t affect the skid steering.

… so my guess is that we can actually remove that arming check and it will work (but we need to test in the simulator to be sure).

Turning off all arming checks is generally a bad idea because it will hide other problems but that might be your only option for now (assuming you want both to work).

2 Likes

It crossed my mind that scripted rudder output should be scaled with speed, but I thought perhaps that might happen naturally when the skid steering outputs are adjusted via the rate controller. Might be interesting to remove the arming check (in firmware) and give it a go via parameter setup, though!

There are some other strange issues that can come up when using some steering modes. mode 3 causes the rudder to work against the motors in reverse since right on the the motor control is always clockwise rotation but the rudder changes its direction of rotation depending on if its going forwards or backwards.

The way i was going to solve the problem of mixing different control types was having a different tune for each and then change the parameters with lua when i change control type.

so when cruising my boat will have both motors set to throttle with rudder so no skid steering so it can continue even with a motor failure and it wont try and steer the boat with the motors when sailing. but when I set the switch to mode 2 it will change the motors to left throttle and right throttle, disable the rudder and change the tune to match the new turn rates, then mode 3 will be my thrusters with main motors disabled. essentially letting me switch between skid-steering and ackerman and omni motors on the fly.

1 Like

Thanks everyone for all your answers.

@meholden Yes if you can, I’d like to have the parameters file please!

I’ll keep testing with only Skid Steering then, and eventually I’ll try to switch off the arming checks if needed.

something simple like this might work for you, it essentially just temporarily changes the 2 motors and rudder between Ackermann and skid steer using a switch but you could modify it to switch based on other inputs like mode or speed.


local SCRIPT_NAME     = 'group motor control.lua'
local RUN_INTERVAL_MS	 = 200
local RC_OPTION   		= 300

local THROTTLE				=70
local THROTTLE_LEFT			=73
local THROTTLE_RIGHT		=74
local STEERING				=26
local OFF					=135


local MAV_SEVERITY_INFO      = 6

-- wrapper for gcs:send_text()
local function gcs_msg(severity, txt)
    gcs:send_text(severity, string.format('%s: %s', SCRIPT_NAME, txt))
end

-- ! setup/initialization logic
local rc_chan = rc:find_channel_for_option(RC_OPTION)
local last_sw_pos = nil

function update()
    local sw_pos = rc_chan:get_aux_switch_pos()  -- returns 0, 1, or 2

    if sw_pos == last_sw_pos then return update, RUN_INTERVAL_MS end

    if sw_pos == 0 then
		param:set('SERVO1_FUNCTION', THROTTLE)
		param:set('SERVO2_FUNCTION', THROTTLE)
		param:set('SERVO3_FUNCTION', STEERING)
		
	)
		gcs_msg(MAV_SEVERITY_INFO, 'Ackermann  ')
		
    else
		
		param:set('SERVO1_FUNCTION', THROTTLE_LEFT)
		param:set('SERVO2_FUNCTION', THROTTLE_RIGHT)
		param:set('SERVO3_FUNCTION', OFF)
		gcs_msg(MAV_SEVERITY_INFO, 'skid-steering')
    end

    last_sw_pos = sw_pos

    return update, RUN_INTERVAL_MS
end

gcs_msg(MAV_SEVERITY_INFO, 'Initialized.')

return update()
2 Likes

Thanks for the idea @geofrancis,

I really don’t know anything about Lua yet, though I think I can learn about that.

I can understand that the scripts helps in manual mode, getting to switch between modes, but is it usable with autonomous mode?

it could cause issues with tuning, its not something that I have tested.

why are you wanting to use skid steer on a boat like that anyway?

1 Like

Here is my parameter file. I can’t argue with the caveats people have mentioned here: the reversed reverse issue, and the need for gain scaling with speed. For my boat, which isn’t super fast, I think this works fine. I don’t normally reverse except in manual (I suppose loiter also, I’ll have to watch that next time I’m out). I used the rudders because they were already installed (I joined 2 monohull boats into a catamaran) and because someone once mentioned that if a prop comes out of the water running down a wave you lose steering if you rely on skid steering exclusively. I’m enjoying the discussion!

n3m02_working_2022_06_15.param (13.8 KB)

Here’s a blurry video of my boat turning

I’ve never heard of this “reversing issue” so I wonder if someone could explain it to me. My guess is the reversing problem appears on frames like @meholden’s (see above) where there are two rudders, each directly behind a motor. When turning at low speed one motor may spin in reverse and pull water through one of the rudders in the opposite direction to the way the boat overall is moving and so the rudder is essentially pointing in the wrong direction? I guess to work correctly the rudders would need to move independently?

If this is the issue then the “Miss Geico” (pic below) might be unaffected because the rudder and motors are separated.

I have only ever seen it in steering mode 3 where there is a conflict between the direction the rudder is trying to rotate the boat and the direction the motors are trying to rotate the boat but only when reversing.

@geofrancis,

OK, so I guess we’re talking about the PILOT_STEER_TYPE=3 case (wiki, param description) but this parameter controls how the input is interpreted so I need to think a bit more why this would cause problems re the output direction. We had numerous issues in the handling of steering and reversing in old versions of (AP 3.2 etc) but I thought we had resolved all those… maybe not.

When going forwards moving the rudder to the right will turn the boat clockwise but backwards it will rotate the boat anticlockwise, compared to tank steering or omni motors in mode 3 where right is always clockwise even when reversing.

mode 0 essentially emulates Ackermann so the issue doesnt appear there.

@geofrancis,

… but we handle the reversing based on vehicle speed (including backwards) way down in the motors library and it’s independent for each output type (ackermann, vectored thrust, skid-steering, omni) so the rudder should reverse independently of what the skid steering motors are doing.

… anyway, we’re probably at the point where we need to test and confirm the issue still exists and which modes are being used. I’ll try and do that in the simulator…

1 Like

You’re right I think @rmackay9 about there not being a reversing contradiction between differential thrust and rudder steering.

I powered up my boat in manual mode and tried it in forward and reverse with the rudder stick to the left.
Whichever way the throttle was, the rudders stayed in the nose-to-port going forward, nose-to-starboard going reverse setting (like on any RC boat).

The motor differential thrust also followed this motion, when reversing with increasing port helm, the port motor would eventually stop then switch to forward thrust which also gives a nose-to-starboard turn.

After reading several posts like this that mention the reversing issue I just assumed that differential thrust gave the same yaw rate sign based on the RC input, then throttle is superimposed. I hadn’t tested it or paid much attention (obviously) but in my defense I hardly ever reverse except to stop at the dock. Thanks for the clarification. If I have misunderstood what @geofrancis is explaining please let me know and I will test some more.

1 Like

@meholden,

Great, thanks for testing. So this means that we’ve probably solved the issue of mixing skid-steering and ackerman steering so we should remove the pre-arm check. Txs!

1 Like

Are you in pilot mode 0 or mode 3?, In mode 0 the motors will follow the rudder like you describe But its pilot mode 3 where it doesnt go the right way.

I made a diagram to try and explain what I mean. You can see in mode 3 reverse, the rudder is trying to rotate the boat in an opposite direction to the motors. in mode 3 the rudder should swap directions and move to the red position when reversing but it doesn’t.

I spend a lot of time testing a lot of configurations, my boat has 2 motors, omni thrusters and a rudder, but this was the only scenario that i found any inconsistencies of mixing motor and control types, my rudder has very little authority in reverse compared to main motors and thrusters that it took me a long time to notice it.