These past two weeks have been spent solving problems. The major problem was steering; at my last journal entry, my car was having a tough time turning the wheels. The other problem I have been dealing with is figuring out how I am going to mount my Arduino and sensors. Afraid I wouldn't have any decent pictures to include in this post, I sketched up a model of my car in Google SketchUp both for the purposes of being awesome as well as helping me visualize what hardware I will need to finish this car. The model isn't exactly to-size, but it conveys the general feel of my automobile.
As might be noticed, this picture of my car has an added piece of plastic in the front and back. These are the car's bumpers , which allow little children to ram RC cars into brick walls repeatedly. I added these back to my car because they will provide me a some more space to work with (you can see a 9V battery mounted on the back piece), which will be helpful when the time comes to mount the sensors.
But first, the steering. To figure out what the car normally does when it steers, I hooked the old RC circuit back up to the steering motor and played around. My first test was to make sure the circuit worked, so I used it to turn the front wheels left and right. All good. I then took the front motor out of the car and told it to turn. I discovered, whilst doing this, that the motor was being spun at a constant speed in one direction or the other. At first, I thought I would need to specifically calculate the speed at which this motor turned. I started by seeing what happens when I ran the motor at full power from my circuit. Well, guess what, with the maximum power the wheels turned properly and there was no sign that the motor was killing itself. If I gave the motor less power, then it would start to make an annoying sound (I thought that the sound meant the motor was spinning too hard, but that wouldn't make sense). So I just set the power to maximum, and my car steers!
Or so I'd thought. When the car is sitting on its pedestal of LEGOs, it steers just fine. When it is placed on the ground, well, problems arise as the wheels refuse to turn all of the way. After messing around with various thingies and other various thingies, I came upon a realization: once on the ground, the front wheels won't turn all of the way if the back wheels are also spinning. I took my ammeter out to perform measurements on what was happening to the front motor, and it turns out that when friction is applied to a motor, it will draw lots more current. Meaning, when the back wheels are spinning on the ground, the friction causes them to have to draw more power to be able to keep spinning, and part of that extra power comes from the steering motor. My first thought was that I could program stuff into the software that stopped the rear wheels before making a turn. I have realized though that a software solution to a problem like this is not ideal. I looked back at the RC circuit I'd taken out and remembered that it used two motor drivers, one for each motor. The two motor drivers gave me an idea - if I separate the two motors, run them from different chips, maybe they will be able to work in tandem? I have ordered a second motor driver to find out, though I will not know if it will work until, well, it works. In the event that the second motor driver does not solve my steering issues, my next idea is to give them each different power supplies, which I know will fix the problem of current drain (one interesting issue that current drain brings up is what effect it will have on my sensors and the servo. If worst comes to worst, I could use a 9V battery for each motor, and then use the rechargeable battery for the Arduino, sensors, and the servo).
But on the note of sensors, I have been divining ways of mounting them to my car. There are four places in the rear of the car into which I can place screws. Two of them had a use, the other two I think are vestigial organs. But the four are arranged nicely enough that I can place a piece of wood over the top and use the holes to screw it down. This piece of wood is where I plan to mount my Arduino.
With my Arduino mounted, I'm left with three sensors. I probably already mentioned how they will be used, but I'll go over it again. I'm placing my Ultrasonic sensor on a servo, and will place this servo near the front of the car. The two IR sensors will be placed to cover the two sides of the car; however, I cannot place them directly on the side. As I got the wrong kind of sensor, they have a minimum range of 15cm (6in), meaning that any readings inside that distance will be garbage. To solve that issue, I need to place them 15cm away from the edge of the car. My most likely solution will be to place them back near the Arduino, and pointing at an angle across the car; for that, I will need to use more wood to create a platform to screw them into.
Admittedly, the last two weeks have been slow, with not too much physical progress. However, I am picking it up now and will probably be writing more entries to avoid writing weekly novels. My next entry should cover the assembly of my second motor driver and whether or not it is a success.
'Til next time.
Next: Journal Entry #5