Sunday 12 July 2009

Skype SDK

Now that the electronic to control the motors is working, I can focus a bit more on the software.
My robot will be able to move and take decision by itself, but I still want to be able to take control via the web.
The idea is to be able to control the moves and get video feedback. I tried many example found on the web, but all not as good as I was expecting. I want something as easy as messenger or Skype.

Then I found this: https://developer.skype.com/Download It is the Ski SDK website.
You can interface Skype wit your own application using their SDK.

After creating a Skype account for my robot and one hours playing with it, I was able to check incoming message to from Skype.
If I send the message 45;400 via Skype, my application will catch it, decode it and order the electronic to turn 45 degres then travel 400cm forward. The video feedback is very simple as it use Skype.
Then it took me another 20 minutes to create a simple application that look like a remote control for my robot. This 'remote' control is to be run on the remote side of Skype that will send the motion code 45;400 in this example.

Here is how it look like:


you can see the little remote control and Skype with the motion command sent to the robot. This solution will work in any situation where Skype works. So no need to deal with sub network or port number or this like this.

Thursday 9 July 2009

At least, I solved the com between the mini PC and the PID

After many hours trying to make the serial link between the PC and the Gamoto PID board without success, I am back with the I2C protocol.

The serial link is working fine if I only talk to one board, but when I try to communicate to the second board, it just does work.

I2c is designed to talk to multiple slave, so I guess it is better. I tried to use I2C in the past without success, but this time it is working.
I can now do the following:

- Application load a rotation angle on trajectory 2 of both PID
- Application load a distance on trajectory 1 on both PID
- Application command the PIDs to execute trajectory 2
- Wait for Trajectory 2 to be done
- Application command the PIDs to execute trajectory 1
- Wait for Trajectory 2 to be done
- Send to PIDs the SetHome signal to be reading for the next move

This move allow me to select a direction and distance via the mouse to be executed by the robot.
all move are managed by the PIDs. In case the PC crash, the PIDs will finish the move and wait.

It is a good start. There still few bugs and extra code to add, but at last, I have a robot that moves.

Tuesday 26 May 2009

Installing Windows on the robot

Today, I am testing the CPU solution
I got a converter 24V to 12V from Maplin to power the CPU and other 12V devices. It is a switched converter. it is more efficient than a simple LM7812 regulator and i can get much more power out of it.
So now, I can power up the CPU, and LCD screen to install Windows. After some simple test, I can also leave the battery charger on all the time. That's good news as I can leave the CPU on while charging the battery.
The bad news it that my LCD monitor has been damaged during all these years in storage. There is a big patch of dead pixels. That will do for now, but I may have to find another one :-)

Saturday 23 May 2009

Update... It has been a long time !

It has been a long time since my last post and since I worked on my robot. Few months ago, I ran into problemwith the USB_to_I2C interface. i could not get this interface to talk to any on my I2C devices.
Few years ago, I created a parallele to I2C interface using information from the web and it was working very well. I could talk to the Gamoto PID boards and other components such as temperature sensors, I/O interface, CAN, etc.... But this time i wanted to use USB as my new PC does not have a printer port. I was able to talk to the USB interface, but any attempt to communicate to I2C devices failed. even simple devices with simple commandes.

For the last few days, I played with the COM and serial interface. I have a small board that use a MAX232 to connect the Gamoto PID to the computer in order to configure it. As this way of talking to the Gamoto is also good for controlling the motor and allow up to 7 board on the same serial signal, I decided to use it instead of the I2C.
The only limit of not using I2C is that I can only talk to the PID board, I cannot interface any other I2C devices I was planning to use.
But the PID boards provide some I/O that can be controlled via the serial port:
-2 limit switches per motor (for front left/right and rear left/right bumpers)
-4 analog input per motor (possible for temp sensor, battery monitoring, Sharp distance sensor, etc...)
So it is not so bad.
I am not working on a basic interface that will allow me to give simple direction and distance order and the robot should execute then.

Thursday 12 March 2009

Power control board

Because the chassis of the robot is based on a electric wheelchair, the motors work on 24volts, there is space for 2 batteries and space in the middle of 20cm x 24cm x 17cm. This is big enough to fit all the motor controllers, the PID and the few extra modules I need to distribute the power to the rest of the robot. Here a a draft of what the board does.




- The batteries are linked together to provide 24v. Batteries are fitted with fuses.

- The relay R1 controls the power on the motor. This relay will also be my emergency stop in case the robot goes wild. This way, I can stop the motor without stopping the rest (PC, logic, sensors, etc...)

- The relay R2 controls the power to the rest (PC, logic, sensors, etc...).
These two relays can switch up to 30 amps

- A first voltage regulator (reg1) provide 12v to the PID
I've created this module with bits I had. Took me 10 mins. This is just a 7812 voltage regulator mounted on a heat sink.



- A second voltage regulator (reg2) provide 5v to the I2C but. This module also provide 6 sockets for the I2C bus. That will allow me to plug the 2 PID, the PC and 3 other I2C devices such and temperature sensor or ultra sound ranger.
This module comes from a previous robotic project.

- Then the PIDs from Gamatronix and the MD03 modules from Devantech





Here is how it looks like one every thing in fitted together:

All modules are fixed on a perplex sheet. There is a second level to hold the PIDs and 5v/I2C modules.

Quadrature optical encoders for my motors

The two motors on the wheel chair are fitted with a braking system. This system lock the motors when no power is applied to them. I guess, you do not want the chair to move out of control when the battery is flat. But for me, these brakes are not required and need to be removed.
The good thing, it that I will be able to fit quadrature optical encoder where the brakes were and fit the protection back.
The encoder will provide position, and speed to the PID controller. The PID requires signals from the motors so it can control the motor in acceleration, speed and position with great accuracy. This is the idea:



