Speed Controllers

19

description

Speed Controllers

Transcript of Speed Controllers

Page 1: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 1/19

 

Speed Controllers

V3.03 5-Oct-2005

1. Introduction

T he p urpose of a m otor speed controller is to take a signal represe nting the dem anded speed, an d to drive a m otor at th at speed. T he con troller

m ayor m ay not actually m easure the speed of the m otor. If it does, it is called a Feedback Speed C ontroller or C losed L oop Sp eed C ontro ller,

i f no t it is ca lled an O pen L oop Speed C ontroller. Feedbac k spe ed con trol is be tter, but m ore com plic ated, an d m ay not be required fur a sim ple

r ob ot d es ig n.

M oto rs com e in a v ariety of'fonrs, a nd the speed co ntroller's m otor driv e output w ill be diffe rent depen dent o n the se funns. T he speed co ntroller

pre sented here is design ed to drive a sim ple cheap starter m otor from a car, w hich can be purchased from an y scrap yard. T hese m otors are

g en er ally se rie s w ou nd , w hic h m ea ns to re ve rse th em , th ey rrru st b e a he re d slig htly , (se e th e se ctio n o n m oto rs ).

B elo w is a sim ple block diagram of the spe ed c ontroller. W e'll go through the im portant parts block by block in detail.

Field coil

Batteri

I over-cu rrent I ~mI detection I I1s MOSFET bridge circuit

---~

,PWM pulse

armature

,__,__

generator and-,MOSFET driver

~

I

2. Theory of DC motor speed control

The speed ofa D C m otor is d irectly proportional to the supplyvohage, so ifw e reduce the supplyvohage from 12 V olts to 6 V olts, the m otor

w ill run at half the speed. H ow can this be achieved w hen the battery is fixed at 12 V ohs?

T he speed con troller w orks by varying the average voltage sen t to th e m otor. Itc ou ld d o this by sim ply adju sting th e vo hage sen t to the m otor,

bu t this is quite inefficient to d o. A b etter w ay is to sw itch th e m otor's sup ply on and o ff ve ry q ui ck ly . I f th e s wi tc hi ng is fa st e no ug h, th e m oto r

d oe sn 't n ot ic e it, it o nly n oti ce s th e a ve ra ge effect,

When you watch a f ihn in the cinem a, or the television, w hat you are actually seeing is a series o f fixed pictures, w hich chan ge ra pidly e nough that

your eyes just see the average effect - m ovem ent. Y our brain f i l l s in the g aps to give an average effect,

N ow imagine a l ight bulb with a sw itch. W hen you close the sw itch, the bulb goes on an d is at full brightness, say 100 W atts. W hen you open the

switch it goes off(O W atts). N ow if y ou close the sw itch fur a fraction ofa second, then open it fur the sam e am ount of time, t he f il am ent won' t

have time to cool dow n an d h ea t u p, an d you w illjust get an average glow of 50 W atts. This i s h ow l amp d im rr er s w or k, an d th e s am e p ri nc ip le

is used by speed controllers to drive a m otor. W hen the sw itch is closed, the m otor sees 12 V olts, and w hen it i s o pe n it sees 0 Vohs. If the

switch is open fur the same amount of time as it is closed, the m otor w ill see an average of6 V olts, an d w ill r un m or e s lo w ly a cc or di ng ly .

As the amount of time that the vohage is on i nc re as es c omp ar ed with the am ount of time that it is off, the av erage sp eed of the m otor increases.

This on-off sw itching is perfunned by p ow er M OSFE Ts. A M OS FE T (M etal-O xide-Sem iconductor Field E ffect T ra nsistor) is a d evice that c an

turn v ery large currents on and off unde r the control of a low signal level vohage . For m ore de tailed in furm ation, see the dedicated chapter on

MOSFETs)

Th e time that it takes a motor to speed up an d slow dow n und er sw itch ing conditions is dep endant on the inertia of the rotor (basica lly ho w heavy

it is), an d h ow m uc h fric tio n an d lo ad to rq ue th ere is . The graph below shows the speed of a motor that is being turned on an d o ff m i rl y s low ly :

Page 2: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 2/19

 

50

15 ... . ,1 lc

10 >>.

" E . ."'->.

5 'fl

200

Time

1- Motor speed - Sup p ly voltage 1

Y ou can see that the average speed is around 150, ahhough it varies quite a bit. If the supply vohage is switched fast enough, it w on't have tim e

to c ha nge sp eed IIlI.IC h,a nd th e sp ee d will b e q ui te ste ad y. This is the principle of switch mode speed controL Thus the speed is set by PW M -

Pu ls e W i dt h Modu la ti on

2.1. Inductors

B efore w e go o n to d isc uss th e c irc uits, w e rrru st first le arn so me th in g a bou t th e a ction o f in du ctive lo ad s, a nd in du cto rs. Ind uc to rs d o no t a llo w

th e c urre nt flow in g th ro ugh th em to c ha ng e instantly (in the sam e way capacitors do not allow the vohage across them to change instantly). Th e

vohage dropped across an inductor carrying a current i is g iv en b y th e eq ua tio n

div=L-

dt

where di/dt is the rate of change of the current. If the current is suddenly changed by opening a sw itch, or turning a tra nsistor o ff th e in duc to r will

g en era te a v ery high v olta ge a cro ss it. F or ex am ple , turning off 100 Am ps in 1 microsecond through a 100 m icroH enry inductor generates 10kV !

2.2. PWM frequency

T he :frequency of the resulting PWM signal is dependant on the :frequency of the ram p w aveform W hat frequency do w e w ant? This is not a

