0% found this document useful (0 votes)
2 views8 pages

05 - PID Algorithm Used For DC Motor Control

This paper discusses the implementation and validation of a PID algorithm for controlling the position of a DC motor in a closed-loop feedback system. It highlights the importance of accurate modeling and simulation to optimize performance and reduce development costs, while addressing challenges posed by nonlinear components. The study presents results from simulations and tests conducted in Simulink, demonstrating the effectiveness of the PID controller in achieving desired positioning outcomes.

Uploaded by

Thien Mai Nhat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

05 - PID Algorithm Used For DC Motor Control

This paper discusses the implementation and validation of a PID algorithm for controlling the position of a DC motor in a closed-loop feedback system. It highlights the importance of accurate modeling and simulation to optimize performance and reduce development costs, while addressing challenges posed by nonlinear components. The study presents results from simulations and tests conducted in Simulink, demonstrating the effectiveness of the PID controller in achieving desired positioning outcomes.

Uploaded by

Thien Mai Nhat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

2018 IEEE 24th International Symposium for Design and Technology in Electronic Packaging (SIITME)

PID Algorithm used for DC Motor Control


M. A. Taut, G. Chindris, and D. Pitică
Applied Electronics Department, Technical University of Cluj-Napoca, Cluj-Napoca, Romania
[email protected]

Abstract—This paper aims to present the effects of a PID engineers to control even complex dynamic systems. In fact, all
algorithm controller in a closed loop feedback system. Validation systems have nonlinear components, which present real
of the results is highlighted by calculating the position of a DC challenges in using classical control based on PID feedback. In
motor in a closed-loop system. The importance of this work comes modern systems where process monitoring is needed to be
precisely from the need to test and show the responses of such a optimized, a closed control loop are used to measure the process
system as accurately as possible in order to achieve the desired with the data provided by the sensors, the values of these
performance in real time. Over the years, due to the growth of the measurements being compared to the desired reference values
DC motor market, the need to implement control algorithms and by helping to regulate a control output parameters based on this
test these devices in a more realistic way through mathematically
difference. To achieve this PID control algorithm, a position
models has been of the utmost importance, showing also the need
for research enterprise. Due to these considerations and, of course,
sensor was used to measure real values of the DC motor position.
to a technological evolution that contemporary industry is subject All closed loop control was implemented in Simulink, Matlab.
to, the need to test such systems is imperative, being present and
II. THEORETICAL FUNDAMENTATION AND BLOCK DIAGRAM
accepted at the highest standards. Early identification of design
problems, repeatability of tests, reduction of development costs Control circuits are the most important element that can
and shortened validation process are some of the benefits of this influence the quality of operation and performance of control
testing and control system. applications. In order to achieve a control circuit, understanding
the fundamental elements of controlling the systems both in the
Keywords—PID algorithm; DC Motor; Close-loop; PID; DC continuous time domain and in the discrete time domain,
Motor control. provides first aid to a more in-depth understanding of their
operation. The defining elements of this paper are found in
I. INTRODUCTION highlighting closed loop control methods, as well as design
One of the main arguments behind the motivation of this considerations for these systems in terms of elements that make
scientific paper is the issue of maintaining some parameters of a up such a control system. Because adjustment systems, even if
control system within a specified range. The adjustment and they are stable, when changing some parameter values, they can
control system, being a dynamic system and having a technical reach the threshold of instability. To prevent this unwanted
process implemented, influences the values of these parameters. effect, the mathematical model of the adjustment segment is
Thus, the values to be referenced must be secured and adjusted required in order to trace the technical characteristics of such a
in a continuous way against disturbing elements, in order to regulator. The correctness and effectiveness of the control
carry out the required requirements. The main objective of this system can be determined by using these mathematical models,
research is to develop a model-in-the-loop system with the help which describing disturbing magnitudes and closed circuit
of specific tools for modelling, simulation and analysis of such inputs of the control system, thereby determining the output
dynamic systems in order to configure the real-time testing quantity behavior. Another problem is the elements that disturb
process control design. Because adjusting systems, even if they or interfere with the closed-loop control elements. Due to the
are stable, on changes in some parameter values can reach the strong development of the industry and processes that control
threshold of instability, the mathematical model of the elements have to perform, testing the output responses of these
adjustment segment is necessary to draw the technical systems is imperative in their development. The implementation
characteristics of such a regulator. The correctness and of modified PIDs can have a major impact on the controlled
efficiency of the control system behavior can be determined by process, both in terms of performance and efficiency. Thus,
using these mathematical models that describe the disturbing testing the response to reactions can have the desired success.
and input magnitudes in the closed circuit of the control and To determine the position and speed of the DC motor, a closed-
control system, thus determining the output behavior. PID loop control system was used. This control loop was used for
controller is the most common control algorithm and is widely feedback to determine the real entry into the system. The
used. Has more than 90% of the current control and automation feedback provides information about the current system status
applications, primarily because it is an efficient and easy to and is used by the controller to continuously correct the actual
implement solution. There are a lot of tuning rules for PID entry into the system to achieve the desired status. Based on the
controllers. Most of the tuning rules are derived for process model response, it was possible to estimate the parameters of the
control and are derived under idealize assumptions, such infinite DC motor. The positioning system of a DC motor in a closed
bandwidth. In fact in most applications, the measurement noise, loop system used to act a gearbox in the automotive field, as can
the range of manipulated variable and the sample rate of the be seen in Fig. 1. The assembly of this system consists of a DC
system limit the closed-loop bandwidth. These control motor with a gear mechanism for transforming rotational speed
algorithms were born and were initially implemented for linear, into transversal movement. The DC motor is coupled to a
invariant systems over time, but due to the technological mechanical load, the load to be moved by the drive.
advances of industry, the PID algorithm has evolved, allowing Measurement of the mechanical position is done by means of a

