Artificial Stupidity

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

Moderators: petec, administrator, BeligerAnt

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

Artificial Stupidity

Postby Andrew_Hibberd » Thu Jul 06, 2006 2:03 pm

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:

Postby Adam Hargreaves » Thu Jul 06, 2006 6:48 pm

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: 1287
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Postby Andrew_Hibberd » Thu Jul 06, 2006 7:02 pm

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: 2437
Joined: Wed May 15, 2002 12:00 am
Location: Brighton
Contact:

Postby BeligerAnt » Thu Jul 06, 2006 8:16 pm

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: 1287
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Postby Andrew_Hibberd » Thu Jul 06, 2006 8:51 pm

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: 3493
Joined: Fri Feb 15, 2002 12:00 am
Location: Aylesbury Bucks
Contact:

Postby peterwaller » Thu Jul 06, 2006 9:20 pm

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: 1287
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Postby Andrew_Hibberd » Thu Jul 06, 2006 9:36 pm

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: 2437
Joined: Wed May 15, 2002 12:00 am
Location: Brighton
Contact:

Postby BeligerAnt » Fri Jul 07, 2006 7:48 pm

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: 1287
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Postby Andrew_Hibberd » Sat Jul 08, 2006 10:55 pm

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: 1287
Joined: Tue Jan 20, 2004 12:00 am
Location: London
Contact:

Postby Andrew_Hibberd » Sat Jul 22, 2006 10:48 pm

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!

User avatar
BeligerAnt
Posts: 2437
Joined: Wed May 15, 2002 12:00 am
Location: Brighton
Contact:

Postby BeligerAnt » Sun Jul 23, 2006 6:36 pm

You have 2 choices: DIY or pay someone to do it for you!

For the DIY method, you will need some PCB design S/W (free), access to a laser printer or photocopier, some "Press'n'Peel" film from Maplin (?15) or another method of transferring the toner (glossy photo paper, ohp film - search the web for various suggestions), some ferric chloride to do the etching, some plastic trays/dishes/tanks to do the etching in, and some old clothes because ferric chloride stains everything.

You can just use a permanent pen to draw the tracks onto the board, but this method only really works for large through-hole parts. It's certainly no good for surface-mount parts on a 0.5mm pitch!
You can also use a UV-sensitive solder resist and a light box with a track pattern printed onto OHP film, but this requires a UV light box. I think Peter Waller uses this method.

You also need some copper-clad board from Maplin, Farnell etc. Single-sided boards are dead easy to make, double sided gets a bit tricky ensuring correct registration of the two layers. I tend to use one side as a ground plane and the other side for tracks. Anything that's too difficult to route I use wire links.

I use the Press'n'Peel method which has worked very well for me for quite a while now.

You can now buy small quantities of prototype PCBs quite cheaply from a variety of suppliers. Try www.pcb-pool.com, www.pcbexpress.com, or www.pcb-train.com
I've not tried any of them, but I think Chris has used one for his SmartAnt boards. Costs are around ?30 for a 100x100mm or 160x100mm board. Some companies will let you fit multiple boards into their standard size, so if your board is only 50x50mm you will get 4 or 6 for the standard ?30 charge. Read the T & C's closely!
Gary, Team BeligerAnt

slurp
Posts: 68
Joined: Sun Jun 25, 2006 8:47 pm
Location: Yorkshire
Contact:

Postby slurp » Sun Jul 23, 2006 7:51 pm

BeligerAnt wrote:For the DIY method, you will need some PCB design S/W (free), access to a laser printer or photocopier, some "Press'n'Peel" film from Maplin (?15) or another method of transferring the toner (glossy photo paper, ohp film - search the web for various suggestions)


I use the waxed backing paper from a label sheet... you don't have the problem of soaking the paper off.

Press evenly over the back of the sheet and let it cool before peeling

Don't try to put the sheet thru the printer more than once, it's likely to crumple. Better to print all your masks in one go...

best regards,
colin

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

Postby Andrew_Hibberd » Mon Jul 24, 2006 10:50 pm

