Navigation Menu

 Home
 Robotics
 Acting
 Poetry
 Contact Me

 

Robotics


I have been working on converting a radio control truck into a robotic truck. It's not going to be an android (human-like) as many people associated with the word "robot", but rather I'm implementing an electronic "brain" along with some sensors and other features. I may do something like giving it the ability to store "tricks" into it's memory, but that can come later. This webpage is to document my progress as well as provide updates for anybody interested.

The plan is to use a pic16F877a microprocessor for the central control and add additional components as needed. One of the nice features of these chips is they can communicate with other PIC chips, so I can expand if necessary. I already had a programmer (a device for writing programs onto the chip) for a pic16F84a, which is an 18-pin device, but I designed and built an adaptor for the pic16F877a chip, which has 40 pins, and it works wonderfully.

My remote control truck is one I got quite a few years ago at Wal-mart, with controls that are either on or off. This means it can be stopped, full-speed forward, or full-speed backward, but nothing in between. It's the same thing with the steering: left, right, or straight.

My first task is to take my remote control truck and replace all components inside to give it digital proportional control, which means it has variable speeds and steering. I bought a radio control transmitter and receiver pair designed for remote control aircraft since it has quite a few additional controls besides steering and throttle so that I can control any additional features I want to implement. Plus the new frequency will allow the truck to go much further than the cheapo circuit board it came with. I also bought a servo for steering and I'll build an electronic speed controller for the throttle. Building it myself will allow me to make better use of the main processor for speed and direction control. I'm also planning on using the landing gear switch to control headlights and taillights (which I am adding to the truck along with reverse lights). Most of the lights will be automatically controlled by the microprocessor using the sensors and current remote control input.

10/19/2007
Most of my work up to this point has been research, collecting tools, and getting some code working for the microprocessor. I also took the original 27MHz circuit board and diagrammed a schematic out. A few days ago I started implementing the mechanical changes and upgrades to the truck. I ordered some books on robotics to help out with some of the details as well as to provide an easy reference if I need it. I've been able to do more work on it lately since I was off work to recover from having gallbladder surgery.

So far I have taken the truck apart down to small pieces and started the replacement of the front steering. It was using a motor with gears and a small circuit board inside that provided feedback to the controlling circuit so the motor would stop when the wheels were turned. I took that apart and removed all the gears and motor and used a Dremel tool, a drill, and some files to be able to fit the servo inside the old motor casing. My challenge was to place the servo inside the truck in such a way that it would require no modification to the servo itself if I ever needed to replace it. After carving it up, I used electrical tape to secure the servo from shifting around inside. Then I took one of the metal gear posts from the original parts I removed from inside the casing and secured the post in a location so the new unit would still fit into the truck in the same way the original motor component did. So that fits into the car well and lines up just right.

Now I am working on designing and creating a bracket so that I can attach the old linkage that controls the wheels to the servo without modifying the servo at all. I have a general design in my head at the moment, but I am testing some of that liquid welding stuff between the 2 different metals I am going to use. I applied it this morning and it's currently drying. If all goes well, then making the bracket will be simplified. Otherwise, I'll just come up with an alternate design. So the plan is to get the steering functional this weekend. I'll also be working on a design for the speed controller and I may order some parts to be able to create that. I've found a couple of good designs already, so I'll most likely be using those as a base. I also found a good design for an H-bridge online, but I'll need to look that up again since I forgot where it was (although I think I remember). Hopefully I'll be able to at least get the truck running as a RC truck with digital proportional steering in the next few weeks. Adding sensors (such as an IR sensor) shouldn't really be all that difficult and there's supposedly a good design in one of the books I bought as well as some designs that I found online.

10/22/2007
Ok, so here's what I did this past weekend. I started by working on the steering. To start with, when I loosely put the old parts in, I realized there was a new problem. The servo has a larger turn radius than the old motor. So, I needed to redesign how the steering worked somewhat. I decided to go with a steering method similar to what was originally in the car. The first step was to figure out how long to make a lever to make use of the turn radius of the servo in order to get the full turn radius of the wheels. I did a measurement or how far a know lever turned on the motor and using tangents, I calculated the angle the servo turned (approximately 120°) as well as how long of a lever I would need. Then I redesigned the bracket in my head and fabricated it out of brass using a variety of tools. I also designed and created a new linkage, while making use of the existing tie rods for the wheels, and assembled the whole thing. I gave it a test and it worked pretty well, but the only thing I'm not too happy about is that it has a bit more play than I would have liked, since I didn't have a good way of making it easy to disassemble while securing the tie rod to bracket linkage from rotating. I may go back at this and build an improved version with better leverage that addresses the loosness problem. Also, the weld stuff does hold to metal quite good, so I'll probably make better use of that as well. It's good enough for now though and the steering does actually work for all practical purposes. I took some pictures of the linkage, but have yet to upload them.