978-1-5386-5577-1/18/$31.00 ©2018 IEEE 365 25-28 Oct 2018, Iași, Romania


2018 IEEE 24th International Symposium for Design and Technology in Electronic Packaging (SIITME)
data acquisition system, which takes the information from the names and are to be initialized using a Matlab parameter
position sensor mounted on the mechanical load. The movement script.
of this mechanical task is done by the control algorithm, which
is designed to move the load from one point to the other, but also The control loop of this system is tested and simulated in
Simulink, similar to the diagram below. The controller block
to maintain the constant position. The communication between
the data acquisition system and the control algorithm is done contains the Embedded Coder integer system. The same
through a Controller Area Network (CAN) bus. It is worth contents is integrated into the position algorithm.
mentioning that the DC motor with the gear mechanism has the
ratio of 1.9235 mm per rotor revolution.

Fig. 2. Test model in Simulink.

Simple test model for software debugging is shown below.

Fig. 1. The closed loop system controlled by the position control algorithm.

III. DESCRIPTION OF WORK AND RESULTS


The modeling, simulation and characterization of the data of
a modified PID regulator for the systematic control of the
position of an electric DC motor are outlined in this chapter. At
the same time, the chapter includes the defining elements of the
proposed and developed control system. The system output
responses are validated by successive measurements, compared
to those obtained from the simulations performed on the control
system. Another key element of the chapter is the
implementation of the acquisition system, linking the execution Fig. 3. Software debug model.
process with the control algorithm, also, respecting delays and
changes in this acquisition block. The main features that this Some of the expected results are: the Simulink test model meets
system has to meet are defined as follows: the requirements, the position controller software component
(tested with the "Simple Test Model" of the electronic position
• Main task of the controller: Shift speed control sensor), the controller design documentation and the parameter
(corresponds to position change rate control) script. Required algorithm performance can be described as
• Controlled value: Position (Alternative: Position change follows:
rate). • Maximum position range: 0.25 mm.
• Desired values: Position set-value and Maximum and • Stationary position resolution: <= 0.1 mm.
minimum change rates of position (These are to have
higher priority than the position set-value itself.). The • Position overshoot: <= 5%.
desired position change rate is to be met without error • No overshoot beyond the position range limits.
after the initial transition effects.
• Position change rate overshoot (in case limit active): <=
• Initialization functionality: Input signals “InitCommand” 25%.
and “InitValue”. During InitCommand = 1 the controller
output is to be set to InitValue continuously. As soon as
the input flag is changed back to InitCommand = 0 the
controller is to continue its normal operation from this
working point on. The correcting signal should not jump
when the initialization state is ended.
• Parameters in Simulink and in the electronic position
sensor software: All parameters are to have descriptive
Fig. 4. Architecture of position control algorithm in Simulink.

