eCircuit Center |
About SPICE |
SPICE Basics | Running SPICE
| CIRCUIT COLLECTION |
SPICE Commands | SPICE Demos and Downloads |
Op Amp Control - Lead CompensationCIRCUIT
OP_CTRL_LEAD.CIR
Download the
SPICE file Let's start with a motor speed controller that's in trouble. The customer requests a fast response from the motor speed control system, but there's a big delay in the motor inertia and load. This causes huge overshoot and ringing which ends up shaking the system violently causing major damage. A simple method to prevent oscillations reduces the bandwidth of the integrator. ( See Part 1 and Part 2.) Sure, you've stabilized the system, but at the expensive of having a slower response time. What if you need a faster response? By adding a simple circuit, you can tame a potentially unstable system and get it to respond quickly too.
LEAD COMPENSATION The lead compensator is defined by a lower frequency zero at fz and a higher frequency pole at fp.
It's frequency response has three distinct behaviors.
In theory, the zero behaves like a high-pass filter where the magnitude rises at +20 dB / dec with +45 deg at fz and up to +90 deg well above fz. However, the pole at fp acts like a low-pass filter where magnitude falls at -20dB/dec, cancelling out the zero making the response flat again at higher frequencies. Also, the pole adds negative 90 deg phase, canceling out the positive phase of the zero at f > fp. However, between fz and fp, you get a positive phase bump. This bump, when placed properly, can stabilize an otherwise ringing or oscillating response!
MOTOR CONTROLLER A simple way to stabilize the system is to slow it down (See Part 2). But faster responses call for more heroic design efforts
OPEN-LOOP ANALYSIS TROUBLE IN THE PLOTS Where are the signs of trouble? Run an AC RESPONSE of the open loop circuit OP_CTRL_LEAD_OL.CIR with RP1=RP2=100k and CP1=CP2=0.1uF. The control components are R1=R2=100k and CI=0.1uF. Initially, set the lead compensator to do nothing for now (unity gain) with RC2 = 100k, RC1=10k and CC1 = 1pF. Plot the gain going around the loop, V(28/)V(200), and find where it falls to unity (0dB). What is the phase at this point? Yes, it's ugly - less than +20 deg (-340 deg) phase shift! Why is this bad? Remember, that an integrator controller starts with a phase around +90 deg (-270 deg); this is good . However, the negative phase of the delays can reduce this +90 deg down to 0 deg (-360) - a possible oscillator! The closer your phase to 0 (-360 deg) , the worse the response. Why? Because 0 deg (-360 deg) means the signal at V(28) is exactly in phase with signal at the start of the loop V(200). Consequently, the signal keeps adding to itself and growing to create a self sustained sine wave.
TUNE IT CIRCUIT DESIGN A reasonable guess places the zero at the unity gain frequency of the open loop plot, fz = fu. The plot of V(28)/V(200) shows an fu at about 10 Hz, therefore fz = fu = 10 Hz. Then choose the pole to be fp = fz · 10.
Then, you can manually change CC1 until you get a good response in the open and closed loop responses. (There are many different tuning methods. You can adjust it to better suit your system.) Set CC1 = 0.1uF and run an AC response. To see the lead compensator only, add plot window and add the trace V(28)/V(20). You should see a nice positive phase bump between fz and fp. You should also see the gain rise as expected between these frequencies. How did the lead compensator impact the open-loop response V(28)/V(200)? Yes, the phase has been increased from about 20 to about 50 deg at the unity gain frequency. This should have significant reduction in overshoot and preserve the fast rise time in the closed loop response.
CLOSED-LOOP TUNING CIRCUIT DESIGN With CC1 set to 0.1 uF, run a TRANSIENT RESPONSE of the closed-loop circuit OP_CTRL_LEAD.CIR. Plot the set command V(1) and feedback V(28). You should see the response has taken a turn for the better. It's not perfect, but much of the overshoot and ringing have been reduced. Okay, time for a bit of manual tuning. Start increasing or decreasing CC1 by factors of 2. Which direction takes you to a better response? Follow that direction, changing CC1 until you arrive at a response with a short rise time and minimal overshoot. Also, you'll find that adjusting the value further begin to worsen the response. Congratulations, you've successfully applied lead compensation to meet the customer's requirements of a motor controller with a fast response time.
CLOSED-LOOP SPICE FILE OP_CTRL_LEAD.CIR * * SET POINT VS 1 0 AC 1 PWL(0US 0V 0.01US -10V) * * CLASSIC CONTROL AMPLIFIER R1 1 2 100K R2 28 2 100K CI 2 3 0.1UF XOP1 0 2 3 op_001 * * POWER AMP WITH LIMIT EAMP 10 0 VALUE = { LIMIT( 1 * V(3), +15, -15 ) } * * PROCESS (MOTOR, HEATER, ETC) EP1 15 0 VALUE = { 100 * V(10) } * LOSSES (FRICTION, HEAT LOSS, ETC.) RL1 15 16 0.1 RL2 16 0 100 * DELAY (INERTIA, THERMAL MASS, ETC.) RP1 16 17 100K CP1 17 0 0.1UF RP2 17 18 100K CP2 18 0 0.1UF * * SENSOR (TACHOMETER, THERMISTOR, ETC.) ESENSE 20 0 VALUE = { 1/100 * V(18) } * * LEAD COMPENSATION CC1 26 27 0.1PF RC1 27 0 10K RC2 26 28 100K XOP2 20 26 28 op_001 * * BASIC OP AMP MODEL * Device Pins In+ In- Vout .SUBCKT op_001 1 2 82 RIN 1 2 1e9 * Aol=1000000, fu=1000000 Hz G1 0 10 VALUE = { 1.0 * V(1,2) } R1 10 0 1e6 C1 10 0 1.59e-7 * OUTPUT STAGE EOUT 80 0 10 0 1 ROUT 80 82 10 .ENDS * * ANALYSIS ************************************* .TRAN 0.1MS 400MS *.AC DEC 20 0.1 1000MEG .PROBE .END
OPEN-LOOP SPICE FILE OP_CTRL_LEAD_OL.CIR * * SET POINT VS 100 0 AC 0 * * INVERTER EINV 1 0 100 0 -1 * * OPEN-LOOP TEST VOLTAGE VTEST 200 0 AC 1 * * CLASSIC CONTROL AMPLIFIER R1 1 2 100K R2 200 2 100K CI 2 3 0.1UF XOP1 0 2 3 op_001 * * POWER AMP WITH LIMIT EAMP 10 0 VALUE = { LIMIT( 1 * V(3), +15, -15 ) } * * PROCESS (MOTOR, HEATER, ETC) EP1 15 0 VALUE = { 100 * V(10) } * LOSSES (FRICTION, HEAT LOSS, ETC.) RL1 15 16 0.1 RL2 16 0 100 * DELAY (INERTIA, THERMAL MASS, ETC.) RP1 16 17 100K CP1 17 0 0.1UF RP2 17 18 100K CP2 18 0 0.1UF * * SENSOR (TACHOMETER, THERMISTOR, ETC.) ESENSE 20 0 VALUE = { 1/100 * V(18) } * * LEAD COMPENSATION CCI 26 27 0.1PF RC1 27 0 10K RC2 26 28 100K XOP2 20 26 28 op_001 * * * * BASIC OP AMP MODEL * Device Pins In+ In- Vout .SUBCKT op_001 1 2 82 RIN 1 2 1e9 * Aol=1000000, fu=1000000 Hz G1 0 10 VALUE = { 1.0 * V(1,2) } R1 10 0 1e6 C1 10 0 1.59e-7 * OUTPUT STAGE EOUT 80 0 10 0 1 ROUT 80 82 10 .ENDS * * ANALYSIS ************************************* *.TRAN 0.1MS 1000MS .AC DEC 20 0.01 1e5 .PROBE .END
2011 eCircuit Center |
|||||||||||||||||