The next thing I tackled was seeing if the rear drive motor could be upgraded. I bought a larger DC motor at Radio Shack and decided to test it's RPM on the same load and voltage as the old motor before doing a replacement. I took another motor to use as a generator and connected a gear to it. Next, I hooked up my multimeter to the generator motor to measure the voltage output. Then taking each of the motors and connecting the same gear to them, I tested how much voltage each generated when turning the generator. Surprisingly, the original motor produced more power, so I decided not to make any modifications to the rear of the truck. I reassembled it and used some epoxy to make a couple repairs, during the reassembly process, for some plastic parts that had snapped off in some crashes which probably occured when one of my kids was driving it.

Next I started looking at electronic speed controllers designs again. My biggest worry was how I was going to read all the radio inputs into the microprocessor. Most of the designs which used a pic chip read no more than 2 channels for reading the PPM (Pulse Position Modulation) value to determine what positions the controls were in. Since I wanted to make use of the 6 channel RC Transmitter/Reciever that I had, I was looking at various ways to tackle this. One that I had been considering was assigning the task of reading the PWM (Pulse Width Modulation) signal with separate pic16F84a chips and communicating information back to the main pic16f877a processor, but I wanted to see if I could find a simpler solution. After doing some research, I'm thinking of making use of an octal latch chip (such as the 74LS373) to latch in the values of all 6 channels and loop through them, which will allow me to make calculations to determine the pulse widths on all channels without channel values changing during those calculations. Then I could make use of just the pic16F877a without complicating the design too much with a bunch of other unneccesary extra parts. That will also keep my costs down and it's much easier to make software tweaks using 1 microprocessor than multiple microprocessors.

Since I have somewhat of a good idea about what I'll be doing with hardware, I'll be writing the initial software soon. For the test circuit, I'll probably do something low power like rapidly blinking an LED or 2 to give it the illusion of changing brightness as the controls move. Either that or I may just output something on an LCD display, for which I wrote some nice code to interface it about a week and a half ago.

6/3/2008
It's been a while since I updated this page. Since my last entry, I made many design changes. First of all, I decided to go with a dsPIC33F device that is specifically designed for motor control. It has many nice features that would make future expansion of the robot very simple. However, in order to use it, I need to have an ICD (In-Circuit Debugger) to program it since making some kind of adapter for my programmer would be impractical and the ICD allows debugging straight from the software, which is very nice. I went ahead and built a USB version of an ICD clone, but when I attempted to plug it into my computer, the lights lit up, but no new device was detected. I compared my circuitboard to the original schematic and found a couple design bugs, which I fixed, but it's still not working at this point. I wonder if I may have fried the USB chip when removing it. I do have another one and I probably should have tried breadboarding this before making it, but oh well. That portion is on hold for now.