978-1-5386-5577-1/18/$31.00 ©2018 IEEE 366 25-28 Oct 2018, Iași, Romania


2018 IEEE 24th International Symposium for Design and Technology in Electronic Packaging (SIITME)
Table 1. The data obtained by simulating the position sensor model.

Vout/Vsupply x 10E+5 mm x 1000


96600 0
90340 3000
86360 4500
85200 5000
82240 6000
77782 7500
74534 8500
68958 10000
60338 12000
50708 14000
38728 16000
Fig. 5. Simulink position algorithm model. 27012 17500
17920 18500
3278 20000
The architecture proposed for the position control algorithm and
2848 21000
the components it must take into account are presented in the
two figures above. Correct evaluation of current error between In order to verify the accuracy of the data, the implemented
the current and the established position, i.e. the desired position system was tested using a CAN interface between the
is satisfied by a decision unit. The appropriate adjustment to acquisition system and the position sensor. The results of the
ensure correct positioning system functionality following input data sent and received between the two systems, the data
signals such as step input, noise input, etc., remains the task of acquisition and the position sensor are covered by Table 2.
the PID basic algorithm. The desired change rate of output is
implemented with the functional block of the change rate control Table 2. Results obtained through CAN.
unit. Continuing to follow Fig. 4 and 5 we can deduce the
Sensor position [mm] CANape message [mm]
following entities of the position control algorithm. As input 0 0.154
signals we have both the set position representing the value of 1 1.201
the desired position to be achieved by the mechanical load, as 2 2.110
well as the current position received by the algorithm through 3 3.101
the data acquisition system. The minimum and maximum rate of 4 4.140
change is represented by a signal that specifies the minimum and 10 10.05
maximum speed for positioning the mechanical load. That is, the 12 11.86
speed of the DC motor rotor and, of course, the initialization 18 17.85
command. The output voltage for the motor control is modeled 20 20.83
21 20.90
by a variable PWM pulse with a minimum service factor equal
to the minimum exchange rate and a maximum service factor Another aspect that the proposed system control algorithm has
equal to the maximum change rate. Computational blocks are to take into account is the change of the signal introduced by the
described by the error circuit that calculates the difference data acquisition system, but also the delays caused by it.
between the set position signals and the current position, the set
circuit for generating an output signal through a PID filter, and
the shift rate control unit. In implementing the control algorithm,
the position sensor plays an important role precisely because of
its nonlinearity. For better control system precision,
implementing a functional model in the control system chain
Fig. 7. The functional block of the acquisition system.
was required. The need for this model is to test the position
sensor as accurately as possible to estimate its behavior. Fig. 6 As can be seen from Fig. 7, the supply voltages and voltage
shows the architecture and model of the position sensor. signals for position measurement from the position sensor are
transferred to the acquisition system, which then, sends the
values obtained to the control algorithm through the CAN
communication protocol.

Fig. 6. Functional and simulation model of position sensor.

For model simulation, the maximum value that the position


sensor can take due to the simulations performed and the block
diagram in Fig. 1 is taken into account. Therefore, the table used
for simulation contains values from 0 to 21 mm with a 0.5 mm
pitch. Table 1 shows the values obtained from model simulation.
Fig. 8. Modeling and sampling of the acquisition system.

978-1-5386-5577-1/18/$31.00 ©2018 IEEE 367 25-28 Oct 2018, Iași, Romania


2018 IEEE 24th International Symposium for Design and Technology in Electronic Packaging (SIITME)
In addition to the acquisition and sampling model of the
acquisition system, Fig. 8 shows both the delay introduced by
the acquisition system processing and the anti-alias filter model,
since the analog to digital conversion signal is filtered into the
acquisition system.

Fig. 9. Anti-alias model proposed.

Fig. 9 above shows the set parameters for the anti-alias


