Robot design

Andrew Cowan

Senior Member
I am designing a robot. I will build it over the next 2 years as part of my AS/A level electronics. Although it is more complex than is needed, I like the challenge.

The basics will be a 50cm square aluminum chassis, powered by two 750W 36V motors. I will design a speed controller for these and mixer, so they can be run off signals form a radio control reciever (or from servo out from a picaxe). The speed controller will use FETs and DTDP relays to control reverse. The wheels will be 18cm diameter, and have rotary encoders on them so I can tell where they are. My calculations show the robot will travel at 25mph max. It will be 4WD and chain driven. The power supply will be three 12V 7.2Ah batteries in series. There will be a r/c controlled relay to control lights, as well - 20W headlights and LEDs.

Onboard, there will be an ultrasound sensor on a servo (so it can point in any direction). There will also be black line on white ground following facilities (three IR sensors), as well as temperature sensors (ambient and motor temperature). For outputs, there will be a piezo, and also a 433 module transmitter, transmitting all data (speed, temperature, distance etc)

This will then be recieved by a 433 module control box which will have a 4 line 20 character backlit LCD in it, which will display the data. If connected via a wire, the control box will also be able to be used for programming the speed controller (max speed set, braking on/off, braking in pulses yes/no, reverse on/off, control via r/c or via light sensors or randomly drive (but not hitting stuff due to ultrasound) etc).

The control box will also have a piezo in it.

The reson I can use this for both AS and A level is it is expandable - eg AS level could be the speed controllers and mixer and my A level project could be the added sensors and radio link.

This is all I have thought of so far - if anyone has any comments, suggestions or questions, I would be interested to here them!
 
Last edited:

Dippy

Moderator
"The wheels will be 10cm diameter, and have rotary encoders on them so I can tell where they are"
- won't they be on the end of your axles? :)

Go for it..sounds good... though I bet you start adding extras as you go along.

I was just wondering as it is a long time since I went to school; Are you set a maximum budget for these school A/AS projects? (a budget that you have to prove.)

Remember, as we all now know it's a school project don't expect people here to write code for you. .. though some will as they can't help showing off.;)
 

Andrew Cowan

Senior Member
There's no budget that I know of - the A level is systems and control, so it is just proving you can do it. If it was electronics products, then there could be a budget.

Th coding shouldn't be too hard - just lots of serins, serouts, etc. Some of the coding I see on this forum is impossibly complex. I plan to have lots of PICs so I don't have to have to code PICs doing more than one thing at once. (eg one for the ultrasound, one for each speed control, one central 'brain' etc).

I'll keep you posted with how it goes.

I think that the speed controllers will each take a servo input of 75 to 225. This means they are easy to control from a PIC (eg for the line following), although I will need to make a mixer converting the r/c signal (1 channel throttle and 1 channel steering) to two signals - one for each speed controller. Luckily I won't need to buy any r/c equipment, as I already have a digital 6 channel radio and reciever (Futaba 6EXAP) (40Mhz)

