Foundation Degree in computing - main project. Project to convert K-9 toy into an autonomous robot. By Kristian Dunn

Wednesday, 23 December 2009

It's nearly xmas - and the first wave of screw-ups

Since the last post I have been hectically working on other assignments and also the circuit diagrams and vero board layouts for the control boards. The first screw-up encountered was with the Velleman boards themselves. They have an open collector output which requires more components to interface to it. This was overlooked in the initial designs. As I am working with 74HCT series logic I can interface directly with the PIC microcontroller on the board. This is easy for the digital outputs as it is just a case of removing the darlington driver chip and jumping across the DIL connector to bypass this. The PWM output however required tracing the PWN output on the chip to the first component it encounters (a resistor in this case) and soldering onto the lead of that component. This avoids soldering directly onto the chip itself.
The second screw up in the design was the clock division of the PWM output. My circuit simply divides the clock on the positive edge. When testing on breadboard the LED output remains half brightness wherever the PWM slider is placed. This is because the clock is being divided but the duty cycle (PWM ratio) is lost. I have decided to go with the direct output and see if it works without slowing the clock speed.

After some calculations the components have been changed from the original circuit diagram so more current flows.

The third and final screw-up came evident when building the test circuit today. I use a faulty computer PSU as my bench supply which has bad output capability and tends to drop its output voltage when more than 2 Amps is asked from it so I can test most circuits without risk of damage to the components.
Somewhere along the line I downloaded a datasheet for PN2222A transistors and not P2N2222A. Only a subtle difference in part number but a totally different pin configuration so the initial breadboarded test circuit kept shorting out the main supply. This fault was quickly traced using a multimeter and the correct datasheet downloaded as a result which shows the correct output pin configuration as CBE as opposed to EBC for the PN2222A. Rotating the transistor through 180 degrees on the breadboard solved this little mishap and tests using LED's show the circuit to work very well.

So today one of the chassis motors was wored up to the test circuit and I am very happy to say that it works very well. The useable range of PWM seems to be from around 50 to 150 from a range of 0 to 255 in the software. Off load the motors pull around 0.3 Amps and stall at around 1 Amp.

This is a video of the test circuit in action.

Here is the chassis being tested. Note the direction change of the motor and the varying speed.

These two pictures show the original designs before the problems were encountered.
This is the logic controller which selects direction and prevents short circuits through the h bridge


The H-Bridge output circuit.



The Logic COntroller Vero Board design.


The Output Board Vero Design.


The next two pictures show the test circuit. The third shows the modifications to the Velleman board.





Sunday, 22 November 2009

Got the parts!! Been investigating.

All the parts have now arrived except for the TIP102 transistors. The main challenge has been trying to fit all of the components of the robot into the rather small chassis of K-9. I attached the tracked drive system to the bottom of the toy so it protrudes out of the bottom by around 30mm. If time allows and there is sufficient space I will introduce this into the body of the robot later on so that it looks right.


Marking for the drilling points




Chassis attached to base plate. Battery tray and guide wheel have been cut out to make more room inside the robot for other components.




To give an idea of scale that is an HP Officejet 6110 he is sat on.

Removing the unwanted plastic was a tricky task. It would be nice to have some proper tools for doing this.
The tracks are mounted quite far towards the front of K-9. His head is quite heavy so under braking he could topple forwards so for this reason i moved the tracks as close to the front as possible.

With the order came the control PC. This is a VIA PX10000G (details here) which is a Pico-ITX form factor PC. Tiny does not even come close to describing this thing. Here is a picture - no i do not have giant hands!!

I've got a 4GB flash card and put XP on it. I used the instructions here to 'embed' the operating system and enable EWF.I connected up both Velleman control boards and ran the test program on both. I also had a wireless dongle plugged in and connected via Remote Desktop.
The special power supply is also very impressive, an M3-ATX from LinITX.
I ran the entire set-up from a 3000mAh 14.8V LiPo pack with a meter inline to measure the current. Under full load the whole lot pulls 0.7 Amps so this battery will power the robot for some considerable time (calculated to 4.29 hours!!). With this in mind I may omit the umbillical option from the build.

Wednesday, 18 November 2009

Circuit diagram and ordering

I am slightly behind schedule but have now drawn up the proper circuit diagram for the motor drive system and ordered most of the parts for the project.

A purchase of smartdraw proved very valuable. I am a great fan of open source but simply couldn't find anything to beat this.A bill-of-materials has been drawn up from this and other components and the orders placed for most of the items required to build the robot.

Saturday, 14 November 2009

Investigation of PWM