acquisition system model. A second order low-pass Butterworth
filter with a cutting speed of 160 rad/s was used. In order to test
Fig. 11. DC offset test.
the proposed model we should performed the next test setups:
• Attenuation: applying a sinusoidal signal with 101Hz
frequency and amplitude between 0.5 to 4.5V we should
observe an output signal with the next parameters: 2.5V
DC voltage and a sinusoidal component with no more
than 350mV amplitude and 101Hz frequency.
• DC offset: applying a 4V DC input we should observe a
4+0.01V output.
• Slew-rate: for a rectangular input signal with 80ms
period, the output signal should rise from 10% to 90%
in app. 18ms.

Fig. 12. Slew-rate test.

It can be seen from Fig. 12 the difference between the input


signal and the output signal which is 0V. The growth time
measured from 0.9V to 4.1V is about 18ms. The signal
processing delay is modeled as a delay of 0.160ms (the average
value of the time interval between two consecutive
measurements).
To test the position control algorithm, it is necessary to
implement a test model for the correct implementation of the
functional blocks that make up the control system. The proposed
chart for position control is shown in Fig. 13.
Fig. 10. Attenuation test.

978-1-5386-5577-1/18/$31.00 ©2018 IEEE 368 25-28 Oct 2018, Iași, Romania


2018 IEEE 24th International Symposium for Design and Technology in Electronic Packaging (SIITME)
difference between PosCTRL derivative and
CurrentPosition derivative should be zero).
• It will also deals with the Init sequence: as long as the
InitCommand value is = 1, the SetPosition output is set
to InitValue. When InitCommand = 0 the SetP output
will be equal with SetPosition.

Fig. 13. Proposed diagram for position control algorithm.

The PositionCTRL function from the above figure is described


below:
• For a given SetPosition (imposed by the user) and
CurrentPosition (measured by the position sensor) the
algorithm will calculate a poison action (PosCTRL
output) proportional (mainly) with the error between
SetPosition and CurrentPosition.
Fig. 16. The change rate control test model.
• This block will also take care of the Maximum and
Minimum absolute position values – which should not
exceed the 0 - 21.5 mm domain.
• The output value PosCTRL = Kp * (SetPosition –
CurrentPosition).

Fig. 14. The position control algorithm test model.


Fig. 17. Test model of position control algorithm.
The CRlimiter function from the Fig. 13 is described below:
The above described system response is shown in Fig. 18. The
• This block will check first if the PosCTRL derivative signal with the purple line represents the set position and the
(imposed change rate) is complying with the signal with the yellow line, the output of the position.
Minimum/Maximum change rate limits (specified by
user). If the PosPCTRL is complying with the limits it
goes unchanged. If not, it is limited to the
Minimum/Maximum change rate limits.

Fig. 18. The position control system response.