Thanks (in advance for the help I'll need),

Andrew
 
Last edited:

westaust55

Moderator
A max speed of 25mph (=41kph) seems rather high speed. At full speed in a straight line it would be 683metres (2220 feet) from you in 1 minute!. You would need to be on a bicycle to keep up with it.

Have you looked at the total power draw versus battery life. Battery capacity is not proportional to Ah rating divided by Amps. Battery rating is typically set at a C5 discharge rate or 7.2/5 = 1.44 Amps load in which case you have 7.2Ah. if you draw around 10 times this C5 current then (I do not have the exact accurate figures to hand but ) I suggest actual battery capacity to nominal “flat” state is likely to be about half.

By way of example with the 2 x 200W motors at full power and the 2 x 20W headlights on plus other loads you will be lucky to operate for 20 minutes.

If design, time and costs permit, I would recommend that you consider gearing the drive down for a lower top speed. Less demand from the motors so better battery life likely a more stable operation when turning and rapid/emergency stopping.
 

Andrew Cowan

Senior Member
I calculated a 16 min run at full speed, but as you pointed out, you would be unlikly to travel at that speed for long, so a normal 30 minute session of testing may be at full speed for 20% of the time. I would charge up the batteries in between lessons if needed.

I do plan to buy several sprockets so the gearing can be adjusted for inside/outside (inside speed limit would be 8mph). It doesn't matter to me what the top speed is, as the speed controllers are not on or off, they will use PWM to regulate the speed, so if I want the robot to travel at a walking speed, I can make it do this via the speed controller, not via the gearing. I want it to go quickly so when I am using it via radio control in the school yard, which is probably 300m diagonally, it doesn't take forever to get around. (This is meant to be a fun project to keep, not just to get a good grade).

I will use spring powered tensioners on the drive chains, so it won't take more than 5 mins or so to switch from a 24 tooth sprocket to a 8 tooth sprocket on the motor. There will be 40 tooth sprockets on the wheels.
 
Last edited:

westaust55

Moderator
Good to see that you have done some sums on battery life.

The max 8mph inside a class room may still be a bit high. Albeit max and not typical speed, that is about 2.5 to 3 time normal walking speed.

I recall back to doing an electric vehicle controller in my uni days. Due to cost limits put the controller and drive system with two 1kW DC motors (well geared down with reduction gearbox and chain/sprocket reduction) into an electric wheel chair. My lecturer (no feather weight I might add) decided to give it a "spin down the corridors of the Engineering Building. Straight to max speed without fear or trepidation was his approach.
As speed gathered and the front wheels had still not resume contact with the floor (good having drive and steering via 20 inch rear wheels), fellow students were scattering in all directions with a lecturers dissapearing into the distance emitting sounds like Whoooaaaa ;)

For some strange reason I was banned to the uni roadways for trials after that.

Anyway have fun - it sounds like a great project
 

Dippy

Moderator
"...with a lecturers dissapearing into the distance emitting sounds like Whoooaaaa"

- I reckon it may have sounded like Whoooaaa, but I bet they were really saying something a little different... or at least thinking it :)
 

higgeh

New Member
i picked up a nice trick mate which i employ on all my 3 bots

buy some cheap drills from b & q or local hardware store

cut them up

then use the batteries to power them and the motors to drive

more than you will ever need
 

Andrew Cowan

Senior Member
Andrew.
The first is in the Finished Robots Forum section.
The second is from Hippy's Website (accessed from Homepage >> Links )
I'd seen the finished robot section (kinda where I got the idea to make a robot that had every sensor I could think of on).

I hadn't ever read that far down on Hippy's site though - thanks!
 
Last edited:

Dippy

Moderator
Just some initial thoughts...

Looks pretty, power consumption too high (for my apps) and note 9600 baud rate if using normal serial.

How does the price compare to Rev-Ed's serial LCD module?
If you get Rev-Ed's module you can get experienced support here.
 

westaust55

Moderator
my elect vehicle controller had:
power circuit - chopper circuit using using two 80amp thyristor with a diode, hand made air cored inductor and two very large electro caps back to back as a bi-polar cap for each motor.
control circuit - two dircrete component multivibrators with one per chopper circuit. Using two linear pots linked to home made joystick to independantly control the mark-to-space ratio of each multivibrator for each motor control.

So in a manner, an early form of PWM before micro-controller came to the fore.
 

Andrew Cowan

Senior Member
Westaust55 - clever idea using thyristors as the control method. (Although cheaper, much more complex than a PIC and FETs.)

Just some initial thoughts...

Looks pretty, power consumption too high (for my apps) and note 9600 baud rate if using normal serial.

How does the price compare to Rev-Ed's serial LCD module?
If you get Rev-Ed's module you can get experienced support here.
The current consumtion is high because it is a large display and because it has a large backlight.

Although it is more expensive than the Rev-Ed serial LCD module (which I have used), and it has limited support, the reason I am attracted to it is that the Rev-Ed module is two lines of 16 characters, this is 4 lines of 20, and it is backlit.

I will add though, that the Rev-Ed display is wonderfully easy to use, and if I didn't want a backlight and lots of data, I would use it.

If I wanted to use serial, could I just set the baudrate at 9600 (serout 7,N9600) or would I need to overclock? I think Hippy's webpage said that if you overclock to 16mHz you have a baudrate of 9600? Is PIC-28 still the only chip that can do this?