Recently this past weekend, I had stopped by goodwill and found a Nikko 4WD car (I can't remember the model) that came without a remote or battery for on $6.99, so I bought it. I am now going to use this for the chassis. It's much bigger than my truck and look more proportionate to my remote control size. The motor that controls the steering is basically a pseudo servo and has a potentiometer and a motor inside with some gears. I am working on designing a simple circuit that will read the PWM signal and control the position of the motor based on it's value. For that I'm going to use a PICF628A which has all of the basics I need. I should be able to get this circuit working in the next few days, which is extremely simple. I have more to update, but I need to get going.

6/4/2008
Ok, here's what I did last night. I started trying to design the new circuit and realized I would need some kind of transistors to drive the motors, so I decided to go a different, but easier route. I checked the value of the potentiometer inside of the pseudoservo and it tested at 5K ohms. Then I took apart my existing servo, and did a little testing. Inside the potentiometer was reading at 2.6K ohms, but I figured it might have another resistor in parallel, which would drop the resistance, so I desoldered the circuit board (after carefully diagramming it) and retested the potentiometer. It tested at 5K ohms this time. So I went ahead and put the circuit inside the pseudo servo so that now it's a real servo. I reassembled the car and tested and it worked although I do need to recalibrate the remote for the new mechanics, but this should be a very good solution. I may build that circuit for my old servo in the future anyways because it would be a neat circuit to have available.

The car I got is a Nikko Super Megatron which was manufactured under a number of other models as well. One of them was manufactured for Radioshack as the Desert Viper (I looked at a parts diagram to confirm this). I remember that particular car from when I worked there 12 years ago and it was their most expensive car and if I remember correctly, it went for about $225 at the time.

One of the main reasons I liked going with this new chassis is that it held a 7.2V batter as opposed to the 9.6V one I had in the truck. Most of the commercially available ESCs (Electronic Speed Controllers) would only go up to 7.2V, so this gives me a much wider variety of to choose from. The next things I am going to try and get are a commercial ESC and a new battery (the one I have is probably at least 15 years old and I haven't used it for that long either). Then again, I successfully used another 9.6V battery that was about just as old, but it doesn't hurt to have 2 batteries. This should give me enough parts to get a basic RC car up and running.

The next step would be to start making logic boards for the brain of the robot. I have been toying around with the idea of just buying a commercially available board with a chip of my choice as well as a bunch of support circuitry. That way I could just take care of the programming, which is the portion I am looking forward to the most (although I do love the challenge of getting things working mechanically). However, if I do end up going with my own design, I think I will start by creating a breakout board for the processor (a circuit board to which an SMT chip is soldered so that wires can be connected to each separate pin of the chip). That way I can just hook it up to a bread board and develop a much better understanding of how it need to be hooked up as well as to be programmed. In fact, I could most likely just hook up the processor on the breakout board directly to my existing programmer. I still don't feel like mucking with an ESC at the moment, but if I feel I could build a more efficient one, I may go that route after getting the initial car running.

6/5/2008
Last night, I went ahead and bought an ESC and a new battery. The ESC was quite a bit cheaper than I was expecting at only $30. I got a new battery because it was a NiMH (Nickel-metal Hydrite) and had a much bigger capacity 3000mAh (milliAmp Hours) over my old NiCd battery with only 1200mAh although they had batteries with capacities up to 5000mAh. I also discovered a hidden battery compartment for the old circuitry that could hold 4 AA batteries, although I don't currently need it. I may make use of that if I feel it could be beneficial to any additional circuitry. The ESC was able to provide power to the receiver as well as the servo, so that was a definite bonus since I won't need the AA battery pack that came with the receiver. Also, it looks like the ESC has very low resistance and a small footprint, so I see little benefit in building one myself.

I went ahead and soldered 2 wires together inside and insulated it with heat shrink tubing that I had bought and then secured the receiver inside with some velcro. Then I desoldered the switch from the ESC and soldered a bigger one that came with the car so it would fit inside the switch compartment. Then I straightened out a bend in one of the front tie rods (probably from the previous owner) and reattached the front bumper. At this point, I need to buy some bullet connectors, heavier gauge wire and some method of securing the battery compartment door since the tabs have been worn down over time. I figure I can use velcro for that. I'll head over to Radioshack later today to get those items (they should have all of those things) and then I can finish assembling the car tonight and recalibrate the steering so that I can at least get it running as a basic RC vehicle, which is excellent for the summertime.

I also was looking into the costs for a real ICD and what a development board would cost and the prices seem more reasonable to me--especially on ebay. I may get those eventually if I can't get my ICD clone working.

6/6/2008
I went ahead and bought the remainder of the parts although I ended up needing to stop at 2 Radioshacks to get everything. I went ahead and put together some wiring adapters and finished hooking everything up. I recalibrated the steering and had to reverse the direction of the ESC through the remote, although I could have simply switched the colored wires. I used velcro to hold the battery cover in place and after putting the cover over the electronics and securing the extra antenna wire, it was ready to go. So I went ahead and took it outside to get an idea of it's capabilities. It raced just fine and was able to go very far. In fact, I was only limited by how far I could see the car. I think it went around 10-15 MPH by comparing it to other (real) cars going through the parking lot. Unfortunately about a minute or two into starting racing I crashed into a pole and snapped the front bumper into 3 pieces, which is mostly cosmetic anyways. I was able to race it up curbs, on grass and accidentally went through a puddle a time or 2. The only thing that stopped it was if it crashed into some bushes, which caused the wheels to become jammed in the branches from the inertia. All in all I'm pretty happy with the car. I think it's probably the best one I've ever had. The next steps are going to be fixing the bumper and starting on the main robotics board, which will probably start with me making a breakout board for the processor, which hopefully shouldn't be too challenging. I also took a bunch of pictures available for viewing below.

View Robot Photos

6/9/2008
I didn't do too much this weekend. I ended up putting the shell on and raced the car around again with my boyfriend. I also drew up a circuitboard design for the breakout board. So the next step is creating and assembling the circuitboard. Then once that's tested, I can figure out how I'm going to go about with programming it for the time being. I'm hoping I can just connect it to my existing programmer by building some kind of interface. After that I can start breadboarding out the actual circuitry. I also need to find a high-level block diagram I drew up for how the circuit will interact, although I'm pretty sure I could figure it out again if I had to.

9/17/2008
Ok, it's been a while. I've been doing things like being in a musical, playing World of Warcraft, and learning the violin that have been taking up much of my time. However, I've made some progress on my robot. First of all, I've decided to go with an Arduino Diecimila board for the main controlling board. I had attempted to create a breakout board for the dsPIC processor, but my boardmaking skills just don't seem to be good enough. Sure I could order custom boards, but that gets expensive. Anyways, the arduino was only about $40 after shipping and everything. I chose this because it's a popular platform with a lot of code available for it and there's nothing to build for the main unit. I also purchased an oscilloscope, so that should help me with reading signals.

I've been playing around with how to get everything set up and I did lose a bunch of my diagrams, but I do have a lot of stuff in my head still. My current decision is to use the Arduino as the main board and for reading the PWM signals from the RC control, I'm going to use a PIC18LF2620 chip with some custom code and will communicate the values to the arduino via I2C. This is a 28 pin chip, so it's relatively small and I already have it. Also, it's in a DIP package, so it's easy to prototype with breadboard. My main challenge will be throwing together an adhoc adaptor to my programmer since it only does 18 and 40 pin chips, but I don't think that should be too difficult. I'll post further if I make any additional progress. The next step is to get the PIC chip working.

Ok, I put together an adhoc adaptor for the PIC chip on a breadboard with wires and tested an initialization and that seemed to work. The next step is to write a simple test program and see if I can write it to the chip successfully. I need to download and install the Microchip C18 compiler to do that and I'll probably take care of that tomorrow.

9/18/2008
Last night I found a copy of the C18 compiler I had downloaded, copied and pasted a sample program into mplab and compiled it successfully. After that, I uploaded it to the chip successfully, erased my buffer, and read it back from the chip successfully, so my adhoc adaptor is working fine. Just FYI, my adaptor is just a breadboard with wires going to my programmer on corresponding pins for Vcc, Vss, MCLR, PGD, PGC, and PGM. At least it gets the job done. The next step is to get a program I had written for the PIC16F84a ported to the new chip and updated so it can be read via I2C. Once that's done, I'll probably make a custom circuit board that allows me to just plug in jumper wires from the receiver to the chip and have another set of jumper pins to communicate with the arduino via I2C. After that, writing a control program for the arduino should be quite easy assuming everything works as planned. I'm not sure if I already mentioned this, but there were 2 main reasons I am using a separate chip to read the pwm signals:

  1. It can be processor intensive to read the data and I'd rather have a dedicated processor for it.
  2. The arduino has a limited memory and I didn't want to waste it on code to read the PWM.
With the dsPIC chip, it had settings to automatically read it without extra code or processor dedication, but because the spacing of the leads is so tiny, making a circuit board becomes very difficult. I also have a feeling that if I can make a circuit that translates multiple PWM signals into I2C, I may end up with a product others want, since I have seen a lot of demand for it, but have not come across any such products.

10/8/2008
I made some progress tonight. I've been doing a bunch of research on various settings for the PIC18 series chips such as what the various fuses are and how to get it to run with the internal oscillator and use PLL (phase locked loop) to multiply the clockspeed by 4 to get a total of 32MHz. I had thrown together some code last week and uploaded it to the chip, but when I tested it, the LED didn't seem to blink. When I tried the program in a SPICE simulator, it seemed to run ok, so I wasn't sure what was wrong. I fixed my power supply, from which the voltage regulator had been resoldered numerous times had finally detached for the last time, by simply replacing it and wire-tying it to the board better. I hooked up the circuit and still it didn't blink. I couldn't locate my logic probe to test it, so I decided to try hooking it up to my oscilloscope. I was pleasantly surprised to see a square-wave pattern on the screen. What had happened was when I threw the test program together, I made a delay routine that just simply ran from 1 to 10000, which was simply too fast to visibly show up on the LED. With a bunch of testing and using the "stopwatch" portion of MPLAB, I was finally able to make a fairly accurate delay routine, which now works. I'm working on making the pseudocode (which is nothing more than a step by step description in english about how the program runs) for a program that will decode the PPM signals from the receiver and somehow transmit them back to the arduino (either via I2C, SPI or possibly analog output). I just love the irony of having a project that uses a PIC chip and an Atmel chip (2 major competitors) together.

10/10/2008
After doing some reading, it sounds like I2C will fit the bill after all. Hopefully I'll be able to make some more progress on this over the upcoming weekend.

10/14/2008
I changed the code so that it blinked a bicolor LED between green and red. It was having trouble and operating erratically. First I tried programming a second chip with no success, and then I ended up mounting all the components on a different breadboard. They seemed to work much more consistently on the new board. I'm now at a point where I'm doing more reading so I can start making use of the timer. Once I get that figured out, I'll work on getting 1 channel read and change the light between red, green, or both depending on the position of the control. After that, getting multiple channels working should be much easier.