This week I investigated the Velleman K8055 board for suitablility of driving an H-Bridge motor controller. I am using a good fast opto-isolator. I originally intended to use the TIP523 opto isolator with darlington output but it is slow and has a max bandwidth of 12.5kHz so I have switched to a non-darlington type which can switch in 3 microseconds. This has added the need for an additional transistor between the opto-isolator and each transistor of the H-Bridge.
Investigaton of the Vellemans outputs allowed me to calculate its frequency. It does not seem to be documented anywhere other than the PIC microcontroller datasheet which gives a number of possibilities. It was time to connect it up to an oscilloscope.




 

As you can see from these pictures there is 20us per div giving approximately 40us for the time period. 1/40us gives a frequency of 25kHz. The closest frequency I can calculate is to take the oscilator frequency of 6MHz and divide by 16 twice which gives 23437.5Hz. This frequency will need to be divided down a little to be suitable for the motors.

Monday, 9 November 2009

Schematic for H-Bridge drawn up

A preliminary schematic has been drawn for one of the H-Bridges driving one of the motors. It is only a draft and does not contain the interface electronics to the logic level components and the small transistors required to drive the main transistors.


Friday, 6 November 2009

The Story So Far...

Ok, what has been left out in this project is what has been done so far.
I started all of this back in July 2009. I knew this project was coming up so I decided to get a head start and find out exactly what was entailed in building a robot and to see if it was within the scope of my abilities. I have a long experience with electronics and some experience with the components of robotics so this is not all new to me. In a way I have built a robot before when I constructed an animal feed system for dairy cows which was computer controlled and involved data logging. That system was DOS based and used the parallel port to control the entire thing.
My son has had a K-9 toy hanging around the house for some time. The remote control for this was lost some time ago so it was effectively useless. The first thing I did was open up K-9 and take a look around. The toy takes 4 AA batteries meaning it operates between 4.8 to 6 Volts DC (NiMH or Alkaline), there are two motors and a control PCB.

The only thing I could make K-9 do was make sounds by pressing the demo button so I rigged up an audio lead to plug into the line-in input of a PC to record the sounds. I added an inline resistor to protect the input and also to help avoid an impedance mismatch which would result in clipping of the sound.


Here near the top centre you can see the resistor soldered onto the speaker terminal inside K-9.
This lead was plugged into a nearby PC and the sounds recorded using Audacity. I would keep these for future use.
After this came lots of research into background. Also I looked into small factor PC systems including Mini,Nano and Pico ITX systems. With the limited space available and also to keep wattage down my main interest focused on the Pico ITX systems available from VIA with a tiny footprint of just 7.2 x 10cm.
I already own a 4GB compact flash card and IDE adaptor and have experience with embedded systems so acheiving the integration of this tiny little PC would not pose much of a problem. It was originally intended to use the existing chassis of K-9 with its motors and power them from the 5V supply line of the PC but as more recent developments have shown this simply wasn't up to the job so a dual supply will more than likely be used with a supply for the logic and PC and a separate supply for the dirty components like the motors and any other inductive devices.

As for batteries there was only one option - LiPo. lightweight and with a huge energy density these batteries are great for this project. NiMH and lead-acid were the other options but have been disregarded. NiMH dont have the energy density required to keep the robot going for a long time and lead-acid are simply too heavy and cumbersome. LiPo poses its own problems with critical voltages having to be observed to avoid damage and a more complicated balanced charging system.

I didn't spend too much time looking at sensors. I have come across the infra-red range finder modules before and decided to take a closer look. After considering the alternatives very briefly I decided to stick with what i know and trust which are the Sharp range of IR range finders.

and that brings me up to October which strangely enough is where the previous post starts. Sorry for jumbling up the order a bit.

I am now onto circuit diagrams for the drive system.

Sunday, 1 November 2009

Drive System Research

After initial tests using the existing motors it became quickly apparent that they would be inadequate for purpose. This is due to the fact that the K-9 will not go in anything that resembles a straight line without considerable human intervention. It also has problems turning due to insufficient power.

Therefore a tracked drive system for the robot with powerful motors has been purchased. It was also realised that the motors would be manufactured with different tolerances so it would skew off a straight line no matter how well made it is. After some reasearch it has been decided that the motors will be driven using H-Bridge circuits with PWM control employing some kind of PID system (Proportional Integral Derivative - good description here - http://en.wikipedia.org/wiki/PID_controller ). The drive system purchased is the smallest which can be obtained within budget but is too large for the K-9 body so will protrude from the base of the robot by around 20mm.

Saturday, 24 October 2009

First Entry

This is the first entry to the blog for this project. This blog will contain a complete life cycle of the project and include pictures/video/audio and other items relating to it.

The project goal is to create a robot, based around an old K-9 toy, which will map a small area and the obstacles in it. A user will then identify those objects and inform the software what those objects are so that the robot can identify them when it is told to move to them.

Followers