Two sensors will detect the increment of the disc fitted on the motor's axis. The difference between the signal provide the sense.



A quadrature encoder provides 2 signals, frequency provide the speed. A search on google will provide much more details. I could have built them myself, but I found 3 of these encoders on eBay for a pound, so better this way. Here is one of them:
In fact, I build similar encoder a couple a year ago with infrared led and sensor. It was working, but they were big and not as good as these one.

This is how I am planning to fit them:

And this is how they fit:

For the control, I will then use the PID controller from Gamatronix and the motor controller MD03 for more power. The PID controls the MD03 in 0-5v + sense. The encoders send back the signals to the PID. The PID are controlled via a I2C bus linked to the computer. Here is how it works:

I started to test this solution. So far, so good. I can control the wheels speed and position. I am planning to control the wheels using position mode so like this, if the PC crash, the PID will stop at some stage as no new position is received. The PID also include switch limit input that will be linked to a front and back bumper. This way, the PID will stop the motor if the robot crash into something without the need of the program on the PC to take action.

Wednesday 4 March 2009

No progress for a week

I've been busy at work since the last time I tested the motor controllers. I did not really progress much. I just had time to think a lot and make a shopping list for parts.

My first task is to build a casing for the electronic that will control the motors and provide power to the computer. I have all the modules ready, I just need to buy a switch that can cope with 30A and a relay that can also cope with 30A. The switch will be right after the batteries, the relay will control the power to the motors. Like that, I can build a kind of emergency stop without shutting down the on board PC.

Once this is done, I will fix a plywood board on the top in order to fix the PC and the webcam. Later, I am planning to add distance sensor and a bumper.
For the PC, I have a old DELL laptop with a WiFi card and a Mini ITX PC. Both of them can run using 24V dc using a simple DC-DC converter. I still don't know which one to use. Any PC would do as all the sensors and motors are controlled via USB (PC <-> USB <-> I2C <-> sensors/motors)

Anyway, I should get more things done by the end of the coming WE and will post new pics

Friday 27 February 2009

The motor controllers arrived, I can start playing...

The controllers from Aventech arrived on Wednesday. I can now start building and testing.
First thing, it to make sure the controllers works and cope with the power of the motors and also see if I can should use 12 volts or 24v.



For this test, I just used free wires to quickly connect everything. I am controlling the MD03 controllers with 0-2.5-5v signal. I am also using a small board I make few years ago to generate the 5volts required by the controllers.

It is not great, but good enough for testing.
The control is done via two linear variable resistor of 10k to provide the 0-5v signal.
2.5v is equal to stop, 0 is full backward, 5v is full forward.

Using 12v as power source did not give very good result. The power to the motors was not great and at full speed, the robot was not very fast.
After adding the second battery to work on 24v, the motors are more responsive and speed is much better. So I guess, I will have to use both batteries in 24v setup. The mini PC I am planning to us work with 12v input, so I will have to review this and find a solution.


So, the mechanic is working, the power controllers are doing the job too. Next step is to do a proper cabling job and change the control to I2C protocol from the computer and start playing with Visual Basic.

Monday 23 February 2009

New motor controllers

Today, I ordered two motor controllers from Daventech (http://www.robot-electronics.co.uk/acatalog/Motor_Controllers.html). The MD03 model. I already have two PID motor controllers with encoder input and all the rest, but they can only deliver 3amps and my motors can drain much more.
So the idea is to using these MD03 drivers that can cope with 20amps current. They can be controlled via I2C protocol which I planning to use to connect all the robot elements. These drivers can also use PWD + sense signal, so later, I am planning to re-use my PID controllers to get accurate position and speed. I will cover this later I guess.
So now, I just need to wait for the delivery and start testing...

Sunday 22 February 2009

A wheelchair from ebay

Last week, I won an ebay auction for an electric wheelchair. Its a Twister Junior electric wheelchair in need of TLC. I got it for £62.

That will provide the motors, the gears, the wheels, the chassis and the batteries. The motor controllers are using a "DX BUS" protocole that nobody knows. I have other ideas to control the motors, so that's ok.
Motors are veryu quiet, but use a lot of power. my 3amps PID controllers from a previous project will not cope with that, so I need to find another way.
Also, the motors work on 24v. I would prefer to use 12v as power source. I will have to investigate and see if 12v make the motion fast enought. so far, I just took it in pieces and cleaned it.

The BIG idea !!

My big idea is to build a robot.
There are plenty of toys and gadgets that does exactly this, but I want to build mine and i want it to be like I want. Of course, I do not have the budget of NASA, so it will mostly be made of bits and scavenged parts. Here are some requirements and limitations I have:

- The robot must be able to go outside (garden) as I do not want it to sit in my house and take space for nothing (well, this could be my wife requirement:-) Also, I have a small kid and I do not want him to get his hand of finger stuck in a gear or something.
- This robot must be as cheap as possible
- This robot will not clean the floor or cut the grass, for this, I could buy one already done.
- I hope to make this robot clever At least, be able to navigate by itself and have some interaction.
- This robot should fit in my car, and thru doors (60cm wide max)
- The robot ill run ith VB code (I like coding in VB)

Ok, so now lest start building....

First post....

Hello and welcome to my blog. I am dedicating this blog to my new DIY project: building a robot. This is not the first tentative here, but I hope this time I will succeed and finish it ;-)
To keep me motivated, I am going to share my experience via this blog and hopefully get feedback from others who share the same interest.
So keep checking, this blog....