chapter 21 gear motor speed control - pid
TRANSCRIPT
Ch 21 Gear Motor Speed Control - PID 1
Chapter 21 Gear Motor Speed Control - PID DC Motor Position Control Lab
This lab has a history from a number of previous developers. One was the original lab for the
Auto Controls course manufactured by a former instructor in EET, John Rich. Another was a
paper “A Low-Cost Control System Experiment for Engineering Technology Students” by Dr.
Curtis Cohenour Ph.D., P.E. P.E., Ohio University. Dr. Cohenour’s implementation is shown
here:
Ch 21 Gear Motor Speed Control - PID 2
Prof. Rich’s design is shown next:
and here.
Speed and Position
Control of DC
Motor
Ch 21 Gear Motor Speed Control - PID 3
At present, the PID block controlling a dc gear motor seems to be the best approach. The
controller is a Siemens S7-1200 with encoder inputs and PWM output.
Several different dc gear motors are shown here. We are presently using the first of these
although, the other lower-cost ones will also work.
Ch 21 Gear Motor Speed Control - PID 4
The description of the gear motor is as follows:
Description
DC 12V 7RPM 50Kg. cm Self-Locking Worm Gear Motor With Encoder And Cable, High Torque Speed Reduction
Motor
Specification:
Voltage: DC12V
No-Load Speed: 7rpm
Reduction Ratio: 1:522
Torque: 50Kg. cm
Error: ±10%
Wire Length: 20cm / 7.87 inch
Output Shaft Diameter: 8mm / 0.31 inch D-type
Output Shaft Length: 15mm / 0.59 inch
Total Size (not include shaft): 40*36*125mm / 1.57 * 1.41 * 4.92 inch
Wirings:
1. The yellow and green wires are the speed signal output line, and they can't be connected any power supply, or it
will be burnt.
2. Positive and negative power supply of encoder do not allow connect wrong; voltage is 3.3 -5V.
3. Control CW or CCW of motor by changing the positive and negative power supply of encoder (change Red Wire
and White Wire connect)
Red Wire - positive power supply of motor(+)
White Wire - negative power supply of motor(-)
Black Wire - negative power supply of encoder(-) (positive and negative power supply of encoder do not allow connect wrong; voltage is 3.3 -5V)
Blue Wire - positive power supply of encoder(+) (positive and negative power supply of encoder do not allow connect wrong; voltage is 3.3 -5V)
Yellow Wire - signal feedback (11 signals per motor turns a circle)
Green Wire - signal feedback (11 signals per motor turns a circle)
The interface between the PLC and the motor and the motor controller is shown in the next
diagram.
Ch 21 Gear Motor Speed Control - PID 5
2.2 k
+24 V
Signal from
Encoder0-5 VDC
Signal to PLC Input0-24 V DC
4.7 k
PWM Output Signal
PWM Signal to MD20AMotor
Controller1.0 k
A note from Siemens:
Ted, We discussed the use of the S7 1200 v2.2 CPU in relation to the Quadrature encoder. The 1200 with 24V DC inputs support up to six High Speed Counters. a. Up to 3 of the addresses Ia.0 to Ia.5 can be used for Quadrature Mode at 80Khz. b. Up to 3 of the addresses Ia.6 to Ib.5 can be used for Quadrature Mode at 20Khz. The DI4 5 VDC signal board with part number 6ES7 221-3AD30-0XB0 must be used since the encoder is 5V. It supports 160 KHz for Quadrature Mode. The input is "source" type. So, the encoder must support this which means that it is NPN or Open Collector type. If not, the 1200 cannot be used with this encoder. An ET 200SP with the Position Input module would be a viable option. I can help further with the ET 200SP if needed. Does the encoder, have A and A not, B and B not, Z and Z not signals? If so, please wire these as well because this readings will be more accurate. For the S7 1200 v2.2 when configuring the HSC, please select the Input Source as "signal board input". Please note that the option is only available if the signal board has been added in the hardware configuration. Please note that the addresses of the HSC will be the address of signal board (default 4.x). In v4.x S7 1200's, the user selects the address rather than the Input Source. Let me know if I can help further. Best Regards, C. Wayne Scott Siemens Industry, Inc. Customer Services Technical Support Customer Care Center: 800 333 7421 Outside USA +1 423 262 5710
Ch 21 Gear Motor Speed Control - PID 6
We used the 24 V input/output model since that is what was available. The set-up of the inputs
for pulse and outputs for PWM are included in the program shared later. The dc motor controller
is shown below. We used 12 V for power since the motor was rated at 12 V DC. This controller
is very inexpensive and can accommodate any of the motors shown above. It is also used in the
tank-over-tank lab in Hybrid Text Ch. 25. It works well with cheap power supplies for most
applications.
Ch 21 Gear Motor Speed Control - PID 7
The wiring for the motor from the PLC and motor drive board is shown below:
2.2 k
L (+24 VDC)
Signal from
Encoder0-5 VDC(either
yellow or green wire)
Signal to PLC Input0-24 V DC
(I0.0)
4.7 k
PWM Output Signal(Q0.0)
Signal to MD20AMotor
Controller
1.0 k
M (0 VDC)
Dir does not need
to be connected
12 V +
0V (M)
0V (M)
Ch 21 Gear Motor Speed Control - PID 8
The program for the single dc motor follows. First the Project Tree:
Next is the set-up for the high speed inputs for the pulses in and the PWM for the output.
Ch 21 Gear Motor Speed Control - PID 9
The program is in a cyclic interrupt program that is executed each 100 ms. It consists of a rung
to get the input count for the last 100 msec followed by the PID block and finally the output to
the PWM block.
Ch 21 Gear Motor Speed Control - PID 10
The following is a watch table built to display the variables for the PID block. The video gives
additional detail of the PID block and uses this watch table to vary the speed.