Keywords

1 Introduction

DC motor has good starting and braking performance, which has been widely used in electric drag automatic control systems, such as rolling mills and their auxiliary machinery, mine hoists and other fields. In actual DC speed regulation system of industrial field, the DC speed regulation system is widely used with speed and current dual closed loop control.

Traditional DC motor dual closed-loop speed regulation system mostly adopts a simple structure with PID controller. While, parameter changing and non-linear characteristics of controlled object make it difficult for PID controller to reach optimal state. Fuzzy control dynamically output according to empirical rules with its nonlinear characteristics, it can overcome limitations of PID, so that, speed regulation system has both fast dynamic response and a high stability degree, its robustness is further improved.

In this paper, a DC motor PWM speed regulation system based on STM32 micro-controller is designed. Using closed-loop PWM control, its excellent performance can be further exerted, which can meet high need of load capacity and excellent driving ability.

2 System Framework

The requirement of common application scenarios of the motor is as: power supply voltage is 72 V, motor voltage is 60–72 V, power capacity is 1.5–3 KW, and the maximum speed is 50 km/h.

The structure of PWM DC motor speed regulation system based on STM32 is shown in Fig. 1.

Fig. 1.
figure 1

Flow block diagram of STM32 control system

By programming, it collects feedback signal of speed and current through AD converter on-chip, after signal processing, which is converted into control signal of PWM output. Changing duty cycle, feedback control is accomplished, thus, a dual closed-loop system of speed and current is finished.

By measuring the motor parameters, establishing mathematical model and calculating control loop parameters, PWM drive signal is generated. While, with the development of micro-controller and computer control algorithms, a series of improved PID algorithms have been generated, such as integral separation PID, positional PID, Fuzzy-PID, which are more flexible and stable than traditional PID.

Considering motor forward/reverse rotation and braking needs, H-bridge drive circuit is adopted, which is a high-voltage and high-current full-bridge driver, and used to drive DC or stepper motor.

In order to overcome disadvantages of speed loop, and obtain better dynamic performance, by embedding current control loop in the speed loop, and integrate armature current in closed loop as a feedback model, the speed and current dual closed-loop control system is obtained.

3 Modeling and Analyzing of Dual Closed-Loop

Analyzing motor working process and state parameters, the motor mathematical model is built with proper parameters, and the closed-loop parameters are optimized with simulation and experiments.

The motor parameters are shown in Table 1.

Table 1 Parameters of motor.

3.1 Dual Closed-Loop Control System

The motor is modeled with parameters in Table 1.

$$T_{L} = {L \mathord{\left/ {\vphantom {L R}} \right. \kern-\nulldelimiterspace} R}$$
(1)
$$T_{m} = {{GD^{2} R} \mathord{\left/ {\vphantom {{GD^{2} R} {375K_{e} C_{m} }}} \right. \kern-\nulldelimiterspace} {375K_{e} C_{m} }}$$
(2)
Fig. 2.
figure 2

Mathematical model of the motor

In open-loop model, current can reach 62 A during start-up stage, in direct start type. the overcurrent phenomenon is obvious, which can easily damage devices. The reason is that motor armature is in a static state, and armature winding directly connect to the power, which cause to short circuit and a large instantaneous current, so it is necessary to add a starting resistance to reduce current at start-up.

Given 1000 r/min, building model in Fig. 2, and running simulation 0.5 s under rated load and positive rotation, the speed and armature current are obtained as in Fig. 3 and Fig. 4

Fig. 3.
figure 3

Speed waveform

Fig. 4.
figure 4

Armature current wave form

It can be seen that, starting time is about 0.05 s, starting speed acceleration is significantly reduced after 0.03 s, and then approaching final speed slowly. The motor has poor starting characteristics with open loop, and speed acceleration is constantly decaying throughout starting stage, which cannot reach constant acceleration. Motor current quickly jumps to 62 A, and then falls sharply, the reason is that induced electromotive force is generated under armature winding magnetic field to reduce the current. Such sharp change of torque is demonstrated in large decay, but also caused sharply reducing speed acceleration, so that the motor cannot maintain a constant torque during start-up stage, the start-up characteristics are poor.

So, the feedback is divided into current and speed dual feedback loop control, and the STM32F103 is selected for digital controller. Figure 5 shows steady-state structure diagram of dual closed-loop speed regulation system. If trigger requires output of ACR (UCT) to be positive, the input Ui* of ACR is negative for regulator is reverse input, so voltage Un* of the ASR input is required to be positive.

Fig. 5.
figure 5

Dual closed-loop control schematic

Fig. 6.
figure 6

Dual closed-loop control speed characteristics

The current loop is a closed loop composed of current regulator ACR and current negative feedback, which is aim to stabilize current. The speed loop is a closed loop composed of speed regulator ASR and negative speed.

The working process of dual closed-loop speed regulation system can be simply divided into two stages. First, in start-up stage, for given sudden adding step signal \(U_{n}^{*}\) due to mechanical inertia, speed deviation voltage \(U_{n}\) is extremely large, speed regulator ASR is rapidly saturated, and output reaches limit value \(U_{im}^{*}\) and hold. Meanwhile, current negative feedback loop keeps armature current constant and speed rises linearly, as shown in Fig. 6. Then, after speed reaches a given value and overshoot is generated, difference between fixed signal of speed loop and the feedback signal crosses 0-point polarity transition, speed remains constant, that is, n = Un*/.

The speed and current feedback coefficient can be calculated respectively by formula

