Rover detect traction malfunction

I would like to implement a monitor that detects if my skid steer rover has some sort of mechanical traction malfunction. If one traction wheel fails, or if they both fail, or if a wheel gets stuck in a hole, then the actual heading will differ from the desired heading (because the rover could turn in circles) and the forward speed might be much less than the desired speed. @rmackay9 can you think of a way of monitoring for this situation either on the companion computer (monitoring MAVProxy messages) or via a LUA script? Thanks in advance for any ideas you might have.

Lua script. Monitor speed. When it slows below desired for too long, disarm (or failsafe some other way).

2 Likes

Yes a Lua script is probably the best short-term option.

I’ve been planning for some time to improve Rover’s crash failsafe so that it detects loss of steering control. I’d write this in C++ though probably so it works on all autopilots.

2 Likes

@rmackay9 looking here ardupilot/bindings.desc at master · ArduPilot/ardupilot · GitHub I don’t see bindings for PIDA.Tar PIDA.Act PIDS.Tar PIDS.Act which are what I would use in a LUA script to detect a traction malfunction that results in the vehicle being unable to control its motion. Am I right to conclude that in order to write such a script I would need to add those bindings and recompile the ardurover binary? Any chance you could add them in the current 4.3 beta ardurover??

Also, I think my algorithm would be something like this… Curious if you think this would work?

if PIDA.Act - PIDA.Tar > 0.5 m/s for more than 2 seconds
or abs(PIDS.Act - PIDS.Tar)> pi/6 rad/sec for more than 2 seconds
then crash.

cc @Yuri_Rage

@Christopher_Milner
If all you want to do is detect a crash, simply look for speed to be less than some low threshold for longer than it takes to make a full pivot turn and disarm.

You could also look for heading to be something significantly different than bearing to the next waypoint for some period.

@iampete , it may not be a bad idea to have a get_desired_speed() binding that accompanies set_desired_speed(), but I’m not certain that it’s required for crash detection in Lua.

1 Like