Arduino RC Lawnmower
Arduino RC Lawnmower
Living
Outside
Play
Technology
Workshop
Step 3: The Wheels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Step 4: The Frame part A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Step 5: The Frame part B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Step 6: Mounting the motors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Step 7: Mounting the mower deck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Step 8: Select and Install the batteries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Step 9: Mount the electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Step 10: The Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Step 11: More Videos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Author:johndavid400
author's website I have always been one to take things apart to figure out how they work, so most of what I own has been dismantled. If it can't be taken apart or hacked, i'd rather not have it. And I like to do things the cheapest way possible, because I like to do a lot of things and I don't have a lot of money.
. I added some new code to the project that is safer, including a manual kill-switch and a Failsafe switch. To implement the Failsafe, I used another Atmega168 (or an Arduino), to control a normally-open 60amp power relay. The relay disconnects the power to the motorcontroller unless receiving a "good" signal from the 2nd microcontroller. This signal is updated 2 times every second and is either ON or OFF. If the bot gets out of range, it loses power to the motors. If I flip the kill-switch on the Transmitter, it loses power to the motors. This is also a handy way to disable it remotely if anything were to go near it that wasn't supposed to. The updated code for both microcontrollers is on the CODE page. In addition to the failsafe, I changed the way the code reads the PPM signals to make it more reliable. Also, I realized that I was only able to run the bot at 80% speed with the old code, so now it is quite a bit faster and has more power (it can carry me across the yard @ 155lb). Check out this new video of me riding the Lawnbot400, my wife driving it over a bunch of branches, then me making do some wheelies. Don't worry, the mower was turned off this time since the grass didn't need cutting, we were just having fun.
Disclaimer: DANGER!!! This is a VERY dangerous piece of equipment if not handled appropriately. Since all the electronics have been home-built and the Arduino code is new, you MUST be very careful while operating anything heavy with this code. I have had 1 or 2 times during testing - and before adding a secondary failsafe - that the main Arduino jammed up and I temporarily lost control of the mower for a few seconds!!!! Though I have added several filters to discard unwanted signals and I rarely have any issues, an un-manned lawnmower IS STILL A POTENTIAL DEATH TRAP and I assume no responsibility for anything that happens as a result of your use of this code or this tutorial. This is meant as a guide for people who not only have the ability to build such a contraption, but the responsibiltity to operate it safely as well. Any suggestions or ideas on how to make this a safer project is always gladly accepted. Having said that, it's also awesome.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Background: Most R/C equipment comes packaged for a single specific use, which makes it easy to use but is very limited in what you can do with it. So using the Arduino as an interpreter between the R/C system and the motor driver, I can use any motor controller that I want (depending on the size of the motor and power required), reprogramming the Arduino to supply the required signals. What I ended up with: After successfully hacking a few R/C cars from the thrift store, I got bored driving them around the driveway and I was having a hard time convincing my wife that there was any usefulness in the revived toy car. So I decided it was time to make my biggest chore at home, a whole lot easier and actually put my Arduino to work, and thats how I ended up building an R/C lawnmower. While designing the lawnmower, I thought it would be cool to learn about the electronics that made it move, so I designed and built my own motor speed controller (or Hbridge) to power the lawnmower. I looked around at every H-bridge design I could find before deciding to go with a Mosfet h-bridge that uses both N-channel and Pchannel Mosfets. I built several different motor driver boards for this project, the first two were on Radio-Shack perf-board and the next 4 were designed using EagleCad and etched to a piece of copper-clad PCB, using the toner-transfer method. The most recent board is the one I use to mow the lawn as it has the ability to stay cool even while operating for long periods of time (30-40 mins straight) at 10-20amps and 24vdc. FWIW, I had to burn up a lot of Mosfets to find this out. If you want to see any of my other motor controllers, go to www.rediculouslygoodlooking.com and check out the Mosfet shield. Here is what I bought already assembled: FM R/C transmitter and receiver pair from ebay = $40 Arduino = $30 I already had a used push-mower = $60 Here is what I bought and assembled into the Lawnbot400 (as I call it): (2) electric-wheelchair motors from ebay = $40 ea (2) 12v marine deep cycle batteries - Walmart - $60 ea new (used batteries might work) 36" pieces of 2" angle-iron (2) and 1" square-tubing (2) from Home Depot = $8 ea 36" pieces of 1" angle-iron (2) and 1" flat steel bar (2) from Home Depot = $5 ea (a lot) of nuts, bolts, washers, lock washers 3/8" or 1/2" with drill bit = $20 (2) caster wheels from Harbor Freight Tools = $14 ea (2) drive wheels from Harbor Freight Tools = $8 ea (36") 5/8" threaded rod with several 5/8" nuts and washers from Home Depot = $8 (2) sprockets from Allelectronics = $5 ea #25 roller chain and a few universal links from Allelectronics = $10 for 3' sprockets from Electronics Goldmine = $1.50 ea (24) mosfets from Digikey = $1 ea (there were quite a few small parts for building the H-bridge, they are listed later on)
http://www.instructables.com/id/Arduino-RC-Lawnmower/
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. the front left mower deck hanger 2. the rear left mower deck hanger
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. the Triple8 motor controller with 24 mosfets, each set of 3 is bolted together and each mosfet is heatsinked. It has 3x as many Mosfets as it's little brother, but essentially the same circuit. 2. the predecessor to the Triple8, only 8 mosfets total (just enough to complete a dual h-bridge). Though it would run the Lawnbot400 around for about 10 minutes, it would end up getting hot after some use.
Image Notes 1. the 2 neutral indicator LED's (1 red and 1 yellow) hard-wired to digital pins 12 and 13. Anytime I center one of the control sticks on the lawnbot400, one of these lights turns on. 2. the female headers used to plug my R/C receiver directly onto (they use standard .1" spacing like perfboard you can buy at Radio Shack) 3. these are the breakout screw-terminals used to route the R/C receiver signals to the Atmega168. I am only using 2 of the 6 R/C channels right now, so the other 4 can be used for extra servo's or whatever else. 4. digital pins 2 and 3 of the Atmega168, used for the External Interrupts on those pins to capture the R/C signals from the receiver. 5. These are the screw-terminals for the signal wires leading to the H-bridge motor controller. I only need 4 wires to run my motor controller, but there are 3 extra digital pins that are unused by the current code.... Any ideas for their use? 6. all 6 analog pins are unused! I might add some sensors to automate the Lawnbot400 one day. 7. the Atmega168, it's reset button, and a kind-of hidden 16mHz crystal oscillator (together make a bare-bones Arduino). 8. 5-35v power terminal and onboard 5v regulator for powering the Atmega and R/C receiver. Plus a bunch of capacitors and a reverse polarity protection diode.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. this is the 2nd H-bridge, notice that the motor screw-terminals for each motor will be on opposite sides of the board. 2. This is the 1st H-bridge
Step 1: Setting up
1. Get R/C transmitter and receiver (I have tested FM and AM systems and they both work) 2. Upload code to Arduino (it is on the last page) 3. Make sure you are getting a good signal You will need an R/C radio transmitter(Tx) and receiver(Rx) pair, which is the most expensive part of the project, but can be used for every future project you might have involving R/C. I went with a 6-channel FM system, but I have tested a 27mHz AM transmitter/receiver and it works just as well. The beauty of the Arduino is that if you want to adjust the deadband or the motor-speed at turn-on, (unlike commercial ESC's) it is all easy changed in the Arduino IDE. Once you have your radio, all you need to do is upload the code to your Arduino, plug in the 2 channels that you want to use from your radio receiver into Digital pins 2 and 3 of the Arduino (these are the 2 external interrupt pins on the Arduino) and you are ready to control whatever you want. If you don't have a batter pack for the receiver, you can run jumper wires from the Arduino +5v and GND to the R/C receiever for power, you only need to supply a single channel with GND and +5v (it is not necessary to power every channel). Upload the code using the Aruino IDE (I am using version 0016 on Ubuntu). I started by controlling 3 LED's with 1 channel on a breadboard. I wired a red LED to be Forward (digital pin 9), a yellow LED for Reverse(digital pin 5), and a green LED for Neutral (digital pin 12). This allows you to adjust the code to fit the needs of your radio system. You will have smooth 0-100% PWM control of both LED's and the neutral light will turn on when the control stick is centered. If needed, you can widen the deadband for Neutral, but doing so will increase the speed at turn-on (which starts at 0%, so that would likely be desirable). See pictures. ---------------------------------------The code has 4 PWM outputs for motor control: channel 1 Forward = Arduino digital pin 9 channel 1 Reverse = Arduino digital pin 5 channel 2 Forward = Arduino digital pin 10 channel 2 Reverse = Arduino digital pin 6
http://www.instructables.com/id/Arduino-RC-Lawnmower/
2 outputs for Neutral indicator lights: channel 1 = digital pin 12 channel 2 = digital pin 13 The 2 INPUTS from the R/C receiver should go to: channel 1 = digital pin 2 channel 2 = digital pin 3 --------------------------------------If you are interested to see your readings, turn on your Serial Monitor in the Arduino IDE (set to 9600bps) and you can see the actual real-time pulse readings for each channel, they should read: full forward = 2000 (2 milliseconds) center = 1500 (1.5 ms) full reverse = 1000 (1 ms) These readings reflect the number of microseconds that the pulse signal from the R/C receiver stays HIGH (or at 5v). The typical Servo signal that comes from an R/C receiver is a pulse whose length varies from approximately 1 ms to 2 ms with 1.5 ms being Neutral (which should also be the position that the control stick returns to when you let it go). The transmitter reads the position of the control stick and sends that pulse length about once every 20milliseconds. So it is constantly updating for precise control (for more info, look up PPM on wikipedia). If you push the transmitter control stick forward, the reading should go up to 2000, if you push it backward it should go down to 1000. You can also use a voltage meter at this point to see that Digital Pins 5, 6, 9, & 10 will be changing from 0-5v depending on the position of the control sticks on the R/C transmitter. If you care to know, the code uses the Arduino's 2 external interrupts to capture when the Rx signal pin changes states (goes from HIGH to LOW or vice versa), when it does at the beginning of each signal, it calls the interrupt function which reads the digital state of the pin and if HIGH, it records the microseconds value on the Arduino system timer0. It then returns to the loop until the pin goes LOW, at which point it subtracts the previously recorded microsecond value from the new current microsecond value to determine how long the pulse stayed HIGH (which tells us the position of the Transmitter control stick). It then does that over and over really fast. I have the values constrained from 600-2400 in the Arduino code to keep things simple. Once it receives the signal and constrains it, it maps that value to be proportionally between 0 and 511, where 255 will be Neutral. The code then determines when the value changes and uses a function to determine the appropriate 0-255 PWM value in the appropriate direction and each direction has it's own PWM output pin to control the H-bridge. On a side note: To make things easier, I built an Arduino-based breakout board using Radio-Shack perf-board, a 28pin DIP socket, a 16mhz oscillator, and a bit of wire. I also added a set of female-headers in such a way that I can plug my R/C receiver directly onto the breakout board. For secure connections while mowing grass, I added screwterminals on each Output pin and each of the 6 channels from the receiver. It also has a built in 5v regulator to power both the Atmega168 from the Arduino and the R/C receiver (which gets power when you plug it onto the breakout board). So you just route jumper wires from the channels you want to use on the receiver, to the Atmega digital pins 2 and 3. I also added 2 LED lights that are hard wired to the digital pins 12 and 13 for the Neutral lights for each channel so I can easily see when I am in neutral. Since this bot is a Tank steer setup with 1 drive motor on each wheel, the coding is very straightforward where the left stick controls the left motor and the right stick controls the right motor. Both sticks forward means lawnmower goes straight forward, both backward and it goes in reverse. If you push the left forward and the right backward, it does a zero-turn circle. As you can imagine, mowing the grass is really fun now.
Image Notes 1. this is my receiver plugged into a breakout board I made for it using perfboard. 2. the Arduino receiving R/C servo signals and translating them into forward/reverse PWM values. 3. each set of LED's is controlled by it's own channel from the R/C receiver. Forward will turn on the green light, reverse the Red light, and neutral will light up the Yellow light. This is the easiest way to test the setup.
Image Notes 1. this is a typical R/C transmitter with 4 channels, the one I got is a knockoff of this one, but looks very similar. 2. this is a typical R/C receiver. Mine has it's connector pins on the end of the unit instead of the top, enabling me to plug my receiver directly onto the control board. 3. these are typical servo motors. They can be controlled directly by the R/C receiver and are useful for many things.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. the Atmega168 from my Arduino (I bought a few extras to use for projects like this). I remove it when I need to re-program it in the Arduino. 2. my R/C receiver plugged into the control board. Notice the green antenna coming out.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
motor controller, all you need to do is print the .brd file onto some magazine paper using a laser printer, and iron that onto a piece of clean copper-clad. Then etch it with your favorite etchant solution (I use 2 parts Hydrogen Peroxide to 1 part Muriatic Acid and it works perfectly). And remove the toner with Acetone when done etching. For ease of assembly I designed this board to be Single-sided and to use only through-hole components, no surface-mount stuff to mess with! Yay for you. You can get the .brd files for the various h-bridges at www.rediculouslygoodlooking.com
Image Notes 1. this is the 2nd H-bridge, notice that the motor screw-terminals for each motor will be on opposite sides of the board. 2. This is the 1st H-bridge
Image Notes 1. bussed resistor networks 47ohm. They have 1 input and 5 outputs, this board only uses 3 of the outputs. 2. pull up/down resistors 4.7k ohm, these keep the Mosfets turned off when not being used. 3. capacitors, I used (4) 680uF 50v, but you can substitute others that fit. 4. screw terminal connectors for motor terminals and power
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. this is 1 complete h-bridge to control 1 DC motor. The 2 smaller mosfets toward the bottom are used as signal-inverters to control the High-side pchannel mosfets. 2. each h-bridge has it's own set of direction lights to determine the direction of the current.
Image Notes 1. the Triple8 motor controller with 24 mosfets, each set of 3 is bolted together and each mosfet is heatsinked. It has 3x as many Mosfets as it's little brother, but essentially the same circuit. 2. the predecessor to the Triple8, only 8 mosfets total (just enough to complete a dual h-bridge). Though it would run the Lawnbot400 around for about 10 minutes, it would end up getting hot after some use.
Image Notes 1. R/C receiver plugged into Arduino breakout board 2. cooling fan for motor controller (h-bridge)
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. Atmega168 microcontroller programmed in the Arduino, then transferred to this home-made breakout board for permanent use. 2. The R/C receiver is plugged directly onto my home-made breakout board which supplies the +5v and GND needed for power as well as a breakout screwterminal for each channel. This receives the signals from the remote-control (R/C transmitter) and sends them into the Atmega168 for processing.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. The bolts coming from around the axle are the 3 bolts that hold the sprocket onto the other side.
Image Notes 1. The drive sprockets are about 6.5" in diameter and had no holes to mount them. I had to drill 3 holes and mount bolts through the sprocket into the wheel. I then added a small bead of weld to keep it centered around the axle.
Image Notes 1. save a bolt on each side by using the same one that you used to bolt the frame riser brace into the frame.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. the front 1" steel square tubing that the front caster wheels attach to.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. Motor controller and Arduino 2. push mower 3. (2) 12v batteries (deep cycle marine is the best) 4. electric wheel-chair motors
Image Notes 1. you need 1 nut on the inside of the frame riser bar to, and 1 on the outside to hold it securely to the axle. 2. I bolted the support bar in with the rear lawnmower-deck hangers to save a bolt on each side.
Image Notes 1. the rear bar should be the same width as the center of the rear wheels on your push-mower (must be measured before you remove the wheels). 2. the main frame bars. 3. the support brace
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. one of the main frame bars from step 1, which is 2" angle-iron. 2. the other main frame bar from step 1
Image Notes 1. the front left mower deck hanger 2. the rear left mower deck hanger
Image Notes 1. the rear bar should be the same width as the center of the rear wheels on your push-mower (must be measured before you remove the wheels). 2. the main frame bars. 3. the support brace
Image Notes 1. The drive sprockets are about 6.5" in diameter and had no holes to mount them. I had to drill 3 holes and mount bolts through the sprocket into the wheel. I then added a small bead of weld to keep it centered around the axle.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. The bolts coming from around the axle are the 3 bolts that hold the sprocket onto the other side.
Image Notes 1. one of the main frame bars from step 1, which is 2" angle-iron. 2. the other main frame bar from step 1
Image Notes 1. you need 1 nut on the inside of the frame riser bar to, and 1 on the outside to hold it securely to the axle. 2. I bolted the support bar in with the rear lawnmower-deck hangers to save a bolt on each side.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
The holes drilled in the motor mount plate are just single holes for the bolt to fit through, the holes through the frame were cut with a Dremel tool with a cutoff wheel to make channels for the motor mount bolts to travel forward/backward through. You want the 2" angle-iron motor mount bracket to set as much on top of the main frame rails as possible, the bolts (which you can't see with the motors mounted) that hold the motors to the motor mount plates will keep the motor mount plate from laying flat against the frame bars. Go ahead and mount the motors loosely to the frame using 2 bolts on each. Cutting and connecting the chain: Now get your 10' of #25 chain and wrap it around the main drive sprocket on the wheel. With the motors pushed all the way toward the back of the frame (closest to the drive wheel sprockets), wrap the chain around the motor drive sprocket and mark where they overlap. You need 2 of the universal chain links from to connect the 2 loose ends. Cut the 2 pieces of chain and connect them to each side with the universal links to connect them. Tensioning the chain: Push the motor mounts forward until there is good tension with the chain, and tighten up the bolts that hold the motor mount plates to the main frame. Now you can generate electricity. Connect a voltage meter to 1 set of motor terminals and push the bot around.
Image Notes 1. notice the motor is mounted to this piece of 2" angle-iron and that is mounted to the frame with these bolts. They allow the motor to slide forward/backwards on the frame when loosened.
Image Notes 1. notice the gap between the motor mount plate and the main frame bar. This is caused by the bolts that hold the motor to the motor mount plate. 2. These are 2 unfinished holes for a 3rd mounting hole which I later deemed unnecessary.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. This is how to make the motor mount slide holes. Drill 2 holes where you want the ends of the track to be. Then use a Dremel with a cutoff wheel to cut a straight line between the tops and bottoms of each hole. They should end up looking like the ones above with bolts in them. 2. Tighten up these bolts when you get proper tension with the chain.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. the front left mower deck hanger 2. the rear left mower deck hanger
Image Notes 1. make sure to keep the old wheel shafts from touching the drive tires (leave 1/2" or so)
Image Notes 1. save a bolt on each side by using the same one that you used to bolt the frame riser brace into the frame.
Image Notes 1. adjustable total length (for different model push mowers) 2. caster wheels with 360 degree turning 3. leave a gap or the front wheels will hit the mower deck!!!
Image Notes 1. by mounting the lawn mower deck-hangers to the old wheel shafts, you can still
Image Notes 1. these are the 1" angle-iron lawnmower-deck hangers, they hold the mower-
http://www.instructables.com/id/Arduino-RC-Lawnmower/
adjust the mowing height of the mower deck without taking anything apart.
Image Notes 1. make sure the front caster wheels won't hit the mower deck when they swing around (leave at least 1/2" clearance)
Image Notes 1. I only installed 3 of the 4 bolts on each front caster wheel. 2. these 2 bolts on each side go through the caster wheel mounting plate AND the frame
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. Motor controller and Arduino 2. push mower 3. (2) 12v batteries (deep cycle marine is the best) 4. electric wheel-chair motors
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Image Notes 1. Atmega168 microcontroller programmed in the Arduino, then transferred to this home-made breakout board for permanent use. 2. The R/C receiver is plugged directly onto my home-made breakout board which supplies the +5v and GND needed for power as well as a breakout screw-terminal for each channel. This receives the signals from the remote-control (R/C transmitter) and sends them into the Atmega168 for processing.
Image Notes 1. R/C receiver plugged into Arduino breakout board 2. cooling fan for motor controller (h-bridge)
http://www.instructables.com/id/Arduino-RC-Lawnmower/
File Downloads
Lawnbot400_code.zip (152 KB) [NOTE: When saving, if you see .tmp as the file ext, rename it to 'Lawnbot400_code.zip']
#3
http://www.instructables.com/id/Arduino-RC-Lawnmower/
#4
#5
http://www.instructables.com/id/Arduino-RC-Lawnmower/
Related Instructables
remote start system for car truck and suv by Lawn Care Grub control by lonemeno Ace Fix it
Comments
50 comments Add Comment view all 212 comments
cmagruder says:
Apr 25, 2011. 5:18 PM REPLY I read the comments and have some questions that I cant seem to answer using your schematics and pictures. Here is an image that has the questions on them. http://i1179.photobucket.com/albums/x389/Chris_Magruder/HBridgeQuestion.png I redesigned your eagle diagram to handle only 50A of current because my motors only draw around 30A so I shouldn't have a problem with heat. I replaced the resistor array with just resistors, deleted the mosfets and moved everything inward. Thank you for your time!
johndavid400 says:
Cmagruder, good questions... you are the first person to change the board file - nice! maybe this pic will help: ftp://ftp.rediculouslygoodlooking.com/arduino/LawnBot400/h-bridge.jpg let me know if you have more questions ~jd
cmagruder says:
Hey John,
Thanks for the help, I just have one part I'm confused about. If I just want to control the motor with a PWM to the positive side or PWM to the lower side I would just use the two terminals at the top bottom of the schematic correct? In the pic you posted you talk about ALI and BHI, what do these acronyms mean? On another note, I bought your book, but it got pushed back so I haven't gotten it yet!
WhiteTigerTails says:
Is there a way to set this up to: 1) Be autonomous? 2) Be Zero Turn?
BIGHAIRYDUDE says:
hey did you ever set up the gps logger thing?
cj_h4x0r says:
Jul 13, 2011. 3:27 AM REPLY Does anyone know what specific kinds of motors should be used? What would be even better is some specs on them. I can't find any cheap wheel chair motors on Ebay (cheapest running at $70+), so I've been looking at robot supply shops and I'm unsure of what to buy. Here's a couple of motors I've been looking at: http://www.robotcombat.com/products/AME-214-1001.html http://www.robotcombat.com/products/AME-226-3001.html Can anyone point me in the direction of some engines in the $0-$60 range?
Bluedog24 says:
Am I correct on this for the Triple8 v3? Is there anything I should know about v3?
http://www.instructables.com/id/Arduino-RC-Lawnmower/
viperguy says:
Jun 28, 2011. 8:58 AM REPLY I love the idea of a robotic mowerl. JohnDavid, have you seen the Mo-To robotic mower made by a guy down under? This little unit fasinates me and seems to be more practical than anything I have seen. Can you make something like it? I would really like to purchase something already made and ready to go. Here's a link: http://www.youtube.com/watch?v=u8pkKGL4XXY
blightcp says:
This is the frame I am using, I am using the same casters and wheels a john_david.
blightcp says:
http://www.freeimagehosting.net/image.php?462490cd0e.jpg
blightcp says:
johnDavid,
I've been pawing round here, makezene, and rediclous trying yo find just a little more detail. on the H bridge, what is getting me tripped are the extra pins and what to do with them. Could you, or somone else that has a working board: 1. label what all 4 intput pins do. 2. Label the purpose of the O1 - O4, I assume they are symetrical. 3. Mark the jumpers needed for 2-wire input. Other than that my build is going well. Thanks
johndavid400 says:
this has been addressed once before... sorry for the confusion, maybe this diagram will help: ftp://ftp.rediculouslygoodlooking.com/arduino/LawnBot400/h-bridge.jpg ~jd
whitten_jaw says:
Jun 10, 2011. 5:31 AM REPLY You could for a safety feature have the arduino perform periodic timer interrupts to ensure that your RC incoming signal is active (no signal = no movement policy) . Also, Xbee controllers using UART would be a more robust possibility (no more expensive than the R/C from ebay, see adafruit and mouser) that requires a byte array versus an on/off siganl for more precise control, but you'll have to design your controller to decode thumbpad sensors. I suggest something like an encryption + command sequence. Cool project--I'm certainly going to do a variation in the next few months.
blightcp says:
I am using a 3rd RC channel as a deck ON/OFF, I am all electric BTW. The switch channel is 1400 Low 1900 High, so I sample the switch 10 times before I engage the deck motor for saftey.
When my R/c Transmitter is off the (AM) Reciver may get 1 or 2 stray readings but I have never seen more than 3 so a smaple of ten makes sure that the signals are valid.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
whitten_jaw says:
Jun 13, 2011. 1:00 PM REPLY @Blightcp, I don't know much about RC radios, so most of this discussion I've been treating it like a blackbox on/off switch. I noticed that you describe a receiver-off and receiver-on mode, which I should probably read about in John's notes. Thanks for the comments. I'm glad that I've got a few ways now to implement this mower. My background is aircraft avionic design and biomedical engineering, so I mostly deal with sensors and hardware specialization.
blightcp says:
I added the reciver on/ reciver off, John used a 2nd dedicated contoller for this with a relay interlock.
it's a bit of a misnomer as the receiver is always on when Voltage is applied, is really a stament of wether or not a valid signal is established, The point is, Nothing moves untill proper contoll is established. 10 valid frames establishes that.
johndavid400 says:
hey guys,
the failsafe relay is the bridge between the R/C rx (read by Arduino) and the motor-controller. The idea is that if the failsafe signal determines the position of the relay (open or closed). Your R/C setup may get some stray signals when the R/C is turned off, that may actually be the signal used to turn on the relay... but even if a stray signal is received sporadically, it will not be consistent enough to hold the relay On long enough to move the bot (at least not in my experience). But, you guys are creating extra work for yourselves (when talking about AM radios or FM 72mhz or 75mhz) as these should be avoided for a 200lb lawnmower..... get a cheap 2.4ghz system (about $32) and you will not have to worry about interference or stray signals ever again. Not to mention that when you turn the 2.4ghz transmitter Off, the pulse signals stop at the receiver (an added failsafe) - meaning no more random signals like you get with the older FM 72/75mhz systems. I have bought several of these and like them: http://www.hobbypartz.com/79p-ct6b-r6b-radiosystem.html When I did use a 72mhz system (for testing) I created a very small window of what was considered to be an "On" pulse (in the Arduino code) for the failsafe switch (usually between 1900 and 1950 microseconds pulse) anything else was considered Off - this cut down on the stray signals activating the relay. With the 2.4Ghz system, I set the On position to be any pulse above 1600uS pulse and have never had any interference. FWIW, I implemented several forms of strict software failsafes (some similar to the 10 sample average that you are using) and found that while that is helpful and can in most cases work, ultimately there is NO replacement for a physical power disconnect failsafe.... I have had an Arduino go crazy and not respond to the R/C at all! without the separated failsafe CPU and the physical relay cutoff switch, the lawnmower would have done some serious damage. Lastly, the 10x sampling will only work on a secondary processor, since sampling a pulse that only occurs every 20ms 10x will cause an overall delay of nearly 1/4 seconds (220ms) which only allows 3 updates per second per channel... this is perfectly fine for the failsafe and any accessories you may be controlling, but absolutely not ok for the main drive channels.
whitten_jaw says:
Jun 13, 2011. 6:59 PM REPLY Thanks for the link, John. It's certainly a good idea to build in watchdogs or failsafe for your hardware and software. It's never pleasant to see your work break something else. When I implement a radio-mower, I'm going to use the 2.4GHz frequency band with the Zigbee wireless controllers. The neat thing about them is that you can send UART protocol (I know, overkill), but you can control your PWM for your motors with more accuracy if you have a potentiometer style joystick (PS3, XBOX). The resulting controller can provide varying turn radii. It's just smart to have the thing turn off by default, so setting an on pulse length that is short enough for a quick human response is important. I would be personally paranoid about having 100 lb's of unmanned steel driven by noise and interference. The smartest process for sensor acquisition includes a filter somewhere. Sensor acquisition is about one thing alone: "not screwing up the measurand." -- Dr. Edward O'Brien
blightcp says:
Thanks for the link, I was looking for a decent 2.4 system.
Both whitten_jaw and I work in fields where there is a certain amount of "overkill" when it comes to design, esp code. And I completly agree there must be some kind of physical switch to disable the system. My Motors came with lockout brakes that will stall the motors if the main power to them are cut. Also, can anyone answer my earier post on the h-bridge inputs/outputs?
whitten_jaw says:
Jun 11, 2011. 7:55 AM REPLY Smart and elegant! Yeah, if you used 10 samples in a shift-register and then AND them together as your control for your motor, you shouldn't have any false positives. In c++, the code would look something like this: //Intialize variables int counter = 0; int numSamples = 10; int mSecDelay = 1; // ~ 1 kHz signal if no code were in while loop //Create registers bool shiftreg[numSamples]; // 10 bits int pinNumber = 0; bool output;
http://www.instructables.com/id/Arduino-RC-Lawnmower/
while(1) { //Sample input pin shiftreg[counter] = digitalRead(pinNumber); //AND all values of the shift register together output = true; for(int i = 0; i { output = output && shiftreg[i]; } //Do something about it if(output == true) { runMotorFunction(); } //Increment counter counter = counter++%numSamples; //Resets every 10 samples //Delay to meet sampling requirements delay(mSecDelay); } I don't know your background in electronics, so this isn't a reflection of your knowledge. Remember that this schema only works if the pulse time of your signal noise is less than 1 sample time (1msec above). Meaning for the code above set at 1kHz, if the noise on your R/C from stray signals produces a false positive lasting for less than 1 millisecond, then you'd be ok. The pitfall is that the longer the noise pulse the longer your delay will be: making your bot less responsive to you R/C signal commands.
blightcp says:
I work in industrial controls so this is nothing new. 10 samples is roughly 220ms max for 8 ch receiver, resonable for user input.
Also, Yes, you will see occasionaly a stray pulse over the OFF threshold, but I have not seen any over the High limit, still saftey first. Below is the modified code from John_David: void pulse() { // this function is also the failsafe, if the swich value falls below the switch_low threshold the device will shut down the mower deck. // it will then wait for 10 samples to meet the limit before starting again. This should only occur on loss of signal or TX is turned off. switch_val = pulseIn(ppm3, HIGH, 20000); if (switch_val < switch_low) { reciver_count = 0; receiver_on = false; switch_state = false; } else { if ( reciver_count <= reciver_samples){ if (switch_val >= switch_low) { reciver_count = reciver_count + 1; } } if (reciver_count > reciver_samples ) { receiver_on = true; } if (switch_val > switch_high ) { switch_state = true; } if (switch_val < switch_high ) { switch_state = false; } } }
whitten_jaw says:
I like the hysteresis you implemented.
Please correct me if I'm wrong, the switch_val is the time 'HIGH', and if that time is below the 'low threshold' then the receiver is turned off. Otherwise, the receiver_counter variable is incremented. Then the receiver_count above receiver_samples(e.g. maxSamples) turns the receiver on first, then it evaluates the time high to determine whether the motor should be shut off or turned on. It doesn't come to me immediately why the delay from receiver_count would help you. I recommend instead using a moving average filter. It's the same implementation except that you gain response and can't accidentally get a stray positive value. You may be getting the stray positive value because of your counter. Here is the scenario I see: 1) The switch value goes low because you stopped the motor 2) The noise is above switch_low enough times to cause the receiver_count to go above your "receiver samples" variable 3) The noise may have a single peak above your switch_high value, and cause your switch_state to become true If you implement a moving average filter, you may not experience that problem.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
blightcp says:
Jun 13, 2011. 1:34 PM REPLY The delay is due to the nature of my AM 72.5Mhz R/C Receiver, they are prone to stray pulses. So if your Transmitter is off and the Robot is on, it may still receive a pulse in the valid range from another RF device. Jun 13, 2011. 12:54 PM REPLY
whitten_jaw says:
void pulse() { //Use a shiftregister to collect values, MAKE SURE TO INITIALIZE AT ZERO!!! int shiftreg[16]; //10 samples, when using MCU's always use 2^x for(int i=0 ;i<16;i++) { shiftreg[i] = 0; } int counter; //Counter //Measure switch, timeout after 20msec switch_val = pulseIn(ppm3, HIGH, 20000); //Shift in new value shiftreg[counter] = switch_val; //Sum values int val=0; for(int i=0;i<16;i++) { val += shiftreg[i]; } //Average values val /= 16; //Compare to threshold values if (val > switch_high ) { switch_state = true; } if (val < switch_high ) { switch_state = false;} //Increment counter counter = (counter++)%16;
deansep says:
May 21, 2011. 4:20 PM REPLY I dont know much about r/c or Arduino or mechanics, But I am looking to get into some of this stuff and this is a really neat idea. I am trying to think of some alternatives to cut the cost. Is there a cheaper alternative other than an electric wheelchair motor? Could you use L channel steel in place of square steel tube? Or does anyone have any other ways to cut the costs/use cheaper alternatives?
blightcp says:
I used unistrut, home deopt carries it and so does most electrical supply places. It's usually around $20 for 10'.
It's fairly cheap and if you buy the nuts to go with it you can mke barckets to tighten up as a jig be fore welding. It also makes attaching the caster a snap. Unistrut is the brand name, www.unistrut.us has all the engenerring load information.
deansep says:
May 21, 2011. 6:11 PM REPLY I take that back. The L channel would have to be used. But are there cheaper alternatives other than the electric wheelchair motor? Any ways to cut costs/use cheaper alternatives?
johndavid400 says:
May 21, 2011. 6:16 PM REPLY Well, you can find alternatives to the power wheelchair motors, but I only paid $80 for both wheelchair motors shipped from ebay.... so that's only $40 each. Since the bot weighs upward of 150lb+, you would be hard-pressed to find a set of more reliable and powerful motors for a better price. If you do though, please let us know!! I am always on the lookout for a cheap set of powerful DC motors. I have used some inexpensive ungeared DC scooter motors, but once you buy sprockets for both motors and chain... you will end up spending more than $80 for the set: http://www.allelectronics.com/make-a-store/item/DCM-1250/24-VDC-250W-MOTOR-11-TOOTH-SPROCKET/1.html ~JD
deansep says:
May 21, 2011. 7:35 PM REPLY This ible is WAY above my level but im trying to work through it and understand and eventually build this. Now for the motor im unsure of the spec's that will be needed for the bot to work properly, and as a result im not sure of the motor I am looking for. Could you use this one and only have to have 1 motor rather than the 2 you used? (again. this is all above me and im trying to learn and ask questions, and understand what it is that is needed and how to do it and all sorts of stuff i dont already understand) http://www.batteryspace.com/DC-Motor-Heavy-Duty-24V-DC-Motor-750W-2600RPM-28A-rate.aspx
http://www.instructables.com/id/Arduino-RC-Lawnmower/
deansep says:
May 23, 2011. 6:01 PM REPLY The one I found is more expensive but since it has more wattage If i understand it better it will provide more power. So if your willing to spend the extra money if i understand it right then you will need only one? and if so then it will be slightly stronger than the normal two meaning faster or more torque? (This is assuming I understand it all correctly which I may not)
warlock40 says:
May 29, 2011. 3:35 PM REPLY I think the motors are going to take more research and work.. since you can NOT get them for that price range any more.. if your lucky you'll realistically snag them on ebay for $150. I've been watching them for about a month now and nothing is hitting that price range. I've starting reading up on these types of motors to see if I can get a gear head DC motor but the specs needed for this is not really documented. The average gear head motor is $30 but the RPM is lower or really high and many are 12v as opposed to 24 etc. I'd think that if you went to one motor your track type steering model would have to get way complicated to uncouple gearing/power to one wheel to do the steering.
johndavid400 says:
May 31, 2011. 11:47 AM REPLY oops. just realized that the first link I posted is only for 1 motor.... but the others are all sold as sets and are reasonably priced
johndavid400 says:
May 31, 2011. 11:45 AM REPLY Warlock: admittedly, $75/pair is a GOOD price for a set of powerchair motors like the ones I found... but I routinely find them for around $100. Here is a set for $75: http://cgi.ebay.com/Redman-Wheelchair-Drive-Motor-FRAC-MO-/390309719156?pt=LH_DefaultDomain_0&hash=item5ae045ac74 Keep in mind that the set I bought was without wheels - if you factor in the money that I spend on rear wheels, chain, sprockets (drive and wheel sprockets), and mounting hardware.... paying an extra $40 on the frontend is well worth it and far more reliable. Here are a few sets currently on ebay for under $150: http://cgi.ebay.com/Wheelchair-24v-Motors-Wheels-Great-Battlebots/300562395526?pt=LH_DefaultDomain_0&hash=item45faea3186 http://cgi.ebay.com/Invacare-motors-battlebot-robot-/270757255836?pt=LH_DefaultDomain_0&hash=item3f0a63da9c http://cgi.ebay.com/Shoprider-888WNL-Invacare-Pronto-M6-motors-gearboxes/290571762927?pt=LH_DefaultDomain_0&hash=item43a76d3cef http://cgi.ebay.com/24vdc-Merits-power-mobilily-wheel-chair-pair-motors/230626633448?pt=LH_DefaultDomain_0&hash=item35b26b26e8 http://cgi.ebay.com/MERITS-DALTON-POWERCHAIR-WHEELCHAIR-24VDC-MOTOR-SET/190534374127?pt=LH_DefaultDomain_0&hash=item2c5cbbd2ef http://cgi.ebay.com/Pride-Mobility-Electric-Wheelchair-Motor-Set-w-Wheels/230628355200?pt=LH_DefaultDomain_0&hash=item35b2856c80 Also keep in mind that you will be moving a 150lb+ robot that you will want to have plenty of power when operating - if your bot slows to a halt because your motors are not powerful enough, people will laugh at you (as will your robot). Make sure your motors are rated for at least 150watt each and that they have a geared output speed of around 80-150rpm (this means ungeared motors are out of the question). Using a geared setup (chain/sprocket) will further decrease the output speed and increase the torque (good), but is not necessary if you have a set of geared motors. Cheers, JD
sdcharle says:
Did you use a voltage regulator or other to drop the voltage down for the microcontroller?
blightcp says:
I am using a LM340AT5 as a simple regulator.
Data643 says:
May 19, 2011. 6:20 PM REPLY It would be cool if you uploaded the Arduino with the dimensions of your yard etc. so that it could mow the lawn autonomously (with you watching, of course)? Roomba for your yard.
jcksparr0w says:
what are the wheel sizes?
http://www.instructables.com/id/Arduino-RC-Lawnmower/
johndavid400 says:
10" diameter x 4" width for the front caster wheels, and 13" diameter x 4" wide for the rear wheels.
seabee890 says:
Jan 21, 2011. 3:50 AM REPLY I own a self propelled, and was wondering how hard it would be to use the drive belt from the self propell to turn a small alternator that would keep the batteries charged. then would i only need one battery to save weight . also a spring loaded cuttoff that would act as a deadman if the radio has enough channels. the signal is intrupted and the motor controls are disconnected. the other method was a stick above the mower that would disconnect if toppled from any direction, but that would require a shepards crook and i don't know any. Amazing device, as soon as i figure out alll of the electroinics involved i will build one. I hate mowing the lawn but love r/c. thanks,
johndavid400 says:
Jan 21, 2011. 8:43 AM REPLY exactly what I was thinking... last season I began looking for a way to mount a pulley above the mower deck, but below the motor on the output shaft. I thought about adding metal blocks between the motor and deck, but then saw a self-propelled and realized that it is the same thing already done for you. I would remove the self-propelled drive (use if for another robot) and replace it with (as you said) a 12v alternator, generator, or stator, that charges the battery. The lawnbot only works as well as it does because the batteries are marine deep-cycle and provide hours of run time - but this makes it very heavy. With a generator recharging the batteries and providing much of the motor power during use, you could easily get by with only one battery, or a small set of medium sized SLA batteries (12 to 18AH). My next lawnmower is going to be a fully electric - I found a Black and decker 24v cordless mower and plan to build a lightweight "garden-home" version of the lawnbot.
warlock40 says:
May 15, 2011. 4:46 PM REPLY Have you considered using Lipo batteries? It would likely be a bit more $$ but wouldn't it save a lot on weight and still provide the same result. 4 cells in series would punch out 14.4v easy or double it to 28.8v and run additional in parallel. Just a thought Jan 21, 2011. 9:38 AM REPLY A wonderful idea, as far as you have gone so far and with the mechanical skills that i have seen, you should be able to get away with shaving the deck of the mower and placing the forward tires in the "void "space in the front corners of the mower, this should allow you to get in corners better. I look forward to trying out your plans as soon as i return from this deployment. I an curious what the power ratio will be when you operate a electric mower. If you can arrange a generator system, how much longer will it allow the mower to run than without? I can see that the power used to drive the mower and turn the generator will drain the battery but I am not familiar enough with the formulas to see if you would get a gain. Ialso wonder what a 125 or 50 cc motrocycle engine would benifit the system, it already has a power generation system included to run the lights and a very small battery to start things. I might try to find a scooter engine to see what i can make so the wife does not give me that look when i do frankenstein with our only mower. wish me luck. Apr 10, 2011. 4:59 PM REPLY
seabee890 says:
mattadamsnet says:
Quick question,
I'm gathering the parts to start building and I noticed the comment from Unit042 on Dec 12, 2010. 9:33 PM, have the files been updated? I will be downloading from ftp://ftp.rediculouslygoodlooking.com/arduino/LawnBot400/Eagle%20files/triple-8/ and just want to make sure the files are correct. Thanks, Matt
mattadamsnet says:
Apr 13, 2011. 7:58 PM REPLY I'm only asking because the newest file in the directory was 12/1/09 5:53:00 PM, and the comment was posted Dec 12, 2010. 9:33 PM. I'm ready to start etching and just want to make sure everything is right.
mattadamsnet says:
V2 worked very nicely with no problems. Thank you, Matt
thatone1guy says:
Apr 1, 2011. 4:30 PM REPLY Hi, is there anyway to make this fully automated? I know it could be done with satellites, but that would cost thousands of dollars, but I am looking for a cost effective way. Also, about how long do the battery last? Good job on the project!
general-Insano says:
Apr 5, 2011. 12:09 PM REPLY You could have it follow gps coordinates... hate to have the gps malfunction on a cloudy day and shred the neighbors flowers or fall into a ditch -_-
thatone1guy says:
Apr 5, 2011. 3:08 PM REPLY well, I think in order to use satellites you to buy a sub inch model (like the kind used on farm equipment) however that would cost several thousand dollars. I was hoping there was a way to do this with proximity sensors or another cheaper alternative.
http://www.instructables.com/id/Arduino-RC-Lawnmower/
hightekrednek2396 says:
you could probably use ultrasonic sensors and put a wood border around you cutting area
hightekrednek2396 says:
is it possible to give it actual tank treads for steering. and what would the cops say if they saw this
http://www.instructables.com/id/Arduino-RC-Lawnmower/