EDIT: I've looked at the PDF of commands, and got this:

4MHz 8MHz 16MHz
T300_4 T600_8 T1200_16
T600_4 T1200_8 T2400_16
T1200_4 T2400_8 T4800_16
T2400_4 T4800_8 T9600_16
T4800_4 T9600_8 T19200_16
N300_4 N600_8 N1200_16
N600_4 N1200_8 N2400_16
N1200_4 N2400_8 N4800_16
N2400_4 N4800_8 N9600_16
N4800_4 N9600_8 N19200_16

Is that saying I can get a baud rate of 9600 using a chip overclocked to 8MHz? If so, will this work: (Note - please don't mark the code, just the idea! I know the syntax isn't correct!)

PIC in buggy turns data from sensors into serout
433 transmitter module via serout n600

Then in reciever (serin from the 433 reciever)
main:
setfreq m8
pause 500
setfreq m4
serin n600 to w1
setfreq m8
serout n9600 (w1)
goto main

Something like that?

Thanks,

Andrew
 
Last edited:

hippy

Technical Support
Staff member
Supported baud rate isn't a straight forward thing to work out. To get N9600/T9600 you need a PICAXE which can do SEROUT at N4800/T4800 and be run at 8MHz. If SEROUT N2400 isn't supported SERTXD supports N9600 ( but not T9600 wthout hardware ) at 8MHz. For the 18X that supports T9600 and higher by poking internal registers ( but not N9600 without external hardware ).
 

Andrew Cowan

Senior Member
That seems very complex. I have now come across another display - 4x20 characters with backlight and powered by 2400 baud.

UPDATE: Mycroft2152 has shown me a new site - see below.


Andrew
 
Last edited:

Mycroft2152

Senior Member
Check Wulfden for a serial LCD using PHAndersons controller for less than a third of the $59 price. Large display and everything.

Myc
 

D n T

Senior Member
motor speed calcs

your lecturer will be happy if the unit moves at just about walking speed or a little above so you might want to work out how far you walk in a given time ( say 1 minute) and then you can clculate the revolutions of you wheels ( of a known diameter) have to do to travel that fast. Once you know that, you can govern the speed to suit, either mechanically through gearing or through you programming. You can still have an override switch so you can cut loose after class. If you show all these calcs and the reasonning behind them you will be better off I think.
You might want to think about how you are going to make the machine function and the circuit design before you even look at your aluminium plate, I have seen too many students go off half cocked and waste or regret their choice.
Good luck, keep us up to date ( pictures are good) and don't forget to reference the forum in your write up.:)
 

Andrew Cowan

Senior Member
I like the idea of the override switch.

I was already planning to have different gears so you swap the setting for low speed, but a switch activated speed limiter is also a good idea.

Thanks,

Andrew
 

Andrew Cowan

Senior Member
I am going to make the PWM speed control from FETs - the ones I was looking at are these:
http://www.datasheetcatalog.org/datasheet/SGSThomsonMicroelectronics/mXytzxq.pdf
Details:
- Logic level
- 60V maximum
- 16V maxiumum on gate
- Gate threshold is 1.7V
- 55A max at 25 degrees
- 39A max at 100 degrees.

Each of my motors is 200W and 24V. This works out as 8A (call it 10A to be safe). Does that mean that one of these FETs (with a huge heatsink) could control each motor? Before I crunched the numbers, I was expecting I was going to have to use 5 or 6...

Would you reccommend 2 in parellel to be safe? Also, I couldn't find a gate current figure on that datasheet - do you think that a PIC output could power
a) One of these
b) Two of these in parallel
without a transistor or other amplifier?

Thanks,

Andrew
 

Dippy

Moderator
"Also, I couldn't find a gate current figure on that datasheet "
- Basically, there will be b-all Gate current at DC, but there is a lot of capacitance.


"- do you think that a PIC output could power..."
-This is where the capacitance issue is important. You have to get that charge in and out of the gate quick when using fast PWM. Or else the MOSFET briefly acts as a resistor = HOT!
For MOSFETS like this and for fast PWM you will need a driver as the initial/instantaneous current will be high.
So, the answer: For fast/efficient PWM + Power MOSFET then NO the PIC output is NOT adequate.