$$\alpha = {{U_{nm}^{*} } \mathord{\left/ {\vphantom {{U_{nm}^{*} } {n_{\max }^{{}} }}} \right. \kern-\nulldelimiterspace} {n_{\max }^{{}} }}$$
(3)
$$\beta = {{U_{im}^{*} } \mathord{\left/ {\vphantom {{U_{im}^{*} } {I_{dm}^{{}} }}} \right. \kern-\nulldelimiterspace} {I_{dm}^{{}} }}$$
(4)

where, \(U_{nm}^{*}\) and \(U_{im}^{*}\) are given output maximum and limit value of speed loop, respectively.

The transfer functions of dual closed-loop speed regulation system are

$$W_{{{\text{ASR}}}} = K_{n} \cdot {{\left( {1 + \tau_{ns} } \right)} \mathord{\left/ {\vphantom {{\left( {1 + \tau_{ns} } \right)} {\tau_{ns} }}} \right. \kern-\nulldelimiterspace} {\tau_{ns} }}$$
(5)
$$W_{{{\text{ACR}}}} = K_{i} \cdot {{\left( {1 + \tau_{is} } \right)} \mathord{\left/ {\vphantom {{\left( {1 + \tau_{is} } \right)} {\tau_{is} }}} \right. \kern-\nulldelimiterspace} {\tau_{is} }}$$
(6)

3.2 Simulation of Motor PID Dual Closed-Loop Model

The closed-loop motor is constructed with above parameters, and 4 s simulation is carried out for given rated load is 1000 r/min, and the load disturbance of (\(\pm\))5 \({\text{N}} \cdot {\text{m}}\) is added at 1 s and 1.75 s respectively, results shown in Fig. 7 are obtained.

Fig. 7.
figure 7

Closed-loop perturbation waveform

It can be seen that armature current in start-up stage quickly reaches 2 times rated current value and then hold. Thus, the goal of rapid adjustment of motor speed is achieved, which ensure good motor start-up characteristic, realize constant torque start-up.

4 Fuzzy-PID Design and Simulation

DC motor itself is a nonlinear system, in order to simplify calculation and design, so linear approximation is adopted. However, when it comes to more complex nonlinear changes of system, and it cannot be better adjusted real-time. In order to further improve control system performance, fuzzy PID control is introduced to strengthen system control capabilities.

The basic fuzzy control system is shown in Fig. 8. The implementation process of the fuzzy control algorithm is as follows: As an input signal of fuzzy controller, error E between given signal and feedback, can be converted to fuzzy variation by fuzzy language, and then fuzzy subset is judged by control rules to obtain fuzzy control variation u, at last de-fuzzy processing is utilized to obtain precise control amount U.

For difference application, input of fuzzy controller can be expanded into multiple variations, to achieve desired effect.

Fig. 8.
figure 8

Fuzzy control basic schematic

The fuzzy rule base provides the necessary definitions of fuzzy control, including the discretization, quantization, and normalization of the domain of language control rules, as well as the division of input and output spaces, the definition of membership functions, and so on.

In this fuzzy control system, speed feedback signal change quickly during start -up stage, so input set are expanded to 7 states: {Negative Large, Negative Medium, Negative Small, Nero, Positive Small, Mid, Positive Large}.The basic domain of error E, error change EC and fuzzy controller output are [-xe, xe], [-xec, xec] and [-ye, ye], respectively. Conversing basic domain [a, b] to fuzzy domain [-n, + n] is

$$y = {{2n} \mathord{\left/ {\vphantom {{2n} {(b - a)}}} \right. \kern-\nulldelimiterspace} {(b - a)}} \cdot \left[ {x - {{(a + b)} \mathord{\left/ {\vphantom {{(a + b)} 2}} \right. \kern-\nulldelimiterspace} 2}} \right]$$
(7)

The membership function is determined by expert’s empirical method, lastly, triangular membership function is adopted. After analyzing with expert experience, control rules of the dual-input, single-output system are determined. Add the fuzzy controller to closed-loop control, we can to obtain simulate as Fig. 9.

Fig. 9.
figure 9

Fuzzy-controlled PID closed-loop control

The PID dual closed-loop control and fuzzy PID control model are simulated synchronously. Given 1000 r/min, (\(\pm\)) 5 \({\text{N}} \cdot {\text{m}}\) load disturbance is added at 1 s, and the duration time 1 s.

Fig. 10.
figure 10

Omparision of RPM

Fig. 11.
figure 11

Burst load disturbance RPM

It can be seen from Fig. 10 and Fig. 11, that linear time of constant torque is longer under fuzzy control, the starting speed is faster without overshoot, which is better than traditional PID control. When sudden load (reduce) disturbance appear, motor response is more rapid under fuzzy control, speed change amplitude and rate are smaller, and dynamic anti-interference performance is strength.

Whether it is the start-up or anti-interference performance, fuzzy control system performance is better than traditional PID control, which has stronger regulation performance, speed variation is smaller, response speed is faster, and dynamic performance is greatly improved.

5 Conclusion

In this paper, a kind of DC motor dual closed-loop PWM full-bridge PID control system based on STM32 is designed. System current overshoot is less than 10%, speed overshoot is less than 20%, and reaches steady-state without static error, constant torque start-up, which has good anti-interference performance, can meet expected household power drag scenario. Further improving system performance, so that control system can meet demand for power dragging application. To improve DC motor performance, fuzzy control method is adopted to dual closed-loop PID control system, experimental results show that fuzzy controller designed makes system performance improved, which has better start-up characteristics without steady state error and overshoot, and digital fuzzy control system improves system anti-interference performance.