2014-Oct-5 Back to work
I am still waiting for a better 5V DC regulator for running the Pi off of the same car battery as the motors. People on the internet don’t recommend using the 5V supply provided by the L298N chip.
While I am waiting I did a little bit more work on the body of the Dalek. I have used scraps for the shoulder section but I had to buy a 4 by 8 sheet of chipboard for the head to make the big diameter rings. I should have used MDF so that the rings would be nice and smooth, oh well I will try this out for now. If I enjoy the Dalek enough that I want to keep it around a long time I can just rebuild the neck since it comes apart easily. I want to keep it light so I decided to use 6mm foam and paper sheet for the shoulder section. The paper is sprayed with minwax to be water resistant, and the final paint layer should seal it completely. The shoulders get covered up later and do not need to be strong. Here is a picture of the latest state of the body.
2014-Oct-8 Still waiting for parts
While I wait I have been plugging away at the Dalek cover. A small problem has cropped up with my v-belt drive, they have started to slip when under higher load. It seems like I will need to redesign a little to apply a constant pressure on the pulleys instead of using the fixed position setup I currently have.
Here is the progress so far.
This picture shows how simple it is to remove the Dalek body from the robot frame, there are about 8 easy-to-access screws holding the 2 parts together. I fixed the belt slip and it is ready to go again.
Good news! My 5V dc regulator arrived! Time to start stuffing the Raspberry-Pi brains into my little toy!
2014-Oct-9 Dalek Prime(ed)
Today I had some help from my boys and we got the Dalek covered in a first coat of white primer that I have had laying around in the garage for the last 2 years. Nice to use up some old paint!
I also started to write some serious code for controlling the robot. I was going to use python, but I think I will need to squeeze all the power I can out of the Pi so I used plain old c and a great library called wiringPi.
I have started a public repository on bitbucket for this project. If you want a copy of the code run the following commands on your Raspberry Pi.
git clone http://bitbucket.org/ronostafichuk/raspimower.git
The current code will allow manual control of the motors by reading the states of 2 buttons wired into header pins 16 and 18.
It uses pins 7,11,13,15 to control the L298N DC Motor controller.
I will post more details and a diagram later, need to sleep now!
2014-Oct-11 Coding and painting
Today I painted the Dalek body, I want to get it weather proof asap. I used Rustoleum water based paint and Gorilla Tape to cover the seams in the panels.
I decided to use my wireless keyboard to control the Dalek for now until I have time to write an android app to do it. The reason is because I have so many functions I want to control on the robot, and there are not enough IO’s to spare, also I want to be able to control it remotely during development. What a pain in the neck it is to get non-blocking keyboard input in c! Have not used c in a while, but it is pretty easy to figure out thanks to google searches…
This is my function list so far:
w = move forward
a = turn left
d = turn right
z = pivot left
c = pivot right
x = move backwards
s = stop motors
1 = running lights on
2 = misc lights on
5 = Say EXTERMINATE!
6 = Play Dr Who Theme!
m = Engage lawn mower
n = Disable lawn mower
q = quit program
2014-Oct-13 Test of wired Pi and program
Good News! My program worked perfectly! Bad News! My L298N motor drivers can not output enough current to make the robot move! Apparently the little motors are pulling a wee bit more current than I expected. The spec sheet says that it can output 4 Amperes max continuous (2 Amps per channel). Apparently it must be pulling more like 5 Amperes per motor? I will put a current meter on it tomorrow.
If I suspend the robot above the ground the motors perform as expected for about 3 minutes, then the controller starts getting way too hot and the motors slow down. I am lucky I did not blow the chip to bits or start a fire. Oh well, I will do a search for a bigger motor controller tonight.
2014-Oct-14 Using Relays instead of L298N
Today I learned some interesting stuff. First off, the Pi is more forgiving than I imagined when it comes to bad wiring! Make sure you set the GPIO pin to OUTPUT if you are going to use it as an output (bye bye 5V regulator, no smoke but a nice pop sound) The board still works ok, but pin #7 is fried and can not control anything anymore.
Secondly, test your cheap China parts before you assemble them. The cheap relays I purchased came from 2 different batches that have default states that are opposite to each other! For example, there are 3 pins on the relay, both batches have the right 2 pins connected when the power is off (matching the diagram on the board), however, once the circuit is powered up the older looking batch switches to the left 2 pins being connected. Weird, but for the price I really can’t complain too much.
I decided to mount the relay boards so the wiring is easier to follow, and less likely to shift. I mounted the circuits on a layer of non-conductive plastic on a piece of scrap wood. Seems a bit neater, Lego would probably have worked just as good.
I have updated the code on the public repository to handle all six relays.
2014-Oct-18 Mostly done
So I tested the new circuitry on the robot and it is working properly! Only blew one 15 amp fuse due to trying to climb a steep incline, these motors pull more current than I thought due to the increased weight of the Dalek body. I also added a red flexible waterproof LED string around the base to create a nice glow underneath the robot.
Over the last few days I finished the head, I really did not have time to do a decent job but it was really hard to find something for the head so I ended up using a garbage can lid and foam sheet along with half a roll of Gorilla tape. Wish I could have done something better, but I really want it done for Halloween…
I also got the right arm (toilet plunger) mounted, and an eye stalk mounted. I found clear plastic handled toilet plungers at wall-mart for $7, so I got two. I figure I will put a few red LED’s behind each one to try to light up the arms/stalks. I am going to take some pictures and video this morning and post it here in a few hours. Gotta have some coffee first… lots of coffee… I can’t imagine how many hours the guys at www.ProjectDalek.co.uk put into their Daleks. Those guys have some serious dedication!
Finally a video!
So I did not totally finish the Dalek, but the kids had their fun for Halloween and now it is time to get back to the original purpose of this project, mowing my lawn!
Here is a final picture of the state the Dalek before I put it in storage and begin converting the base to an automatic lawn mower. The ultrasonic sensors are in, so I have everything I need to get going.