simple question Some pros and cons are:

• Frequencies betw een 20Hz and 18kH z m ay produce audible scream ing from the speed controller and m otors - this may be an added

a ttr ac ti on f ur y ou r r ob ot!

• R F interference em itted by the circuit will be w orse the higher the sw itching frequency is.

• Each sw itching on and off of the speed controller M OSFETs results in a little p ow er lo ss. T he re fo re th e g re ate r th e tim e sp ent sw itc hin g

compared with the static on and off tim es, the greater will b e th e r es ulti ng 's wi tc hi ng lo ss' in th e MOSF ET s.

• T he higher the sw itching frequency, the m ore stable is the current w aveform in the m otors. This waveform will b e a sp ik y sw itc hin g

w av efo rm a t lo w :fre qu enc ie s, bu t at high freq ue nc ies th e in du cta nc e o f th e m oto r will smooth this out to an average D C current level

proportional to the PWM dem and. This spikyness will cause greater pow er loss in the resistances of the w ires, M OSFETs, and m otor

windings than a ste ad y D C c urre nt w av efo rm ,

This third point can be seen from the fullow ing tw o graphs. O ne show s the w orst case on-off current waveform , the other the best case steady

DC c ur re nt w av ef urm:

Page 3: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 3/19

 

time

current

I

21 -

Both wav ef orms h av e t he s am e a ve ra ge c ur re nt . H owev er , w he n we wor k o ut t he p ower d is si pa ti on i n t he s tr ay r es is ta nc es i n o u r mo to r a nd

s pe ed c on tr oll er , f ur t he DC c as e:

a nd f ur th e swi tc hi ng c as e, t he a ve ra ge p ower i s