Fig. 15. The change rate limit test model. It is noted that the output signal follows the input signal with an
error of less than 1% for the input signals that are described
The ChangeRCTRL function from the Fig. 13 is described below.
below:
• This block will control the change rate. It will generate
a voltage output in order to control the CurrentCR (the

978-1-5386-5577-1/18/$31.00 ©2018 IEEE 369 25-28 Oct 2018, Iași, Romania


2018 IEEE 24th International Symposium for Design and Technology in Electronic Packaging (SIITME)
The Simulink Model was obtained by putting together all the
above described components, as can be seen in Fig. 22.

Fig. 19. The input signals generated by the model with the help of signal
builder.

The DC motor model implemented in the control system is


shown below.

Fig. 20. DC motor model.

The proposed gear model is depicted in Fig. 21.

Fig. 22. The entire model of the system in Simulink programming and
simulation environment.

When a position control signal is applied, as shown in Fig. 23,


we have the following responses to the control system. The
translation of relative positions witch we want to order, we shape
them by using a different duty factor control voltage, in order to
maintain the voltage at the DC motor terminals, Fig. 24.
Fig. 21. The proposed gear model.

978-1-5386-5577-1/18/$31.00 ©2018 IEEE 370 25-28 Oct 2018, Iași, Romania


2018 IEEE 24th International Symposium for Design and Technology in Electronic Packaging (SIITME)

Fig. 23. Applied signal for setting the position.

Fig. 27. Sample from the output voltage impulse with modulation.

Fig. 24. The voltage at the output of the position control algorithm.

Fig. 28. The anti-alias filtered signal at the output of the acquisition system.

Fig. 25. The response of the change rate control unit.

Fig. 29. Signals of interest for the DC position control algorithm (signal set for
position setting, physical position measured at engine output and position
sensor value at input to control algorithm).

In Fig. 29, the signals are defined by colors as follows: the signal
generated by the signal builder is marked with blue, the physical
position is defined in yellow, and the signal to obtain the method
for position with the orange color. Simulated results from the
DC position control model in the discrete time range are shown
in the following figures. When applying a signal to set the
position in the form shown in Fig. 30, we have the following
control system responses. Note that, when we applying the
Fig. 26. PWM output voltage for the DC motor of the PID controller. desired positioning signal, different change rates were taken into
account for both the minimum and maximum change rate.
Fig. 27 draws a sample of the PWM output voltage.

978-1-5386-5577-1/18/$31.00 ©2018 IEEE 371 25-28 Oct 2018, Iași, Romania


2018 IEEE 24th International Symposium for Design and Technology in Electronic Packaging (SIITME)
constants and function involved and we also generated an S-
function by compiling the generated code, Fig. 33.

Fig. 33. Track the position signal - convert whole numbers.


Fig. 30. Applied signal for setting the position.
IV. CONCLUSIONS
As mentioned in this paper, the importance of this paper
presented along these chapters, comes as a result of the growth
of the DC motor market. For this reason, these control systems
must be tested extensively to show the possible reactions of
these systems, with an accuracy that tends to be 100%. The
effects of a PID algorithm controller in a closed-loop feedback
system were validated by the results highlighted by calculating
the position of a DC motor in a closed-loop system. It should be
noted that the errors obtained after testing and simulation of the
closed loop control system were less than 1%. Because this
control system works in a model-in-the-loop system, the model
can be parameterized at any time, so the complexity of testing
this control system to be imposed by the requirements and
standards of today's control applications.
REFERENCES
[1] Mahendra Kumar et al. "Robust Steering Control of Autonomous
Fig. 31. Tracking the position signal.
Underwater Vehicle: Based on PID Tuning Evolutionary Optimization
Technique" International Journal of Computer Applications (IJCA) vol.
80 no. 3 pp. 7-11 Jun. 2015.
[2] K. R. Das D. Das J. Das "Optimal tuning of PID controller using GWO
algorithm for speed control in DC motor" Soft Computing Techniques and
Implementations (ICSCTI) 2015 International Conference pp. 108-112
2015.
[3] S. Sheel, O. Gupta, "New Techniques of PID Controller Tuning of a DC
Motor-Development of Toolbox", MIT International Journal of Electrical
and Instrument Engineering, vol. 2, pp. 65-69, 2012.
[4] M. Kushwash, A. Patra, "Tuning PID Controller for Speed Control of DC
Motor Using Soft Computing Technique-A Review", Journal of Advance
in Electronic and Electric Engineering, vol. 4, pp. 141-148, 2014.
[5] M. Aricil, A. Osman, "Self Tuning Speed Control of Permanent Magnet
DC Motor", 9th International Conference on Electrical and Electronics
Engineering (ELECO), 2015.
[6] H. Christanto, A.I. Cahyadi, O. Wahyunggoro, "Optimized PID Tuning
with ITAE Polynomials: Study on the DC Motor System", Regional
Conference on Computer and Information Engineering (RCCIE), pp. 178-
183, 2014.
Fig. 32. Test results for changing the simulation setup to discrete solver and [7] K. A. Othman, M. M. Kamal, N. Mamat et al., System identification of
0.005s step. discrete model for DC motor positioning[M], 2009.
[8] M. Rata, G. Rata, V. Chatziathanasiou, "Solution for the Study and
Fig. 32 shows test results for changing the simulation setup to Understanding of PID Controllers", International Conference and
discrete solver and 0.005s step. For electronic position system Exposition on Electrical and Power Engineering-EPE2014, pp. 182-185,
implementation we used an integer conversion for all variables, 2014.
[9] F. Giri, AC Electric Motor Control, John Wiley & Sons Ltd, 2013.

978-1-5386-5577-1/18/$31.00 ©2018 IEEE 372 25-28 Oct 2018, Iași, Romania

You might also like