Just recently a long thread was devoted to MOSFET drivers, have a search. If my kettle wasn't boiling I'd look it up for you.
I don't really want to start another great long thread on MOSFET drivers.

MOSFETs in parallel? Why not, I'm doing just that right now. But, of course, then there will be twice the Gate charge to get rid of/put back.

And the times are so fast that that PICOscope wouldn't be any good :)
(A good driver would have gate transition times of <100nS, so borrow the money and get the cheapest Tektronix)
 

Andrew Cowan

Senior Member
-This is where the capacitance issue is important. You have to get that charge in and out of the gate quick when using fast PWM. Or else the MOSFET briefly acts as a resistor = HOT!

For MOSFETS like this and for fast PWM you will need a driver as the initial/instantaneous current will be high.
I had a look, but was unable to find the thread you refered to (searching for MOSFET, FET driver, and FET switching).

I also have googled 'logic level FET driver', but I can't find any chips available.

Surely you just need a high current output so you can charge up the capacitance of the FET quickly - can't this be achieved through a transistor? Then to remove the charge, couldn't a low value resistor (8K?) pull the gate to ground?

Sorry if I am missing the point here,

Andrew

From the datasheet:
Input Capacitance: 1700pF
Output Capacitance: 300pF
Reverse Transfer Capacitance: 105pF
Measured at: Vds=25V f=1MHz Vgs=0V
 
Last edited:

Dippy

Moderator
"Surely you just need a high current output so you can charge up the capacitance of the FET quickly - can't this be achieved through a transistor? Then to remove the charge, couldn't a low value resistor (8K?) pull the gate to ground?"

Andrew, you're not missing the point, you're just missing the amount and speed.

From your post you obv realise that a high (albeit brief) current is needed to charge up the gate - if you know that then surely you realise that a PIC is incapable of doing that quickly.

Yes, a PICAXE can switch the FET on, but it's HOW QUICKLY that matters.

And if you have a low value res from Gate to ground then a fair amount of current will be needed to drive the MOSFET.
The whole point of a driver is that it bangs in the current on a 'high' and switches off the Gate/Gnd side. Then on a 'low' it switches off the high side and virtually shorts the Gate to Gnd.
Complimentary pairs.

Hang on I'll just do a search....
 

Dippy

Moderator
There:-

http://www.picaxeforum.co.uk/showthread.php?t=8344

and

http://www.picaxeforum.co.uk/showthread.php?t=9431

If the links don't work, then search on 'complimentary' in the last month in advanced search.

Quite a few pages for you to read.

Remember, it's NOT whether or not the PICAXE can trigger the MOSFET (it can trigger a LL MOSFET happily), it's HOW FAST for efficient PWMing.

For power stuff a transistor up and low resistor down is NOT good enough. I've been there, done it and got the T-Shirt:)

The longer MOSFET spends in the resistive zone then the more I2R you'll have.

And, by the way, your "8K?" 'low value' resistor... oh dear, that ain't low. You'd need about 15 ohms or less to drive anywhere near properly.

You really need to get that Tektronix and check it out ;)

And thinking over coffee, I reckon you should parallel MOSFETs or choose a device with lower Rds..... oh dear, even more capacitance.

With those size motors you need to get this right or your solid state electronics will sublime...
 

Andrew Cowan

Senior Member
"Your "8K?" 'low value' resistor, that ain't low." I didn't want to be shouted at for proposing to use a resistor that was too low :)

"You really need to get that Tektronix and check it out." I don't know the specifications, but I'll be using school's oscilloscopes when I make this circuit.

"And thinking over coffee, I reckon you should parallel MOSFETs or choose a device with lower Rds..... Sorry, what is Rds? (Wikipedia doesn't know.)

"With those size motors you need to get this right or your solid state electronics will sublime..." An interesting image... Thanks for all of your help - without this forum I would happily have bought all my FETs, connected them up, and... watched them 'sublime' (or catch fire or something).

I read those threads, and although I now completly know what the problem is, neither had a circuit diagram of how to solve it (apart from the scan from the magazine, but I was confused by the back EMF sensor part)

