Artificial Stupidity
Moderators: BeligerAnt, petec, administrator
-
- Posts: 1134
- Joined: Tue Jan 20, 2004 12:00 am
- Location: London
- Contact:
Artificial Stupidity
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.
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!
-
- Posts: 223
- Joined: Sat Apr 30, 2005 9:25 am
- Location: Loughborough
- Contact:
-
- Posts: 1134
- Joined: Tue Jan 20, 2004 12:00 am
- Location: London
- Contact:
- BeligerAnt
- Posts: 1872
- Joined: Wed May 15, 2002 12:00 am
- Location: Brighton
- Contact:
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!
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
-
- Posts: 1134
- Joined: Tue Jan 20, 2004 12:00 am
- Location: London
- Contact:
- peterwaller
- Posts: 3213
- Joined: Fri Feb 15, 2002 12:00 am
- Location: Aylesbury Bucks
- Contact:
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.
-
- Posts: 1134
- Joined: Tue Jan 20, 2004 12:00 am
- Location: London
- Contact:
Sorry i have miss understood Gary i think
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.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.
TEAM GEEK!
- BeligerAnt
- Posts: 1872
- Joined: Wed May 15, 2002 12:00 am
- Location: Brighton
- Contact:
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...
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
-
- Posts: 1134
- Joined: Tue Jan 20, 2004 12:00 am
- Location: London
- Contact:
-
- Posts: 1134
- Joined: Tue Jan 20, 2004 12:00 am
- Location: London
- Contact: