Artificial Stupidity

Discussions around autonomous, semi-automatic and intelligent robots and systems.

Moderators: BeligerAnt, petec, administrator

Andrew_Hibberd
Posts: 1134
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Artificial Stupidity

Post by Andrew_Hibberd »

Might as well keep the name, although there may be more than one at the next WS.

I am looking at the PICAXE 28X chip, as it has two PWM output pins so can control both motors.

Lots of inputs and outputs, so sensors all arround.

Will proberly be making my own board using strip board, as space isn't too much of an issue.

Will post any updates.
TEAM GEEK!
Adam Hargreaves
Posts: 223
Joined: Sat Apr 30, 2005 9:25 am
Location: Loughborough
Contact:

Post by Adam Hargreaves »

make sure you have a very clean supply for the PICAxe. I found it an absolute pain when i used it to A-level. Easily the most picky chip ever. And don't go any higher than 5.0V either. Apparently they die at 5.2, according to 'scientific' experiments performed by one of my mates
Team 'In Theory'
Andrew_Hibberd
Posts: 1134
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Post by Andrew_Hibberd »

Thanks Adam any help is most welcome. Am using a 5V regulator with smoothing capacitors for high and low frewencies on each side of the reg.
TEAM GEEK!
User avatar
BeligerAnt
Posts: 1872
Joined: Wed May 15, 2002 12:00 am
Location: Brighton
Contact:

Post by BeligerAnt »

Having a well-filtered, regulated supply will certainly help.
Some decoupling capacitors as close as possible to the PIC supply (and ground) pins are also a good idea.

Beware of noise from the motors getting back into the PICaxe via the PWM lines. Make sure you fit suppression caps across the motors, and maybe also a cap from each motor terminal to the motor body (and connect the motor body to 0V. You could also try a small series R (say 100R) and parallel C (say 10nF) on the PWM outputs to filter these lines. Put the C nearest the PIC.

One problem with PICs in general is that the "brownout detector" can be a bit twitchy. This circuit monitors the 5V supply and if it glitches below a certain threshold (around 4.5V I think) it will reset the chip. If there is a lot of noise getting onto the supply the brownout detector will continuously reset the PIC and your software will get nowhere!

Generally, this is a good thing to have, but it is a bit over-sensitive. I have had to disable the brownout detector in the past, then the chip has worked perfectly. There should be a setting somewhere in the PICaxe setup to disable the brownout detector.

Add as much "ground" (0V) to your board as possible. If using Veroboard, connect any unused strips to 0V. Also make each strip as short as possible - don't just let it run to the edge of the board if there are no connections there. Cut the track and connect the spare bit to 0V. Best to leave this until fairly late in the development otherwise you defeat the whole point of using Veroboard!
Gary, Team BeligerAnt
Andrew_Hibberd
Posts: 1134
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Post by Andrew_Hibberd »

Thanks Gary :) will add the decupling capacitors as well. I was going to have a capacitor over the motor terminals. Will add them going to the case as well. I will also smooth the PWM as it is proberly quite noisy, to give an anologue voltage.

Will have to buy it now to see if it works :P
TEAM GEEK!
User avatar
peterwaller
Posts: 3213
Joined: Fri Feb 15, 2002 12:00 am
Location: Aylesbury Bucks
Contact:

Post by peterwaller »

When you say smooth out the PWM to an analog voltage you cant get rid of the the switching signal or even increase the switching times too much. The whole point of PWM is to turn the FETs fully on or off otherwise there is too much power disipated in them. If you smooth a 1:1 mark to space to half voltage you will disipate half the power in the motor and half in the FET. You also greatly reduce the torque and use twice as much power from the batteries.
Andrew_Hibberd
Posts: 1134
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Post by Andrew_Hibberd »

Sorry i have miss understood Gary i think
You could also try a small series R (say 100R) and parallel C (say 10nF) on the PWM outputs to filter these lines. Put the C nearest the PIC.
I presumed this meant that the resistor is along the signal wire, and the capacitor goes to ground? Although i see now this is to remove the noise on the signal not to smooth it, thanks Pete.
TEAM GEEK!
User avatar
BeligerAnt
Posts: 1872
Joined: Wed May 15, 2002 12:00 am
Location: Brighton
Contact:

Post by BeligerAnt »

Rule 1: Never assume people know what you're talking about!

Yes, sorry I should have been clearer (but it was already a long post).

The filter I suggested should remove high-frequency noise generated by the motor, but MUST let through the (much lower frequency) PWM signal from the microcontroller to the FETs.

The suggested values give a time constant of only 1us so the filter will have no effect on the (several kHz max) PWM signal. A slightly longer filter time constant (lower cutoff freq) may be worthwhile, but the cutoff freq needs to be 10x the PWM freq to ensure the edges of the PWM waveform are not distorted too much.

Like all engineering, it's a compromise and a balancing act...
Gary, Team BeligerAnt
Andrew_Hibberd
Posts: 1134
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Post by Andrew_Hibberd »

Thanks,

I should be recieving some parts from solarbotics in the next few weeks. Will get a few more bits and pieces and see if i can get something to work on a bread board. Then will build the robot, will post any updates.
TEAM GEEK!
Andrew_Hibberd
Posts: 1134
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Post by Andrew_Hibberd »

I have been planning out my circuit board, how would i go about making one? Preferably double sided, however i have no problems if single sided is cheaper.

Thanks in advance :)
TEAM GEEK!
Post Reply