Wednesday, September 19, 2012

The Robot Project!

It's Sep 19, 2012 - And it's been about 2 months since I started turning an electric chariot (A FAKE Segway) into a robot, this project started out to be a robotic lawn mower, and since it was started I got a real robot lawn mower, so I don't think I want to make this into one any more. I'm not really sure what it will become, but I thought it's been long enough and lots of stuff have happened I felt I needed to document the journey. So this is what I used as the base, mine was blue, and a slightly different model, but they are all pretty much the same. One of the first things that I wanted to do was do a tear down of the chariot and find out just what I was looking at to use. So below is the motor controller, made in China, but that is really about all we were able to find out about it, It's a single controller, but drives both wheels (I should that both wheels do the same thing, in other words, forward drives both wheels forward. there is no left or right control) With that being said, you can see the large relay in the middle, that is used for reverse, and to turn one or the other wheels off. Unfortunately, there is no way to make one wheel go forward and the other to go backward, at least with this controller. The wheels themselfs are the motors, simple 36v DC motor, they are regenerative motors, and it looked like they are setup to feed back into the battery if the break is engaged. Speaking of break, the motor control does have a full stuff electric break, which worked really well, almost too well when there is no weight on the frame. So here is the frame with the motors/wheels, and after I removed the steering off the back wheels and made them free spin (360 degree). And there are 2 or 3 videos of me getting the wheels working with out the "controls" that it came with, really it's a lot of simple switches, So I decided to go ahead and use the controller that it came with, and I wanted to keep the project "cheap" There are also a couple of video showing how I figured out how it did turn one or the other wheels on or off, if one of the wheels is off it becomes a free wheel, and depending on the surface it's sitting on depends on just how much that wheel turns My controller of choice was/is the Parallax Basic Stamp, If you go back and look at some of my video, you can see me playing around with the Stamp, it's easy to use, fairly low cost, and if used in quite a few robots, I also ordered a few arduino relays (12 total, even thou I really only need 6) These are coming from China, cost wise they were very cheap, time wise, they did take a while to get here. And I got extras because what if one failed, I would have to wait again for a replacement, no I have a replacement. Meanwhile I started to program the stamp, and do a basic lay-out of what and where things should be hooked up. The picture below shows the relays and the stamp on a board on the frame of the chariot. It was about this time thou that I came across an Ambrogio robotic lawn mower, and that is when this changed from a lawn mower to just a really cool robot to play with! In the picture above you can see the relays, (3 of which are no being using, more on this later), the basic stamp board, and a 2nd breadboard - the 2nd breadboard has a LM358A Dual Operational Amplifier, this when using a Pulse Width modulation signal from the stamp can be used to generate 5v which is used then to drive the motor controller - 5v will give max speed, the PWM can be adjusted and various voltages come out, 0v volt = stop, and anything between 0 to 5 will control the speed of the wheels. At this point, the LM358A circuit didn't work, and we finally decided that it really did need 12v like the diagram said it did, We did end up destroying one side of the Op Amp as well. A ping sensor was also added at some point with in this time frame. and a simple real word test was done, at this time I was using a weak battery, but was doing a test, things seemed to work, more or less, but once I put a good main battery on it - it was way too fast. During this test thou I decided that I might need to add a servo for the ping sensor to move, and get better detection. We also added some Voltage regulators at this time, a 12v, 9v and 5v were all added. The LM358A was placed on it's own breadboard, and piece of wood, it was mounted behind the stamp (Unfortunately I can't find any pictures of this, thou there are some videos with it in this configuration), Also mounted the USB connector for the stamp, and using a USB extension cable to program it now. At some point, we decided that we also needed more amperes to power everything, both the 9v and later the 5v had transistors added to them for just that reason. This ended up causing hugh problems thou, what my partner didn't realize is that the transistor where grounding out on one of the positive pins, And we went though many burt wires, and lots of archs and sparks. It took almost a week to get it back to "normal", and I ended up doing an almost complete rebuild. At one point I did think I fried the basic stamp board, but luckily it is working just fine. The above video was just after the rebuild. This was also after a rebuild, during the time of all the archs and sparks I beleive we ending up rebuilding this twice or more, I did move things around more thou, not really a complete rebuild. The above video shows a wheel/bench test this is after I got LM358A working, and again I moved some stuff around, removed the servo at this point, but later I moved the ping sensor again and put the servo back on. it was about this time that my Parallax LCD showed up, the LCD has backlight and speaker, this added the many possibility And my ADC0831 analog to digital converter showed up, and a very simple voltage meter was added, using a simple voltage divider. This was also the 2nd time during this project that I blow something up...Its a good thing I ordered two ADC0831, they really don't like having 36v applied to the input. I also mounted the LCD, and moved the board from behind the stamp, to ontop of the Stamp (For like a two layered effect), moved the Ping Sensor and added the servo again. I was having some issues with the servo, I thought it was a power issue, but turns out the basic stamp just didn't like a 25+ year old analog servo. At this point however I didn't fix that problem and just disconnected the servo again. I wrote some code for playing a "Battery Dead" and "Unknown Error" sounds using the LCD, and put those sounds into the robot code. About this time, My IR Obstacle Avoidance sensors showed up from China, I haven't added these into the bot yet, I did test them, they work great, are very simple on off switches (If it sees nothing it's on, if it sees something it's off, or is it just the opposite?) Either way I wrote some code, and I am planning on using these from drop off sensors, and yes they did work outside, quite happy with the results, but still need to get them mounted. Which finally brings us up to about last week, I added a Basic Micro Nano8 processor to control the servo, I setup the Stamp to send a high to the Nano8 when the Stamp wants the servo to move, the Nano8 is just will move the stamp to one of three spots, -45 degree, 90 degree, and 45 degree. It just counts the number of highs/low and decides where to move the servo, there is no feedback to the Stamp, the timing on this is a little off, but this is kind of a work in progress and it does work. The Nano8 has 4 I/O lines plus a serial port, the 4 I/O lines can be used for A2D, and 1 of the lines is capable of doing PWM. I have two analog sensors ordered a temperature and a humidity. I also order a couple of serial port buffers so the Nano8 can send the sensor information the Stamp, and the Stamp can decide what to do with it. But for now the Nano8 is only controlling the servo, added the Nano8 appears to have fixed the bouncing issue I was having using this servo with the Stamp. Of course this is still very much a work in progress, I have several things ordered that haven't arrived yet, an accelerometer, humidity and temp sensors. I did order a smaller relay board, and they arrived today, so I am going to replace one of the relay boards with the smaller board. I still need to figure out away to contain it within the yard, and work on getting better speed out of the wheels, or maybe just one speed at this point? Reverse goes at almost full speed, while forward is going to be very slow. I have a lot of videos of the progress on this, alot more then I posted here. http://www.youtube.com/kd8bxp That brings the project current as of Sept 19, 2012, I'll be doing more posts as it progresses, and of course a lot more videos to come! LeRoy, KD8BXP