(2IiR 0" R

p=---+--2 2

S o i n t he swi tc hi ng wav ef orm , tw ic e a s mu ch p ower i s l os t i n t he s tr ay r es is ta nc es . In p rac ti ce the cu rren t waveform will n ot b e sq ua re w av e li ke

this, but i t a lway s r ema in s true tha t there will b e m ore p ow er lo ss in a n on - DC w av efo rm

Choosing a frequency based on motor characteristics

One w ay to ch oo se a su ita ble fre qu en cy i s t o sa y, fu r e xam ple , th at w e w an t th e c urre nt w av efo rm to be stab le to within 'p ' p erc en t. T hen w e

c an wo rk out ma th ema ti ca ll y t he minirrrum f requency to a ttain this goal This s ec ti on i s a b it m at hema ti ca l s o y ou may w is h t o m is s i t o u t a nd j us t

u se the f ina lequa tion

The f ol lowi ng s hows th e e qu iv ale nt c irc ui t o f t he mot or , a nd th e c ur re nt w av efo rm a s t he PWM s ig na l sw itc he s o n a nd o ff This s hows the wo rs t

c as e, a t 5 0: 50 PWM ra ti o, a nd t he c ur re nt r is e i s s hown f ur a s ta ti on ar y o r s ta lle d mot or , w hi ch i s a ls o wor st c as e.

L

I PmJsignal I I I I I

~'~~, i

~ I I I . . :I T = l/f I

T i s t he sw it ch in g p er io d, wh ic h i s t he r ec ip ro ca l o f t he sw it ch in g f re qu en cy . J us t taking th e fulling edg e o f t he c ur re nt wave fo rm , this is given by

the equa tion

Page 4: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 4/19

 

, ,R

j = le = ; = Ie -Y

't is the time c on sta nt o f th e c irc uit, w hic h is LIR

So the current at time t =T/2 (i1) m ust be no less than P% low er than at t =0 (io). This m eans there is a 1imiting condit ion:

So :

TR

Ie -if = (1- "!'_)Ieo

100

-~ PeH=(1--)

100

- TR = In(1- ..!._ )

2L 100

T= -2L·1n(1_..!._)

R 100

Sine e t h efre qu en ey j = Y r

Rj =-------=-

p- 2L ·In(l- -10-0)

L et's try som e values in this to see w hat frequencies w e get. A Ford Fiesta starter m otor has the fol lowing a pp ro x im a te p ar am e te rs :

R=0.04Q

L =701JlI

W e m ust also inclu de in th e resistance the on-resistance of the M OSFETs being used, say 2 x 10mn, giving a to ta l re sista nc e o fR =0.06 Q.

Percentage frequency

1 42 kHz

5 8.2 kHz

10 4 kHz

20 1900 Hz

50 610 Hz

A graph can be drawn fu r this pa rt icu la r mo to r :

Page 5: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 5/19

 

25000

'N

~ 20000> -uc

15000>

: : : : l

0"G >

. t : :10000

01C

: . c5 0 0 0+.; :

(f)

0

Minimum Switching Frequency

(Ford Fiesta Starter)

\<

o 20 40 60 80 10 0

Allowable ripple ("10)

Looking at the above graph, a reasonably low ripple can be achieved w ith a sw itching frequency of as l ittle a s 5 kH z.

U nfo rtu na te ly , m oto r m an ufa ctu re rs ra re ly p ub lish v alu es o f c oil in du cta nc e in th eir d ata sh ee ts, so th e o nly w ay to fin d o ut is to m ea su re it. This

requires sensitive LC R bridge test equipm ent w hich is rather expensive to buy. H ow ever, from the 4Q D site, they quote the Lynch m otor w ith an

induc tance of39!JlI as bein g one of the lo west.

3. Speed control circuits

We will start offw ith a very sim ple circu it (see th e figu re below ). T he inductance of the field w indings an d the arm ature w in dings have been

h Im pe d to ge th er a nd c alle d L a . T he re sista nc e o f th e windings and brush es is not im portan t to this discussion, and so has not been drawn.

Q 1 is the M OSFET. W hen Q 1 is on , current flow s through the field and annature w ind ings, and the m otor rotates. W hen Q 1 is turned off, the

c urre nt th ro ug h a n in du cto r c an no t im m ed ia te ly tu rn 0fI; a nd so th e in du cto r v olta ge d riv es a d im in ish in g c urre nt in th e sa me d ire ctio n, w hi ch will

now flow through the arm ature, and back through D l as show n by the red arrow in the figure below . lfD l w asn't in place, a very large voltage

w ould build up across Q 1 and blow it up .

Itm ay help to in troduce som e term inology here. T he M otor D river T erm inolo gy page defines som e term s.

4. Regeneration

In this circuit, energy can flow only one w ay, from the battery to the m otor. W hen the speed dem and of the m otor drops suddenly , the

m om entum of the robot will d rive the m otor forw ards, and the m oto r will a ct a s a g en era to r. In t he c ir cu it a bo v e, this p ow er c an no t g o a ny wh ere .

Although this i sn 't a p ro blem, it i s d es ir ab le th at this power be put back in to t he ba tt ery . This is caned regenerativ e braking a nd ne eds som e extra

c om p on en ts . T he f ullo wi ng c ir cu it a llo ws r eg en er ati ve b ra ki ng :

Page 6: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 6/19

 

Inthis circuit, Q 1 and D 1 perform the sam e fim ction as in the previous circuit. Q 2 is turned on in antiphase to Q 1. This means that w hen Q 1 is

on, Q2 is off and when Q 1 is off Q2 is on.

Inthis c irc ui t, w he n th e ro bo t is slo win g d ow n, Q 1 is off and the m otor is acting as a generator. The current can flow backw ards (because the

m otor is generating) through Q 2 w hich is turned on. W hen Q 2 turns of f this c urre nt is m ain ta in ed b y th e in du cta nc e, a nd c urre nt will f lo w u p

through D 2 and back into the battery . A graph of m otor current as the m otor is slow ing dow n is show n below :

Conduc t i ng

dev ice

If you are driving starter m otors, or any type of series-field m otor, regeneration is harder to m ake w ork. For a m otor to w ork as a generator, it

m ust have a m agn etic field, generate d by the field coil. Ina se rie s m oto r this i s i n s er ie s with the arm atu re coil, so to generate a voltage, a suitable

c urre nt m ust b e flo win g. T he c ur re nt th at will flow de pends on the load, w hich during regeneration is the battery, so it depends on how much the

battery is charged up - how m uch cu rrent th e ba ttery will draw in to it. A lte rn ativ ely , a d mnmy re sistiv e lo ad c an b e sw itc he d in a t th e a pp ro ria te

time, bu t this is all a 1 i t t 1 e to o c om plic ate d fu r a ro bo t!

5. Reversing

To reverse a D C m otor, the supply voltage to the arm ature m ust be reversed, or the m agnetic field m ust be reversed . In a series m otor, the

m agnetic field is supplied fro m the supply voltage, so w hen that is reversed, so is the field, therefure the m oto r w ou ld c ontinue in the sam e

direction. W e m ust sw itch either the field w inding's supply , or the arm atu re w indin g's supp ly, but not both.

O ne m ethod is to sw itch the field coil using relays:

Page 7: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 7/19

 

W hen the rela ys are in th e p os iti on s hown , c ur re nt will flo w v ertic ally u pw ard s th ro ug h th e fi eld c oil. T o re ve rse th e m oto r th e re la ys a re sw itc he d

o ve r. T he n th e c urre nt will b e f lo win g v ertic ally d ow nw ard s th ro ug h th e fie ld c oil, and t he mo to r will go in reverse.

H ow ever, w hen the re lays open to reverse the dire ction, the inductance of the m otor g enerates a ve ry high v ol ta ge wh ic h will spark a cross the

rela y contac t, dam aging the re lay. R elay s w hich c an take very high c ur re nts a re a ls o q ui te e xp en si ve . T he re fo re th is is not a very good sohrtion. A

b et te r s ol ut io n is to use w hat is tenned afull-bridge c ir cu it a ro un d e ith er th e f ie ld winding, or the annatu re w in ding. W e will pu t it a ro un d th e

a nn at ur e w in di ng and le av e th e f ie ld w in di ng in series.

6. The full bridge circuit

A full b ri dg e c ir cu it is shown in th e diagram below . E ach side of the m otor c an be c onnected either to battery p ositive, or to battery negative.

Note that only one MOSFET on each side of the motor must be turned on at any on e t ime o th er wi se th ey will s ho rt o ut th e b atte ry and b ur n o ut!

Field windings

To make the motor go forwards, Q4 is turned on, and Q 1 has the PW M signal applied to it. T he c urre nt p ath is shown in th e d ia gra m b e1 0w in

red . N ote that there is a lso a d io de e c on ne cte d in re ve rse a cro ss th e fie ld w in ding . T his is to ta ke th e c urre nt in th e f ie ld w in di ng w he n all four

MOSFETs in the bridge are turned off

Q4 is kept on so when the PWM signal is off cu rrent can c ontinue to flo w around the bottom 100p through Q 3's instrinsic diode:

To make the motor go backwards, Q3 is tu rn ed o n, and Q2 has the PW M signal applied to it:

Page 8: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 8/19

 

Q 3 is kept on so w hen the PW M signal is oft; current can continue to flow around the bottom loop through Q 4's intrinsic diode:

For regeneration, w hen the m otor is going backw ards fur exam ple, the m otor (w hich is now acting as a generator) is furcing current right through

its arm ature, through Q 2's diode, through the battery (thereby charging it up) and back through Q 3's diode:

6.1. Reducing the heat in the MOSFETs

W hen the M OSFETs in the diagram s above are on and current is flow ing through them in a top- to-bottom direction, they have a very low

resistance and a re d is si pa ti ng h ar dl y any heat at all. H ow ever, w hen the current is flow ing bottom -to-top through the intrinsic diodes, there is a

fixed voltage across them - the voltage drop of a diode, about 0.8 volts, This causes quite a large pow er dissipation (volts x am ps). A feature of

M O SFETs is that they will conduct current from source to drain as wen as drain to source, as long as the V g s is greater than 1 0- 12 v olts .

Therefore, ifthe M OSFET s that are carrying reversed current through their diodes are turned on, then they will dissipate a lot less heat. T he heat

will b e d issip ate d in th e w ires and t he mo to r i ts elf i ns te ad . This ex tra sw itc hin g is p erfu rm ed b y th e 1 D3 40 full b ri dg e d ri ve r.

7. Generating PWM signals

The PW M signals can be generated in a number of ways. Itis possible that your radio receiver already picks up a PW M waveform from the

h an dest tran sm itter. If th ere is a m ic ro c on trolle r o n th e rob ot, this m ay be able to generate the w aveform , although ifyou have m ore than a c ou pl e

Page 9: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 9/19

 

o f mo to rs , this m ay be too m uch of a load on the m icrocontroller's resources. Several m ethods are described below.

7.1. Analogue electronics

The PW M signal is generated by com paring a tr iangular w av e s ig na l with a D C signaL The DC signal can range between the minirrrum an d

max imum v oh ag es of th e tr ia ng le w av e.

PWM

Triangle wave

generator

DC level

PWM out

W hen the tr iangle w av efo rm v olta ge i s g re ate r than the D C le ve l, the output of the op-am p sw ings high, and w hen it is low er, the output sw ings

lo w. F ro m the graph it can be seen that ifthe D C level w ent higher, the pulses w ould get even thirm er.

An e xamp le c irc ui t f ur this i s sh ow n b elo w. This uses a counter an d w eig hte d re sistor la dd er to ge ne rate the tri ang le w av e (in fact it will generate

a saw tooth, but you'll still get a P WM signal at the end of it). The actual resistor values w hich are unavailable (40k, 80k) can be m ade up with

20k resistors, or close approxim ations can be used, w hich m ay distort the saw to oth so me wha t, b ut this s ho uld n't m atte r to o m uc h.

tW

T

+ 1 2 > <

T

10 k 10k

- 1 2 > <

DCI.""I

The 7 4H C 14 is a S clnnitt input inverter, w hich is connected to act as a sim ple oscillator. The frequency of oscillation is roughly

f= 1/(2.PI.RC)

but it doesn't m atter a great deal within a fe w te ns o f pe rce nt. This square w ave generated feeds the 7 4 H C 163 binary 4- b it counter. A ll the

preset and clear inputs of this a re d isa ble d, so the ou tpu ts, QA to Qn just roll around the binary sequence 0000 to 1111 and rollover to 0000

again. These outputs, which sw ing from Ov t o +5v are fed in to a binary w eighted sum ter am plifier, the lefim ost LM 324 opam p section with the

80k, 40k, 20k and 10k resistors. The output voltage of this a mp li fie r d ep en ds o n the counter count value and is show n in the table below as

A mp 1 output. The opam p fullow ing this just m uh ip1 ie s th e v olta ge by - Y,, to m ake the voltage positive, and bring it back within l og i c v o lt ag e

levels, see the A mp2 output colunm in t he t ab le .

Counter value I I Binary value I I Amp! output I I Amp2 output I(Volts) (Volts)

I0 I I 0000 I I 0 I I 0 I

I 1 I I 0001 I I -0.625 I I 0.3125 II I I I I I I I

Page 10: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 10/19

 

2 0 0 1 1 1 US 9.62S3 O O l l -1.875 0.9375

4 O l O O -2.5 1.25

5 0101 -3.125 1.5625

6 O l l O -3.75 1.875

7 O l l l -4.375 2.1875

8 1000 -5 2.5

9 1001 -5.625 2.8125

10 1010 -6.25 3.125

II l O l l -6.875 3.4375

12 l l O O -7.5 3.75

13 l l O l -8.125 4.0625

14 l l l O -8.75 4.375

15 I l l l -9.375 4.6875

Th e final, rig htm ost, o pa mp c om pa re s th e v olta ge with th e d em an d v olta ge input, w hich ranges from O v to 4.687 5v, w here O v represents 0%

PW M ratio and 4.6875vrepresents 100% PW M ratio. This dem and voltage m ay range from-12vto +12vbut only the 0 to 4.6875 range will

adjust the PWM ra tio.

7.2. PWM generator chips

There are IC s availab le w hich convert a D C level in to a PW M output. M any of these are designed fur use in sw itch m ode pow er supplies.

E xam ples tha t could be used are:

IManufacturer l1 I eII

Nonnal useI

IS GS T hom so n IISG 1524,SG 152 5 ... 11 SMPSI

IMaxim

IIMAX038

IIS ignal generat ion

I

A lternatively, a M OSFE T driver w hich includes a PW M generator can be used. I know of only one w hich is n ot y et r el ea se d ! Th e SG S

T hom so n TD34 0.

7.3. Digital method

T he d ig ita l m eth od in vo lv es in cre me ntio g a c ou nte r, a nd c om pa rin g th e c ou nte r v alu e with a p re -lo ad ed re gis te r v alu e. It is b a si ca ll y a d ig it al

v er sio n o f th e a na lo gu e m eth od a bo ve :

clock

leve l

mD lP .m.?tQ[

74HC85

T he r eg iste r m us t b e lo ad ed with th e re qu ire d PWM le ve l b y a m ic ro co ntro lle r. Itmay be replaced by a simple A DC ifth e le ve l m us t b econtrolled by a n analogue signal (as it w ould from a radio control servo). This method is on ly real ly p rac ti cal ifa microcont ro l ler is being used in

yo ur ro bot, w hich can preloa d the register easily.

7.4. Onboard microcontroller

If you bave chosen to use an onboard m icrocontro ller, then as part of your selection process, include w hether it b as PW M outputs. Ifit bas this

can g reatly sim plifY t he process o f generating signa ls. T he H itachi H 8S series bas u p to 16 PWM outpu ts available, but m any other types bav e

tw o or thre e.

Page 11: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 11/19

 

8. Interfacing to the high power electronics

T here are tw o sid es to the electron ics: the low -p ow er side, and the high-pow er side. T he low po wer e lectronics inc ludes any onbo ard

m icrocontroller, the radio control receiver, and PWM generators. T he hig h-pow er side includ es the M OSFE T drivers, the M OSFE Ts

the meselves, an d any solen oid or pm np drivers th at you m ay have. B asically anything t ha t i s sw it ch in g l ar ge c u rr en ts .

T he low -pow er electronic de vices m ay be qu ite se nsitive to no ise spikes on the pow er rails, an d m ay rm 1functio n or even be destroye d. Itis a

good idea to iso late th e low -pow er ele ctronics from the high-po wer electronics using w hat is know n as opto-isolators or opto-couplers, tw onam es fur the sam e thing! For m ore inform ation about these, there is a chapte r on it here

9. Interfacing to the radio control receiver

Many r ob ot ee rs will be using com mercial radio control sets. T he receive rs of these genera lly connect to servos, w hich respond to the radio signa l

(w hich m ay also be PWM ):

radio receiver H servo H potentiometer

You may be able to tap into the PW M signal which com es out of the radio receiver before it goes into the servo, and use this to drive th e in pu t tothe M O S FE T driver. H ow ever, this giv es you no choice of sw itching fre quency. A hern atively, the potentiom eter can gene rate a voltage to reed

into th e PWM g en era to r.

If you are unsure about your servos, or w ant to m odny them , there is an introduction to them on the Seattle R obotics Society page here.

A m ore advanced m ethod ifyou have a m icrocontro ller on board the robot is to take the PW M signal from the radio receiver and connect it t o a

tim er input of the m icro. T he m icroc ontroller should be able to de code this w av efo rm a nd g en era te a p ro po rtio na l analogue o ut pu t v al ue (ifi t h a s

ADCs, or if an exte rnal A DC is fitted). A nother ev en m ore advanced m etho d is to send se rial co mrm mications data through the radio cha nnel

T he r ad io c on tro l h an ds et will n ee d to h av e a m ic ro co ntr ol le r in . T he m icroco ntroller should rea d the p ots and sw itches on the hand set, and send

suitable com mands o ut of its D AR T. This conn ects to th e rad io tra nsm itter. A t the receiv er, the dem odulated ou tput is sent to the robo t's

m icrocontroller's D AR T, and the data is decoded. T he re is a w hole chapter on using em bed ded m icro controllers in a robot here

10. Current limiting

Current l imit ing is absolutely essential If the m otor is stalled, it can ta ke huge curre nts w hich w ould destro y th e M OSFE Ts very qu ickly. T he

form o f c ur re nt l imit ing p resented here is to m easure the current that the m otor is ta king, and if it is a bo ve a p re se t th re sh old , turn th e MOSF ET s

in the bridge off If you have a m icrocontroller on board w hich generates the PW M ratio, it w ould be an advantage if th e so ftw are c ou ld d ete ct

the over- current status, and reduce the PW M ratio by, say, 10% .

A c ir cu it to p er fo rm this f un cti on i s s hown b elo w.

Page 12: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 12/19

 

R IO

Rio100.

sense

480.

luF

U29

013

This c ir cu it s hows j us t th e u pp er MOSFET s o f t he b ri dg e b ei ng d ri ve n f ur s impl ic ity . T he l ow er MOSFET s a re n ot t ur ne d o ff d ur in g a c ur re nt

limit. Ther e i s o nly one s en se r es is to r r eq ui re d f ur e ac h mo to r, a nd t ha t s hould b e conne ct ed immed ia te ly f rom the b at te ry pos it iv e t erm in al

Circuit description

The v ol ta ge d ro pp ed a cr os s th e s en se r es is to r i s amp li fi ed b y U IA , whi ch i s c on ne ct ed i n a differential amplifier c ir cu it . Th e g ai n o f this is

480k / lk w hich is 480. This i s a v er y la rg e g ai n b e ca us e t he v ol ta ge d ro pp ed a cr os s th e s en se r es is to r will b e v er y sma ll. T he o ut pu t o f th e

d i ff i :r ent ia lampl if ie r i s then heav i ly low pass f il te red by RxCx . This i s b ec au se t he re will b e a lo t o f no ise c om in g fro m the m oto r, and we do not

w an t t o limit t he c ur re nt i fw e d on 't n ee d t o. D 1 3 i s p re se nt t o m ak e s ur e t ha t n o n eg at iv e s pi ke s c an a ff ec t th e f ol lowi ng c ir cu it ry . U 2B c omp ar es

t he f il te re d s ig na lw i th a p re se t v al ue ( re pr es en te d h er e by V5 ), and i f t h e c ur re nt i s t oo high (i,e, t he s ig na l i s g re at er t ha n V5) , U 2B will turn Q Iand Q2 o n w hic h clam ps the PWM sig na ls fro m the PWM g en era to r. This will force the MOS FE T driver to turn the MOS FE T off Q 1 m ust be

re pea te d fo ur ti me s, o ne fu r e ac h o f t he MOSF ET d riv er ch ann els , b ut all fo ur tran si sto rs ca n b e d ri ven fro m U 2B . D ll, R 14 and C 4 m ake sure

t ha t t he MOSFET d oe sn 't t urn b ac k o n s tr ai gh t aw a y, b ut t ak es a f ew m il li se co nd s. This s to ps th e MOSFET b ei ng r ap id ly tu rn ed o n and of f

10.1. The shunt resistor

T he sh un t r esis to r R 7 in th e c ic uit m ust b e a v ery lo w value i fw e w an t larg e c urre nts to b e a ble to flo w, up to 1 00 Amps fu r e xam ple . Itmust n ot

d ro p t oo muc h v ol ta ge , t he re by ro bb in g p ower f rom t he mo to r, and it mus t b e c ap ab le o f d is si pa ti ng t he p ower w it ho ut b ur in g o ut whe n la rg e

cur re nt s a re p as se d t hr ough . S ome sui ta bl e r es is to rs a re a va il ab le f rom Farne ll , c od e 156 -2 67 . Th es e a re s ti ll t oo l ar ge a r es is ta nc e (and to o lo w

p ow er), s o w e ca n p lac e e ig ht i n pa ralle l T he p ow er handl ing capab ihy i s then increased e igh tfu ld , and the res i stance decreased e igh tfu ld .

An a he rn at iv e i s t o u se a p ie ce o f w ir e o f a n a pp ro pri ate th ic kn es s a nd l en gth . This c an b e c al cu la te d u si ng t he data on this web s it e.

A s i rr ru lat iono f the cu rren t l imiting p art o f this c ir cu it i s s hown i n t he d ia gr am b elow. The V5 t hre sh ol d v ol ta ge w as c ho se n to s et a c urr en t limit of

3 0 Amps. T he sq uare w av e is th e PWM v olta ge (MOSF ET g ate v olta ge ), a nd th e slop ey w av efo rm i s t he d ra in (m otor) current, The spi key b it s

a t t he t op o f t he s lo pe y wav ef orm i swh en th e c ur re nt l imiting i s swi tch ing in and out.

Page 13: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 13/19

 

T here is an in-depth doc um ent here w hich describes sense resistors in detai l.

Som e circuits you m ay see sam ple the curren t going through the m ain pow er M OSFET by placing a m uch low er pow er M OSFE T in parallel with

it. There is a circuit on the 4Q D site w hich does this here. This w orks O K, but the problem is the actual l imit ing curren t is dependa nt on the value

ofR ds(on) of the M OSFET. IfR ds(on) w as only half the value w e w ere expecting it to be, then tw ice as m uch current w ould tlow befure thel imit ing circuit took effect. A lso the R ds( on) valu e depends very m uch on th e curre nt th at is passing through the M OSF ET , and on the

te mp era tu re . A ny v aria tio n in R ds( o n) will c ha ng e th e l imit ing current.

T he R ds( on ) figure is quoted as a max imum valu e on the datasheet, but it i s n ot a d es ig n- sa fe p ar am ete r. This m ea ns th at it i s n ot within defined

lim its w hich are publishe d on the datashee t. F or exam ple , C MO S digital logic guarantees that the output voltage , V o, will b e b etw ee n V cc -O .5 v

and V ee, and that figure can be used to design circuits w hich rely on that figure. However , with R ds(on), w e only know that it will be between 0

and the quoted value. W e cannot rely on a m in immn v alu e o f it, ye t it i s t he m in immn v alu e w hic h c on tro ls th e c urre nt lim it. T he re fu re , u sin g a

se pa ra te sh un t re sisto r is a m uc h sa fe r m eth od .

O ne p ro blem with the circ uit p resented above is th at yo u m ay w an t to provide a larger curren t during acc eleration, or in em ergenc ies. This can be

s olv ed b y d is ab li ng th e c ur re nt l imit ing u sin g a se pa ra te lin e fro m any o nb oa rd m ic ro co ntro lle r, o r b y a dd in g a c irc uit w hic h a llo ws a n o ve r-c urre nt

c on di tio n fu r j us t a s ho rt time. T he am ou nt oftirre th at this is allow ed m ust be carefully calculated to preven t dam ag e to th e M OSFE Ts, and must

ta ke in to a cc ou nt th e c oo lin g sy ste m th at y ou h av e p ro vid ed .

An a he rn ativ e to u sin g th e o p-a mp d i:ffi:re nti al a mp lifie r c irc uit u se d a bo ve is to u se a n in te gra te d c ur re nt se nse m on ito r IC . S ev era l c om pa nie s

m ake these, I have used the Zetex ZX CTl 0 1 O . Zetex 's range of current m onitors can be fuund here.

10.2. Current limited torque speed characteristics

If a D C m otor is being driven by a speed controller with current l imit ing active, w hat happens to the to rque speed characte ristic g raph?

The D C M otors page describes the norm al m otor torque speed graph, and how the torque of a perm anent m agnet D C m otor is proportional to

th e c urre nt. If th e c urre nt is lim ite d h ow ev er, th e to rq ue m ust a lso b e lim ite d, a t th e v alu e c oin ci de nt with th e li mi te d c ur re nt o n th e to rq ue -c ur re nt

g ra ph . T he e ffe ct th at this has on the torque speed graph is show n below :

Page 14: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 14/19

 

Torque speed during current limiting

12

10

8

- = 5. ,. ,4

"-til2

0

-2

-4

Load torque

A s the load torque increases, the speed drops - w e are fullow ing the l ine in the torque sp eed characteristic fro m the left hand side tow ards the

r ight, d ro op in g d ow n. This is the sam e as the uncontrolled m otor. T he m otor torque alw ays equals the load torque w hen the m otor is running at

c on st an t s pe ed (this fullow s from N ew to n's first law - ''An object in motion tends to stay in motion with the same speed and in the same

direct ion unless acted upon by an unbalanced force. " The m otor torque and load torque m ust be balanced out ifth e s pe ed is no t chang ing ).

L et's c all th e c ur re nt l imit value iL an d t he e qu iv al en t t or qu e value on the torque-current graph at this current is TL.W hen the load torque ex ceeds

h,the m otor can no longer create an equal an d o pp o si te t or qu e, an d so the load will push the m otor backw ards in the opposite direction - w e

are n ow f ullo w in g t he l ine as it drops d ow nw ards into ne gative speed.

L et's tak e an exam ple; an opp onent's robot is mo re p owe rf ul than o urs (o r his current l imit is set highe r), and w e are in a p ush in g m atc h. As each

p ush es h ard er, o ur s pe ed c on tro lle r re ac he s its c urre nt l imit f ir st. O ur r ob ot is no w pushin g at a constant furce (since the m otor torque is no w

c on sta nt a t it s highest value). A s the opponent pushes harde r, our w he els start to ro tate back wards, an d th e p ai r o f r ob ots a cc ele ra te s

backw ards at a rate given by N ew ton's second law :

F=ma or a=F/m

where F is the difference betw een the furces of the tw o robots p ushing, an d m is the to tal m ass of the tw o robots.

11. Feedback Speed Control

To stop a robot swerving in an arc when you want it t o go furwards, you need to have feedback control of the m otor speeds. This m eans th at the

actual speed of each w heel is m ea su re d, a nd c om pa re d with all th e other w hee ls. O bviously to go in a straight line, the m otor speeds m ust b e

e qu al H owe ve r, this does not necessari1y m ean that the speed dem and fur each m otor should be the sam e. The m otors will h ave d if fe re nt

amount s o f fr ic ti on, an d s o a 'stiffe r' m oto r will require a higher speed dem and to go as fast as a m ore free-nm ning m otor.

A bloc k diagram of an analog ue feedback speed controller is s hown b elo w

s peed

demand

+phase

compara tor

T he speed dem and is a D C voltage, w hich is fed to the PW M generator fur m otor A. This drives m otor A at a speed dependant on the dem and

voltage. The speed of m otor A is s am ple d u si ng a n o pti ca l e nc od er . This h as a fre qu en cy o utp ut, w hic h is p roportiona l to the speed of the m otor.

Ifwe assume that motor B is already running at som e speed, then the optical encoder on its shaft will be pro ducing a frequ ency also. T he phase

Page 15: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 15/19

 

com parator com pares the tw o frequencies, effectively com paring the speeds of the tw o m otors. Its output is a signal w hich gets larger as the tw o

input frequencies get further apart. If the tw o frequecies are the sam e, it has a zero output.

T he integrator adds the output of the phase com parator to w hatever its o utp ut w as b efu re . F or e xa mp le, ifth e in teg ra to r o utp ut w as p re vio usly 3

vohs, an d its in pu t is 0 v olts, the n it s output will be 3 vohs. If it s in pu t c ha ng ed to -1v oh s, th en its output w ould change to 2 vohs.

Let's assum e that motor B is rurming slower than motor A. T hen th e o utp ut o f the ph ase c om pa ra to r will be posi ti ve , an d the output of the

integrator will start to rise. The speed of motor B will then increase. Ifit increased to a speed greater than that of m otor A, then the output of the

p ha se c om pa rato r w ou ld b ec om e ne ga tiv e, an d the output of the integrator w ould start to full, thereby reducing the speed of m otor B. In this

manner, the speed of motor B is kept the same as the speed of motor A, an d t he r ob ot will go in a straight line (as long as its w heels are the sam e

size!).

This method can be expanded to use any m nnber of w heels. O ne m otor will alw ays be the directly driven one (in this case motor A), and the

others will have their speed locked to this one. N ote that ifthe d ire ctly d rive n m oto r is fa ste r, o r m ore fre e-ru nn in g, than the others, then w hen it

is d riv en a t it s fastest speed (the PW M signal is always O N), then the other m otors will never be able to keep up, an d t he r ob ot will s ti l l swerve.

Itis b est, th ere fo re , to d ire ctly d riv e th e slo we st m oto r.

An analogue feedback speed controller such as this is q uite d iffic uh to rrak e, a nd k ee p sta ble. Iti s e as ie r to p erf urm this f imc ti on u s ing so ftware

i n a n o nb oa rd m ic ro co ntr olle r . .. .

11.1. Software feedback speed control

T o perfurm the sam e fim ction as described above in softw are requires that the softw are has digital representation of the speed of each w heel, and

can finely control the w idth of the PWM signal sent to each wheel To get the speed of each wheel, an optical encoder must be used as in the

a na lo gu e m etho d, b ut th e o utp ut o f it m ust b e se nt to the m ic ro co ntro lle r. This is achieved using a counter, clocked by the speed controller, w hich

th e m ic ro co ntr olle r c an re ad , an d can clear. A t regular intervals, the m icrocontroller m ust read the counter, then clear it. T he interval depends on

the max imum speed of the robot, the diam eter of the w heel, the mnnber of slots in the speed encoder's disc, and the m nnber of bits of the

counter.

A c om ple te de sig n u sin g this technique is being w orked on an d will be presented here w hen it is com plete.

11.2. Speed encoders

T o s ta rt with, we need a device that will measure the speed of the motor shaft. The best way to do this i s to fit a n o pt ic al e nc od er . This shin es a

beam of light from a transm itter across a sm all space an d d ete cts it with a receiver the other end. If a disc is placed in the space, which has slots

c ut i nto it, th en th e si gn al will only be picked up w hen a slot is betw een the transm itter an d receiver. An exam ple of a disc is shown below

Page 16: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 16/19

 

A suitable encoder is available from Maplin, code CH18U fur about £2 each

Page 17: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 17/19

 

19, . . -I

11.5

L() aNT"""." "

I-.-¢3.2

The encoder transm itter rrrust be supplied w ith a suitable current, and the receiver biased as below :

_..J L.-

2.54

This will bave an output which swings to +5v when the light is blocked, and about 0.5 vohs w hen l ight is allow ed to pass through the slots in the

d isc . T he se vo lta ge s are c om ptib le w ith no rm al d ig ita l ci rcu itry . H ow ev er, b ec ause this device is right next to a DC m otor, which generates a lot

o f e le ctr ic al n oi se (s in ce i t i s s wi tc hi ng high c ur re nts a t th e c or rn nu ta to r i nto th e i nd uc ti ve w ind ings - hence high v olta ge s a nd spa rk s!), th e o utp ut

rrrust be low -pass fihered. The pbase com parator should bave as l ittle n oi se as po ssi ble a t i ts i np uts.

The cutoff frequency fur the filter is determ ined by how m any slots are in the disc, and by how fast the disc (and hence the wheel) is intended to

rotate. Itis g ive n b y the eq ua tio n

Page 18: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 18/19

 

where Sw is maximum s pe ed o f t he w he el in r pm , a nd n i s t he m nn be r o f slo ts i n th e d is c. T he fi lte r ca n b e m ad e fr om a si mp le RC c irc ui t a s

fullows:

T he n th e R an d C v alu es c ho se n su ch th at

1RC=-

2;£

Fo r e xampl e, ifth e maximum wh ee l s pe ed i s 1 0r pm , and there are 1 2 slo ts in t he d isc , th en RC =0 .0 8 , s o s ui ta bl e v al ue s o fR and C might be

8k2 and 1OuF.

An ahe rn at iv e way to measure t he s pe ed i s u s in g a ma gn eti c s en si ng d ev ic e. I f your rmt or o r g ea ri ng h as s te el t ee th , t he n s en so rs a re a va il ab le

th at ca n d ete ct an d c ou nt th es e a s th ey g o b y. T he In fin eo n TLE4 94 2 i s su ch a d ev ic e. I will n ot g o i nt o t hi s anymor e s in ce t he d at as he et a t t ha t

link d es cr ib es h ow to u se t he d ev ic e.

A l le gr o a ls o make many magnet ic d ev ic es f ur s pe ed measurement, The Al leg ro Microsysterrs webs it e i s h er e

12. Links to other relevant pages

Basic guides to what speed controllers do

4Q D manufacture speed cont ro l le rs , and pub li sh this basic technical gu ide :

http://www.4qd.co. uk/fuq/index.html

S GS T homs on p ro du ce d a g oo d document about current l imiting in a full bridge circu i t .

http://www.st.comistonlinelbooks/pd:f7docslI668.pdf

DC rm to r driving i n cludingmethods o f speed regu lat ion

http://www.st.comistonlinelbooks/pd:f7docs/1656.pdf

Driv ing DC mo to rs

http://www.st.comistonlinelbooks/pd:f7docslI704.pdf

Infonnation about MOSFETs

In te rna t ional Rec ti f ie r have seve ral appl i ca tion no te s on MOSFETs and h ow to u se th em :

G oo d o ne s a re "Current Ratings of Power Semiconductors", ''Paralleling HEXFET® power MOSFETs", "Gate Drive Characteristics and

Requirements for HEXFET® power MOSFETs", and "The Do s and Don'ts of Using MOS-Gated Transistors", a ll o fwh i ch a re i nc lu de d a t

the fu llowing s i te :

http://www.irf.comltechnical-infu/appnotes.htm

Practical speed controller projects:

The Op en S ou rc e Mo to r Co nt ro lle r COSMC) p ro je ct .

A project to m ake a high cur re nt s pe ed con tr ol le r u si ng 4 p ar al le le d MO SFETs i n e ach b ri dg e arm, and an HIP4081 A d ri ve r/ co nt ro ll er :

http://groyps.yahoo.comlgroyp/osrnc/

A c on ve rt er f ur th e above p ro je ct t o c onve rt a n ana lo gu e i n s ig na l i n to d ir ec ti on and PWM s ig na ls :

Back to main index

Page 19: Speed Controllers

5/11/2018 Speed Controllers - slidepdf.com

http://slidepdf.com/reader/full/speed-controllers-55a234f395abc 19/19

 

1 i ( ! l i f l ' t l

Itll1:lIil