Andrew

By the way, Dippy, do you know everything, or do you sometimes have to look things up?
 

Andrew Cowan

Senior Member
Attempt at an FET driver

Can you see anything wrong with this? I'm sure there is something wrong, I just don't know what it is.

The switch represents the picaxe output pin being high or low.
 

Attachments

Dippy

Moderator
Rds = Resistance drain-source. The resistance of the FET. Check out the Data Sheet you posted. Usually written R(subscript)DS, but you can't write it like that on Forum?

I wish I did know everything, including the Winning Lotto numbers.
I'm doing a lot of stuff with MOSFETs right now, so whilst it is in my cerebellum I may as well drivvel on about it.

The diagram, well a very simple comp pair, though i hope you aren't going to wire your PICAXE o/p like that.

I can't recommend that as a driver. Transistors aren't perfect and, quite honestly, it's so much easier/quicker to get a proper driver designed by people who a) know what they're doing and b) have the money/time to develop a good product.

One of those threads had a link for a working comp pair. If you want to go that route then check it out. Personally I'd just get a driver as mentioned in those threads. eg TC4432, numerous others.

All the best.
 

Andrew Cowan

Senior Member
What about the TC4426 sold by rapid. Two drivers in one package - just what I need.
http://www.rapidonline.com/Electronic-Components/Integrated-Circuits/Motor-And-Power-Drivers/MIC4426BN-Dual-1.5A-low-side-MOSFET-driver/35586

Supply voltage - +4.5V to +18V DC, 22V max.
Power supply current - 1.4mA
Input voltage - VS + 0.3V to GND &#8211; 5V max.
Peak output current - 1.5A
Latch-up protection withstand reverse current - >500mA
High output voltage VS &#8211; 0.025V
Low output voltage - 0.025V
Output resistance high state - 6&#937;
Rise time - 18ns
Fall time - 15ns
Delay time - 23ns


Andrew
 
Last edited:

Dippy

Moderator
Are you sure?
What is the MIC4426 exactly? (Compared to the MIC4427).

I'm being cryptic because I want you to think about this and how it will drive your N Channel MOSFET from PICAXE pwm.
(I'm hoping Andrew will answer this without some smarty telling the answer. It's important you get a handle on this.)
 

Andrew Cowan

Senior Member
I think what you want me to discover is that the 26 is inverting - the 27 is non inverting.

According to the functional diagram, this is the only difference - a NOT gate in the middle.

Does this mean I should either pass the signal through another NOT gate first, or can I just use the PWM backwards (so 100% duty cycle according to picaxe = 0% on the output).

Thanks for helping me on this learning curve!

Andrew

Edit: Farnell stock the 4427 - I have not used them before. Do they have a minimum order value or high postage rate?
 
Last edited:

Dippy

Moderator
Yup, nail on head.

You could invert it first or do as you say or go for P Chan.

If you are in UK you could try farnell they have loads, but be aware of minimum charge for credit cards.

If using a driver and a higher voltage supply you wouldn't need logic level anyway as you'll be nipping between Vsupply and 0V approx.

I hope you also noted the recommendations for the bypass cap. as it has to handle some pretty sharp pulses.

Anyway, I must get back to my own hot FETs now. Good luck.

PS:-
I think Farnell have min. order value of £20 (+VAT?? not sure).

A few healthy P and N channels and a couple of drivers (maybe 1 off Maxim and 1 off IR for comparison) and anything else you can think of will soon get you to 20 nicker.

Blimey, there's loads of 'em:
http://uk.farnell.com/jsp/search/browse.jsp?N=500005+1002502&Ntk=gensearch_001&Ntt=4427&Ntx=
 
Last edited:

Andrew Cowan

Senior Member
I am planning to take your advice and get 4427 from Farnell along with non logic level FETs (so I can run the gate at 12V).

I have found this one, and think it looks OK:
Info - http://uk.farnell.com/8657475/discretes/product.us0?sku=international-rectifier-irf2204pbf
Datasheet - http://www.irf.com/product-info/datasheets/data/irf2204.pdf
IRF2204
4V threshold voltage (gate)
20V max (gate)
40V maximum (drain source)
210A continuous (25 degrees)
150A continuous (100 degrees)
Rise time 140ns
Fall time 110ns