Thanks for the advice, i will look into this more. I have been using the eagle software, the trail version allows the design of two sided boards. I have planned it out to use double sided, but i have also planned one using strip board as it won't require etching. However i will look at making a single side board and have a few linking wires as this will be more space efficant than the strip board and will be easier to make than the double sided ones.

I am curious about the waxed backing paper, is this just the stuff left over on the back of stickers? If so would be cheaper than the press and peel film.

Thanks again
TEAM GEEK!

slurp
Posts: 68
Joined: Sun Jun 25, 2006 8:47 pm
Location: Yorkshire
Contact:

Postby slurp » Mon Jul 24, 2006 11:16 pm

Andrew_Hibberd wrote:I am curious about the waxed backing paper, is this just the stuff left over on the back of stickers? If so would be cheaper than the press and peel film.


that's the stuff... just take you time and don't rush it :D

once pressed it's also worth rubbing the surface lightly to see what has not taken to the surface but a little care and you should be ok

there's a couple of picture here

regards,
colin

User avatar
BeligerAnt
Posts: 2437
Joined: Wed May 15, 2002 12:00 am
Location: Brighton
Contact:

Postby BeligerAnt » Tue Jul 25, 2006 8:50 pm

Some layout tips for home-etched boards:

1) Be conservative! Most CAD programs are aimed at commercial PCB manufacturing. They default to 0.012" (0.3mm) or less tracks and gaps. Whilst it is possible to achieve 0.012" at home, 0.020" is so much easier! Make life easy by using the biggest tracks and gaps you can. If you can get away with 0.1" pitch through-hole parts and 0.050" tracks and gaps it will be a breeze.

2) Beef up the pads! Again CAD programs assume some small drill sizes and often minimal pads. Small drills break very easily (so work out expensive) and small pads require very accurate drilling to avoid the drill breaking out the side of the pad. Oval pads can help if you need to get a track between 2 pads.

3) Especially beef up your vias! It's OK to use a 0.3mm hole and 0.5mm pad on a professional board, but for home building, stick to a sensible drill size (at least 0.8mm) and a decent pad (2mm is comfortable).

4) If your CAD program can do it, put a 0.020" (0.5mm) drill hole in the middle of each pad, and make sure it appears as a hole in the copper on the final print output. You will then have a centre help with the driling.

5) Use one side as a power and/or ground plane. It really reduces the number of connections you have to route on the signal layer, and gets rid of the longest net(s). If you use the plane for power and ground, use the CAD program to route both with no links. Then work out a route between the tracks to cut the copper into 2 areas. You don't need to etch the plane side, just cut along your route with a craft knife (Best done after drilling as the holes act as a guide).

5a) For through-hole, put the tracks on the bottom and the plane on the top. Components that connect to the plane can simply be soldered on the top side.

5b) For surface-mount the tracks need to be on the top and the plane on the bottom. You will need to make some via holes (use wire links) to connect to the plane.

5c) For a mixture of through-hole and surface-mount, put through-hole on one side and surface mount on the other. I usually put SMT on the top as that's what I use most of. Make sure you "mirror" the components correctly when putting them on the bottom side.

6) If using a power/ground plane, don't forget to mask the plane side when etching the signal side! Ordinary masking tape works fine, make sure it is well stuck down and overlap any joints carefully.

7) Put some text on each layer, even if it's outside of the board outline. This way you can easily tell whether you've got the design round the right way! Don't forget text on the bottom layer appears reversed in the CAD program!

8) If using any of the "iron-on" methods, don't forget the pattern needs to be printed out in reverse. The text comes in handy here. If you are doing the bottom side of a board, you need to print it "straight" from the CAD program as it is already designed in "reverse" :o

9) Add some dimension lines to your design. You can then measure them to check that you really have printed out at 1:1.

10) Make sure you use at least a 600dpi laser printer, the old 300dpi ones are no good for fine PCB tracks. Even with 600dpi, don't attempt anything below 0.003" as it might not even print properly.

11) Don't use an inkjet printer, it won't work! :(

That's all I can think of for now, might stop you falling into some of the holes I had to dig myself out of...

(Colin, feel free to rip this for a "how-to" for your site :) )
Gary, Team BeligerAnt


Return to “Autonomous and Intelligent Systems”

Who is online

Users browsing this forum: No registered users and 1 guest