![Page 1: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/1.jpg)
EECS192 Lecture 3
Feb. 4, 2020
Topics• Timing in Linux:
• Motor electrical model– Motor electromechanical behavior
• Driving MOSFETs and motor – UCC21222 MOSFET driver
• PWM issues for motor
• H Bridge motor drive
• (Back EMF measurement)
• Buck Converter (on Handout board)
Notes:
• Handouts: lab rules
• 2/11 project proposal – upload to bcourses by Tues 330 pm
• CP 2: 2/7: bench top Motor drive/stall, steering servo
• Quiz 1: motor behavior Tues 2/11 (See Motor Worksheet week 2)
• CalDay Sat April 4/18
![Page 2: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/2.jpg)
CheckPoint 2- highlights. See Piazza for full specC2.1: Power from bench supply set to 12v.
C2.2: Both LEDs for both buck converters should light up
C2.2.1: The 5v buck converter output between 4.75 and 5.25v
C2.2.2: The 6v buck converter output 5.7 and 6.3v
C2.3: With all wheels off the ground, the motor should spin forward (from keybd
command)
C2.4: With a non-super (ie, not a Savox) servo connected, demonstrate turning
between left, center, and right positions (from keybd command)
C2.6: Motor stall test: 30% duty cycle for 5 seconds, with the wheels held in place.
PWM Frequency > 10 kHZ (Why??)
#define RC_MOTOR_DEFAULT_PWM_FREQ 25000
C2.6.2: The current limit on the power supply must be at least 20A Use the higher
current connectors on your power supplies. Do not use test leads for motor
current.
C2.6.5: No component should get too hot to touch
C2.9: All members must fill out the checkpoint survey before the checkoff close.
Completion is individually graded.
![Page 3: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/3.jpg)
Delay timing using rc library
start_time = rc_nanos_thread_time();
// routine to be timed:
for(j = 0; j< 1000; j++)
{shared_mem_32bit_ptr[ENCODER_MEM_OFFSET+1] = 1;
// set flag to start conversion by PRU
while(shared_mem_32bit_ptr[ENCODER_MEM_OFFSET+1] == 1);
// wait for PRU to zero word
for(i = 0; i< 128; i++){
linescan[i]=
(int) shared_mem_32bit_ptr[ENCODER_MEM_OFFSET+2+i];
// copy data
}
}
end_time = rc_nanos_thread_time();
run_time = end_time - start_time;
![Page 4: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/4.jpg)
Topics• Timing in Linux:
• Motor electrical model– Motor electromechanical behavior
• Driving MOSFETs and motor – UCC21222 MOSFET driver
• PWM issues for motor
• H Bridge motor drive
• (Back EMF measurement)
• Buck Converter (on Handout board)
![Page 5: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/5.jpg)
DC Motor Physical Model-reviewMotor model
![Page 6: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/6.jpg)
Motor Electrical Model (neglect inductor)
Continued on board
Also- see motor worksheet……
Motor Electrical Model
Back EMF
Motor electromechanical behavior
Vm
Note: missing e-stop!
Motor model
+
VDS
-VGS
![Page 7: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/7.jpg)
Motor model
(for answer
see sp99 final solution)
Let peak speed = 5 m/sec
Accel = 5 m/s2
ke = 1 v/(m/sec)
On board
![Page 8: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/8.jpg)
PWM for Main Motor control
im
<im > = (T/To) imax
Is imax constant?
PWM Issues for Motor
![Page 9: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/9.jpg)
Motor Electrical Model
Also- see motor worksheet……
Motor Electrical Model
Back EMF
Motor electromechanical behavior
+
VDS
-VGS
+
Vm
-
+
Ve
-
Rm
im
im = VBAT – ke qm
Rm
. +
Vm
-
+VBAT
Conclusion:
<im >=?
PWM and Motor Drive
Motor Resistance?
Peak current?
9
![Page 10: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/10.jpg)
Given: Rm = 0.1 ohms, Vbatt = 7.2 V, Rbat = 0.Vds = ? ➔ Ids = ? amps
MOSFETs and motor driveDriving MOSFETs and motor
(LiPo 11 V!)
![Page 11: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/11.jpg)
Rm = 0.1 ohms, Vbatt = 7.2 V, Rbat = 0.Vds = 3.6V ➔ Ids = (7.2-3.6V)/(0.1 ohm) = 36 amps
Vgs =20VPtrans ~ 35 W
Vgs =6VPtrans ~ 72W
Driving MOSFETs and motor Key design points:
1) High Vgs better than low Vgs
2) Switch quickly
3) Make sure Vs=0 (big ground)
![Page 12: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/12.jpg)
Topics• Timing in Linux:
• Motor electrical model– Motor electromechanical behavior
• Driving MOSFETs and motor – UCC21222 MOSFET driver
• PWM issues for motor
• H Bridge motor drive
• (Back EMF measurement)
• Buck Converter (on Handout board)
![Page 13: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/13.jpg)
Driving MOSFETs and motor
![Page 14: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/14.jpg)
Motor Drive with UCC21222 gate driver
11v
LiPo
+
Vm
-
+
VDS
-
VGS
+
-
Details On board….
Checklist:
1) Emergency stop
2) Reset Protection
3) Snubbing
![Page 15: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/15.jpg)
Driving MOSFETs and motor
CSD18542KTT Power MOSFETHow to choose PWM frequency?
![Page 16: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/16.jpg)
Driving MOSFETs and motor How to choose PWM frequency:
UCC21222 driver constraint
I Gate capacitance
5000 pF
(on board)
I = C dv/dt
![Page 17: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/17.jpg)
Low Side Drive example
11v
LiPo
+
Vm
-
UVLO = under voltage lockout = 9 V
Diode needed?
![Page 18: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/18.jpg)
11v
LiPo
+
Vm
-
![Page 19: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/19.jpg)
UCC 21222 design details
![Page 20: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/20.jpg)
UCC 21222 internal details
UVLO: under voltage lockout (check data sheet)
DT: dead time useful for H Bridge
![Page 21: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/21.jpg)
Topics• Timing in Linux:
• Motor electrical model– Motor electromechanical behavior
• Driving MOSFETs and motor – UCC21222 MOSFET driver
• PWM issues for motor (inductance)
• H Bridge motor drive
• (Back EMF measurement)
• Buck Converter (on Handout board)
![Page 22: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/22.jpg)
What does high side transistor do?
![Page 23: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/23.jpg)
+
-10v
+ VL -
vDS0.1 ohm
SW
Lim
Rm
Assume ideal diode,
ideal switch, L= 100 mH.
Time constant t = 1 ms.
Steady state,
constant velocity.
Initial rate:
V/L= +8x104 amp/sec
SW
t
closed
im
VL
open
057 us
20 us
10V
-10V
Diode reverse break down voltage
e
+ -
2v
1.6 amp
Motor+flywheel diode 23
![Page 24: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/24.jpg)
+
-10v
+ VL -
vDS0.1 ohm
SW
Lim
Rm
Assume ideal diode,
ideal switch, L= 100 mH.
Time constant t = 1 ms.
Steady state,
constant velocity.
Assume imin = 5 amp
SW
t
closed
im
VL
open
0 57 us20 us
7.5V
e
+ -
2v
5 amp
6.5 amp
-2.65V
Snubber/flyback diode
Motor+flywheel diode 24Note: 25 kHz PWM reduces peak current
![Page 25: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/25.jpg)
Topics• Timing in Linux:
• Motor electrical model– Motor electromechanical behavior
• Driving MOSFETs and motor – UCC21222 MOSFET driver
• PWM issues for motor (inductance)
• H Bridge motor drive
• (Back EMF measurement)
• Buck Converter (on Handout board)
![Page 26: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/26.jpg)
H Bridge Concept
S1 S2 S3 S3 Function?
Off Off Off Off
On Off Off On
Off On On Off
On On Off Off
On Off On off
Off On Off on
Iforward
![Page 27: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/27.jpg)
H bridge11v
LiPo
+
Vm
-
Need protection logic!
11v LiPo
!!!!CAUTION!!!!
Software fries
hardware….
Need protection logic-
74HCxxx
Estop?
![Page 28: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/28.jpg)
Topics• Timing in Linux:
• Motor electrical model– Motor electromechanical behavior
• Driving MOSFETs and motor – UCC21222 MOSFET driver
• PWM issues for motor (inductance)
• H Bridge motor drive
• (Back EMF measurement)
• Buck Converter (on Handout board)
![Page 29: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/29.jpg)
Differential amp to read back EMF for
H Bridge driving motor. Change values for
12V Back EMF…
Back EMF velocity sensing
3.3V
![Page 30: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/30.jpg)
SW
t
closed
im
VL
open
0 57 us20 us
7.5V
5 amp
6.5 amp
-2.65V
+
-10v
+ VL -
vDS0.1 ohm
SW
Lim
Rm
e+ -
2v
Snubber/flyback diode
Back EMF velocity sensing
VDS = 10V - VDIODE
![Page 31: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/31.jpg)
Topics• Timing in Linux:
• Motor electrical model– Motor electromechanical behavior
• Driving MOSFETs and motor – UCC21222 MOSFET driver
• PWM issues for motor (inductance)
• H Bridge motor drive
• (Back EMF measurement)
• Buck Converter (on Handout board)
![Page 32: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/32.jpg)
Buck Converter- DC-DC
Waveforms on board (also see buck converter notes.)
Buck: high to low. Boost: low-to-high)
+ VL -
+
Vin
-
+
R Vout
-
Buck Voltage Convertor
Why? Efficiency ~90%
32
![Page 33: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/33.jpg)
Buck Converter
https://en.wikipedia.org/wiki/Buck_converter
Buck Voltage Convertor
+ VL -
33
![Page 34: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/34.jpg)
Buck Voltage Convertor
+
Vout
-
34
ON
OFF
+
Vin
-
+
Vin
-
+
Vout
-
![Page 35: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/35.jpg)
LMR33630 Buck Converter
![Page 36: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/36.jpg)
LMR33630 Buck Converter
#1#2
… multiple capacitors can be used in parallel
to bring the minimum effective capacitance up
to the required value. This can also ease the
RMS current requirements on a single
capacitor.
![Page 37: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/37.jpg)
Buck Converter Waveforms
![Page 38: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/38.jpg)
Extra Slides
![Page 39: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/39.jpg)
Wiring Notes: caution on Vgs
11v
LiPo+
Vm
-
+
VDS
-
VGS
+
-
Driving MOSFETs and motor
On board
Watch out for voltage drop in wires/PCB traces.
#22 wire: 50 mOhm/m
#12 wire: 5 mOhm/m
![Page 40: Topicsee192/sp20/files/lec3.pdf · C2.2.2: The 6v buck converter output 5.7 and 6.3v C2.3: With all wheels off the ground, the motor should spin forward (from keybd command) C2.4:](https://reader030.vdocument.in/reader030/viewer/2022041011/5ebc84187451343e7e6c3cc3/html5/thumbnails/40.jpg)
Summary
40
• Wiring to prevent high Vgs
• Wiring to prevent high current through low power devices
• Linear regulator
• Buck converter