The first version of the MC-1 (Monster Car 1) presented on days 20, 21, and 22 used a solenoid to steer the wheels. Unfortunately, that approach did not work at all–I think I broke the solenoid 😦 –so I decided to replace it by a servo.
The first step was remove the solenoid and the enclosing box and cut the plastic to make room for the servo.
I have made a hole in the plastic to attach the servo using a machine screw and a nut. I have attached the other side of the servo to a L-shape servo support. The support itself was fixed to the chassis using a self tapping screw because that part of the chassis was very thick.
I have made a hole in the steering bar and connected it to the servo wheel using a paper clip.
The final result is very good, as we can see in the following pictures.
This picture shows the servo in the car with the wheels on the ground.
I am not using the whole range of positions the servo provides. The pulses width are from 1000 µs to 2000 µs.
Although nothing caught fire, things did not work the way I intended them to:
- The workaround used to activate the solenoid did not work. The front wheel barely turned.
- The speed slider was calibrated with the wheels on the air. When the car was on the ground, it took almost full power to start moving it, although it was possible slowing it down once it was moving.
- The live video feed (as described on Day 18) presented two to four seconds of lagging.
- The camera shakes a lot when the car is moving.
Despite these enhancement opportunities, I consider it a success. It is my first successful circuit since I was in the 6th grade. I learnt a lot of things and had lots of fun. When I was at the University, I had a very frustrating experience trying to use the 8031 micro-controller.
For the future, I am considering the following possibilities:
- Use relays to activate the solenoid or replace it for a servo to turn the front wheels.
- Replace the L293D (600mA) for the L298N(2A).
- Replace the nc program used to stream the video over the network for a home made one. Maybe replace the video for still pictures.
- Change the camera position and/or add some shock absorber device.
Since programming and testing on the Raspberry Pi itself is not very productive, I have created a TCP/IP library to send commands to the ServoBlaster from a Windows .NET program. I named it PiEater. My Raspberry Pi has a WiFi USB token, so I can access it without the usage of cables.
I wrote the “Truck Driver” program for the MC-1:
The speed slider changes the pulse width sent to the motors through the L293D. Since it is a little harder to find the center of the slider, I added a “Stop” button that does that. The slider allows going from full power to back to full power to front.
The camera position sliders act on the servos mounted under the camera. The “Center” button centers the camera in both horizontal and vertical axes.
The MC-1, abbreviation for Monster Car 1, is based on parts of a car that once was remote controlled. My wife chose this name because she thinks it is ugly as a monster.
The front wheels are turned by a solenoid. Since the current provided by the L293D is limited, I created this workaround. When the servo moves, it causes the paper clips to close an electric circuit and activate the solenoid.
I have created a standard for the wiring–The connectors that provide power are females and the one that receive power are males. Hence, I don’t have energized male connectors touching each other causing short-circuits. I used glued tape to group the wires together and label them. In this way, it will be easier reconnect the chassis to the board.
I used Velcro to attach the breadboard and the Raspberry Pi to the car. This is how the final assembly looks like.