Writing this up for anyone who wants a similar solution.
Our config
Ardurover 4.5.2 Chinese Slope Mower 1m wide - 300+ KG but not very fast. Qiotek H743 Zealot.
20 HP Petrol motor drives blade and 24v alternator. Ignition circuit when shorted to ground stops ICE motor. If motor still spinning while circuit unshorted - it backfires impressively, then restarts
Requirements - Stop mower if it hits something. Power down Petrol motor.
Make it fail safe, and easy/mandatory to verify its working prior to mowing.
Solution - Rubber strip with sensor from these good folks https://www.safety-edge.com/
Aluminium strip holding a rubber soft bumper containing a āsensor stripā that closes a circuit.
Yep - circuit is normally open, and closed on bump. Ideally configure it the otherway if possible.
Wire in the sensor strip without the far end terminator. It adds 8ohms of resistance, too much.
Zealot Flight Controller (FC) wiring
FC Relay 1 - wired to Optical Relay, inputs 3) and 4), and Ignition Circuit across the 1) and 2)
My dealer is Solid State Relay, 3-32 Volt Switch Input, 20A 5 - 200v DC Contact 3-32 volt, 20 Amp - Sound Division & Surplustronics
Script reference is relay:on(0), relay:off(0) - Yes Zero index not relay1
FC Config: Relay1_function=1 (relay), Relay1_pin=1, Relay1_default=0
FC Relay 2 aka Button2 - wired to the sensor strip on the front bumper
button:get_button_state(2). Buttons must be enabled, and button_pin2 = 2
FC config: Btn_enable=1, Btn_func2=300 (scripting1), Btn_options2=0, Btn_pin2=2
FC Relay 3 - not yet implemented, 2x eStops on top of the mower to kill ICE and motion.
FC Relay 4 - wired to LED to show status of ICE motor ignition ciruit. It follows Relay1
Note - add in a resistor to limit the current. FC puts out 3.7v when High, LEDās burn out.
This website https://ledcalculator.net/ is your friend.
FC config: Relay4_default=0, Relay4_function=1 (relay), Relay4_pin=4
Hall effect RPM sensor configured - rpm = RPM:get_rpm(0) works nicely.
eStop script - here (note the quotes thing is not playing nice, so poor formatting)
local button_active_state = false ā the āpressedā state of the button
local last_button_state
local rpm=0
local engine_spinning
local Toggle_Start = true
local b2
local old_b2 = false
gcs:send_text(0, āeStop Script watching Bumpers and eStopsā)function update()
b2=button:get_button_state(2) == button_active_state if b2 ~= old_b2 then
old_b2=b2
if b2 == true then local rpm = RPM:get_rpm(0) or 0 if rpm >0 then engine_spinning = true Toggle_Start = true else engine_spinning = false end if engine_spinning then vehicle:set_mode(4) -- Change Mode to HOLD relay:on(0) relay:on(3) gcs:send_text(0, "eStop Front Bumper Hit! Stopping") else -- Engine is not spinning so toggle the Relay and LED when b2 changed if Toggle_Start == true then relay:off(0) relay:off(3) Toggle_Start = false else relay:on(0) relay:on(3) Toggle_Start = true end end end
end
return update, 200 ā reschedules the loop (5hz)
endreturn update() ā run immediately before starting to reschedule
Operation - https://www.youtube.com/watch?v=BXGtRv99zF0
Check LED once mower is booted up. Kick the front bumper to toggle the Ignition Relay and LED confirming the script is running, and the bar(s) are sensate.
Mower will go to HOLD mode when crashed, and the ignition circuit will remain shorted/stopped
Next Steps and Observations
-
Behaviour is driven by RPM:get_rpm(0) to determine if ICE Motor is spinning. I have not QCād the failure modes of the RPM sensor. If it reports 0 when its not working (probably), then ignition cut and HOLD may not occur. The RPM sensor has been very reliable to date, and if it did fail, the RPM reading on Mission Planner would be zero also.
-
Response time is excellent, even at (only) 5hz. May go faster in future.
Stopping is quick enough to keep toes, but mower is not quick. -
I realised after manually steering the mower back to base with the ICE motor stopped, that the bumper bar was no longer going to halt motion if i crashed. Maybe HOLD even if ICE not spinning
-
Setting RC6 on the RC remote to switch Relay1 would be useful to remotely stop the ICE motor, but iāve disabled as i dont know how nicely it will play with the scripts. Adding remote motor stop/start is on the list.
-
Iāve yet to test AUTO missions interrupted. The one test i did do (successful stop) seemed to want to go back to Waypoint 1 after changing mode back to AUTO. Ideally resuming the mission would be betterā¦
-
Hardware cost for bumper strip stuff including aluminium moldings, rubber bumpers, sensor strips, wiring was around USD$60 but postage doubled the price (and some)
Caveat Emptor - this worked for me, so far. Yet to do a milage test on the bumper hardware but it looks up to the task. My scripting ability is āgood enough?ā so feel free to constructively criticise.