What is the maximum PWM frequency a 4MHz PIC can put out?
What is the maxiumu you would recommend with the MIC4427 driver and the IRF2204?

Thanks again,

Andrew
 

Andrew Cowan

Senior Member
I seem to remeber someone saying that 3.9KHz was the limit for a 4MHz chip?

If this is not the case, should I go with 10,000Hz, or would that be audible? Maybe 30,000Hz then?

The servo signal comes in as signal between 75 and 225 (150 neutral) when pulsin is used.

If I use a pwnout frequency of 10KHz, then the code needed is:
pwmout 2 , 99, (0 to 400)

Threrefor, I think the coding would be something like this:

Code:
Main:
pulsin 3,1,w1    'recieves servo pulse
if w1=0 then main2        'if the reciever is turned off, do turn motor off
if w1<150 then back     'if the pulse is in reverse, then go to a routine
if w1>150 then ford
w4=0
pwmout 2 ,99 ,w4
goto main

main2:
pwmout 2 ,99 ,0
low 1
goto main

back:
high 1   'activates a DPDT relay for reverse
w2=300-w1  'converts the reverse signal into the same type as the forward signal, so 150 is neutral, and 225 is fully forward.

w3=w2-150
w4=w3*533/100 'really I want 5.3 recurring
pwmout 2 ,99 ,w4
goto main

ford:   'this is the same as back, only without the reverse relay and inversion
low 1
w3=w1-150
w4=w3*533/100   'really I want 5.3 recurring
pwmout 2 ,99 ,w4
goto main
What do you think of my maths? Would it work? This is only a sample of the whole code - not all of it. Also, this is only for one motor. Is there an easier way of doing the maths?

Andrew
 
Last edited:

Dippy

Moderator
Like eclectic says... play... try the wizard.

Maximum for driver. Goodnss knows. I'm running my 4431 at 30kHz. Looks lovely on 'scope and I'm getting very good switching efficiency. I have a big fat low-z/high-ripple 50V cap right next to P-chan MOSFET Source too. I may try a higher f at some stage.

But, as far as performance goes, it varies with your layout, the bypass cap(!!), track-width, MOSFET type, wind direction.
Cruddy design=cruddy performance.
Make sure everything is big and fat and try 30kHz as a starting point.

Surprisingly I haven't tried every MOSFET ever manufactured..... this is where Mr Scope is SSSSSSOOOOOOOOOOOOOOOO useful. Get a Tektronix and you'll never need another scope.

But note: My design is for a PIC controlled SMPS. I should use a faster PWM but as you go faster (>200kHz) there is a duty resolution to consider.
If you are driving fat motors you don't want fast PWM anyway. If a bit of buzz is unimportant I'd suggest <500Hz. But try it, don't be scared :)



EDIT:-
Andrew:"I seem to remeber someone saying that 3.9KHz was the limit for a 4MHz chip?"
- WHY don't you try the Editor/Wizard???????????????????????????????????????????????????????

PS. The absolute limit for a PIC @ 4MHz is 500kHz, but with poor duty resolution.
 
Last edited:

Andrew Cowan

Senior Member
Andrew:"I seem to remeber someone saying that 3.9KHz was the limit for a 4MHz chip?"

PS. The absolute limit for a PIC @ 4MHz is 500kHz, but with poor duty resolution.
That is what was confusing me - i could make 500kHz with the wizard but my memory diagreed.

After searching, it was when in one of the MOSFET threads, it was said:

Dr A: I am having trouble following a couple of things you said. How did you drive a mosfet at 1khz with a picaxe? The pwmout command will only go as low as 3.9khz. Also, anything between the lowest picaxe frequency 3.9 khz and 20khz is definitely audible. For things like leds, you can't hear the whine, but motors and coils scream like banshees, you can even hear the whine coming from and incandescent bulb.

Anyway, that code works fine in the simulator.

Anyway, I'll can't start really working on this project until I have started my AS level course - I need to OK it with my teacher, and start documenting/designing PCBs/making multiple circuit idea/writing specifications etc. So I can't start soldering until september.

Andrew
 
Top