Light following robot.

simmisj

Senior Member
Hi.
I am making a light following robot (later it will get GPS position to be able to follow a person or something of my chosing).

I have made a very simple setup. I have two continuous servos, two LDR's and two 08M's.

Everything mounted on a single PCB.

The problem I am having is that one of the motors always seem to hesitate and be on or off randomly. Also the motors are just very unpredictable in general (with this setup that is). When I use them independently they work fine without any hesitation or anything.

This is the code on both of the 08M's:
Code:
SERVO 2, 150 
SERVOPOS 2, 165
pause 10



do 
loop
I'm thinking maybe it can be a voltage drop issue...
Or could it be interferance between the two picaxes since they are on the same PCB and connected indirectly.

Any ideas as to what could be a better solution hardware vise. Maybe use a single, more powerfull chip. I have 18x and 20x2.

PS. The GPS module needs UART. Maybe going for more powerfull chip now will reduce the pain later. Can the picaxe chips even use UART?
The module: http://uk.farnell.com/rf-solutions/gps-320fw/module-gps-receiver-w-ant-ttl-rs232/dp/1718690
Here is something taken from the datasheet: "Protocol NMEA-0183 V3.01
GPGGA, GPGLL, GPGSA, GPGSV, GPRMC, GPVTG, GPZDA
4800 baud, 8, N, 1"
 

lanternfish

Senior Member
Hi

Regarding your GPS unit, it does have a Low Voltage TTL serial output on the connector. I can't find a decent datasheet to look at so do not know the voltage range for this output (3V at a guess).

I suggest you use a PICAXE with hserin to make life a bit easier with reading the NMEA data.

There has been plenty of discussion re GPS & PICAXE so a search of the forums will yield excellent info.

Not sure what your issue is with the servo's. My guess is that you need to ensure the earths/0V are good and that there is good decoupling caps around the 08M.

Have you tried supplying the servos from a different supply (remembering the 0V lines need to be tied to each other)?
 

simmisj

Senior Member
I just tried connecting them to an external 6V battery pack. Nothing changed.
Are servo's sensitive to interferance? What are the normal precautions taken to ensure the servos work normally?
 

westaust55

Moderator
While many SERVO’s are rated for 6Vdc my experience with those I have indicates that they will happily operate down to 4.5Vdc .

Running the SERVO’s from a separate power supply if possible is worthwhile to minimise electrical noise/power supply fluctuations.
The SERVO electronics is normally turning the motors on and off, although in your case think they are modified for continuous rotation – it that correct?

As Lanternfish has already queried:
1. Do you have the 0V of the PICAXE supplies connected solidly to the 0V of the SERVO supplies.
2. Do you have 100 nF decoupling ceramic capacitors across the PICAXE power supply lines close to the PICAXE chips.

Suggest that you upload your circuit diagram and if possible a photo of the circuit/project.
 

slurp

Senior Member
I'd agree with the comments above (#4) where the supply has not been seperated for the servo and picaxe. The servo start-up, running or change in direction could cause a dip in power to the picaxe... you'll see erratic movement but the picaxe is seeing brown out and power on resets. The more "worn" the batteries become the more common the problem.

Use of an LED indication may help with diagnosis, say turn on an LED for 1/2 second. Turn off and start the servo, if you're seeing the LED come on again then you're seeing the program restart after some sort of reset!

The easy solution is seperate battery packs and a common 0v. The location of the common point can be important, you don't want return current from the motor passing the picaxe (it can raise the potential of the "0V" to picaxe), give it a short route back to it's battery.

regards,
colin
 

BeanieBots

Moderator
Are servo's sensitive to interferance? What are the normal precautions taken to ensure the servos work normally?
Servos are extremely tollerant of noise but micros are not very tollerant of servo noise.
Normal precautions is (as said already) is to use seperate power supplies and take (again already mentioned) to ensure servo current does not go down the PICAXE 0v line.

Alternatively, decouple the servo and PICAXE with appropriate decoupling caps but try with seperate supplies first to make sure there are no other issues lurking.
 

simmisj

Senior Member
Running the servo's from another supply is not accepteable in the end but to get it working atleast, it is. I tried using a dedicated supply for the servo's with the GND connected to GND on the supply powering the circuit but the same problem perists. I have capacitors over the picaxe's (no idea if they are ceramic or not but you can see them on the pictures) and a 100uF capacitor over the power supply.
I am using a continuous rotation servos bought from Techsupplies.
Here is the schematic:

And here are pictures of the actual PCB board front and back:



Slurp that is a pretty good sugestion with the LED indication of restart or not. I'll try it now.
 
Last edited:

BeanieBots

Moderator
On both PICAXEs, serin is floating.
This WILL cause erratic behaviour.

If you don't want to have in circuit programming, then simply pull them down with a 10k resistor. For the sake of one extra resistor (plus socket which could be a 3 pin SIL header), you can have in circuit programming ability.

EDIT:
To save making a new board, you could link leg 2 (serin) to leg 4 (unused IP 3 which is pulled down).
 
Last edited:

Technical

Technical Support
Staff member
To retain programming capability make a three pin jumper link that joins all 3 pins together and use it on your serin swap-over jumper when not programming. This will link both serins simultaneously to the 22k/10k circuit - it won't program like that but will then work reliably. The jumper is badly designed - allowing the unused serin to float!
 

simmisj

Senior Member
I think that did the trick. It has stopped doing totally unpredictable things.
Very keen eyes you guys have :D

Thanks alot.
 
Top