Open access peer-reviewed chapter

Embedded Control of the DC Drive System for Education

By Marian Gaiceanu

Submitted: September 12th 2016Reviewed: January 12th 2017Published: May 3rd 2017

DOI: 10.5772/67461

Downloaded: 839

Abstract

Taking into account the spread use of the DC motor in robotics, the main objective of the chapter is to promote the knowledge regarding the development of the DC drive system, in didactical manner. Basically, for one motor control the cascaded loop DC drive system is used. Numerical implementation of the DC drive system based on Z-transform discrete method is provided. The electrical drive supposes both control types: the torque and speed. The feedback signals of the control loops are provided by using incremental encoder and of an original load torque estimator. Based on the DC motor dynamics, the appropriate parameters of the speed and torque controllers are provided automatically. On line parameters estimation of the DC motor can assure the performances of the DC drive controllers. The symmetrical and modulus optimum criteria are used. In order to prove the feasibility of the proposed solution, the entire Matlab script of the cascade control of the DC drive is provided. The strategy of the cascaded loop control at constant flux is divided into dynamic regime and into steady state regime. The chapter strategy follows two directions: the first, knowledge developments, the second, the applicative research through the real time implementation.

Keywords

  • Arduino
  • Matlab®
  • Simulink
  • H‐bridge
  • DC motor
  • speed control
  • torque control
  • load torque estimator
  • discrete control system synthesis
  • Z‐transform

1. Introduction

The chapter is addressed to researchers, students, and the users of industrial power converters and electric drives or mechatronics. The chapter contains the mandatory theoretical aspects and methods in order to develop successful DC drive system, being the most used in mechatronics applications. Upon implementing the proposed chapter applications, the readers will have the capability to develop own electric drive system, to bring the idea in practice very fast, and for better understanding of using the drive systems being open to add own contributions in the mechatronics field. The chapter contains the basic concepts and techniques to design, simulate, and implement an electric drive system through a well‐structured technical guide. By completing this chapter, the researchers will be familiarized with applying the concepts and techniques to manage adequately an electric drive system, widely found in industry and in mechatronics projects. The chapter strategy follows two directions: first, the theoretical approach (a practical discretization method is provided), and the second, the applicative research (numerical simulations and real‐time implementations are provided). The chapter contains a high level of the cross‐disciplinarily: electric machines, power electronics converters, Matlab/Simulink, real‐time implementation, electrotechnics, measurements, and advanced control techniques.

In Section 2, an overview of the adjustable DC drives is given with the purpose to point out the development trend in the technology. In the next section, the dynamical equations of the DC drive system are provided. Section 4 contains the design of the rotor current and speed controllers. The load torque estimator is described in Section 5. Section 6 comprises the energetically model of the DC drive. Based on the on-line parameters identification procedure [1] the energy balance of the DC drive is performed and the appropriate energetic model is deducted in the Section 6 [2]. The optimal control based on linear quadratic controller is designed in the Section 7. The numerical approach by using Z‐transform is provided in Section 8, and the simulation results are provided in Section 9. The real‐time implementation of the speed control is included in Section 10. The conclusions of the chapter are placed in Section 11. The entire Matlab script is provided.

2. Overview of the DC drives

The DC machine can be controlled by using power converters. At low speed, the DC drives are very often used. There are two mainly control techniques: armature voltage control (constant torque region) and field current control (constant power region). The armature voltage control is obtained by maintaining constant field current and the field current control by maintaining the constant armature voltage [3].

3. The mathematical model of the DC drive system

Under certain hypotheses, the mathematical model of the DC machine could be obtained in state space form.

Supposing a constant value of the DC motor parameters, the DC machine has the compensated winding, the magnetic flux maintained at the constant value, the state space mathematical model of the DC machine becomes as follows [2]:

[dn(t)dtdiA(t)dt]=[FvJCmcJCeTARA1TA][n(t)iA(t)]+[01TARA]u(t)+[1cJ0]TL(t)E1

in which J is the reduced inertia moment to the electric motor shaft, TA , the armature time constant, RA , the armature resistance, and the specific constants

ct=π30,Cm=kϕ,Ce=ctCm,E2

in which k is the DC motor constant.

The state vector of the DC machine contains two states, x(t)=[n(t)iA(t)], the control vector is only the rotor voltage u (t) = u A (t), the perturbation vector is the load torque w(t) = TL (t), and the output of the DC motor is the speed y(t) = n(t). Under these circumstances, the mathematical model of the DC motor becomes

x˙(t)=Ax(t)+Bu(t)+Gw(t)y(t)=Cx(t),.E3

Taking into consideration the above mentioned hypothesis, the mathematical model of the DC motor Eq. (1) is linear and invariant.

In order to obtain variable speed, there are two topologies of the power converters for DC motor applications: ac‐dc and dc‐dc. The mathematical model of the power converter, under certain conditions (continuous conduction, neglecting the voltage drop in conduction mode), represents an ideal power amplifier kD [2].

4. The cascaded loop control of the DC drive system

The DC drive contains two control loops: the inner—the armature current loop and the outer—the speed loop, Figure 1 [2]. Therefore, the control is in cascaded manner. The current feedback is delivered through an adequate current sensor and the speed feedback is obtained based on numerical derivative of the encoder signals. The desired speed is set as reference signal from a potentiometer. Due to the higher power necessity, the dc‐dc four quadrants power converter is added. Therefore, by means of the DC voltage control of the DC machine, the torque and speed are adequately adjusted according to the references. The parameters of the current regulator are obtained by using the modulus criterion, and the parameters of the speed controller are delivered by using the symmetrical optimum criterion (Kessler version).

Figure 1.

Block diagram of the digital DC speed cascaded control.

By taken into account the 10 (V) voltage unified system, the transfer function of the proportional‐integral (PI) current controller is expressed as

HRI(s)=k3+k4sE4

with the following parameters [2]:

k3=TRAA2TΣIkDkI,k4=RA2TΣIkDkIE5

where:

  • kD=UN10, transfer function of the dc‐dc power converter;

  • kI=10IAmax[VA], attenuation factor of the current transducer;

  • TΣI=TIthe sum of the parasitic time constant of the current loop is determined by the time constant of the current transducer.

The transfer function of the PI speed controller has the form:

HRT(s)=k1+k2sE6

the parameters of the speed controller [2] being deducted from symmetrical optimum criterion:

k1=kIcJ2TΣNCmkTE7
k2=kIcJ8TΣN2CmkTE8

in which:

  • kT=10nN[Vrpm], attenuation factor of the speed transducer;

  • TΣN=2TΣI+TN, the sum of the parasitic time constants of the speed loop, TN being the time constant of the speed transducer.

5. Load torque estimator

In Figure 2 , the operational model of the load torque estimator [4, 5] is shown. The calculus of the load torque estimator parameters is based on the imposed performances: desired pulsation ω0*, and the desired overshoot ξ*, respectively:

τ=2ξ*ω0*E9
c=2ξ*ω0*.E10

Figure 2.

The second‐order load torque estimator [2].

6. The energetically model of the DC drive

Based on the mathematical model of the DC machine Eq. (1), the energetic model has been deducted ( Figure 3 ) [2], in which T o is the mechanical friction torque, T Fv—the viscous force equivalent torque, T f—the Foucault currents losses equivalent torque, and T H—the hysteresis losses equivalent torque.

Figure 3.

The energetic model of the DC machine.

By using the electrical and mechanical equations of the DC motor at the constant flux, the energetic components of the DC drive are obtained:

uA(t)=RAiA(t)+LAdiA(t)dt+e(t)+Δup(t)E11
Te(t)=TL(t)+FvΩ(t)+JdΩ(t)dt.E12

By multiplying Eq. (11) with iA(t) term, and Eq. (12) with Ω(t), the power balance of the DC drive can be obtained. In this way, the specific power components are obtained:

  • The electrical power

    P1(t)=uA(t)iA(t)E13

  • Different expressions of the electromagnetic power

    P(t)=Te(t)Ω(t)=CmiA(t)Ω(t)=e(t)iA(t)E14

  • The rotor copper power losses

    Pcu=RAiA2(t)E15

  • The accumulated power in the rotor inductance

    PL=LAiA(t)diA(t)dtE16

  • The brush power losses

    Pp(t)=Δup(t)iA(t)E17

  • The mechanical power

    Pu(t)=TL(t)Ω(t)E18

  • The accumulated power in the rotational masses

    Pj=JΩ(t)dΩ(t)dtE19

  • The viscous power losses

    Pf(t)=TfΩ(t)E20

The magnetization frequency of the rotor ferromagnetic core is

f=pΩ(t)2π.E21

At the constant flux, the total core losses are

pFe=kHf+kFf2E22

or by

pFe(t)=kH'Ω(t)+kF'Ω2(t).E23

Taking into consideration the deducted magnetic core losses Eq. (23), the corresponding equivalent torque is as follows

TFe(t)=PFeΩ(t)=kH+kFΩ(t)E24

or denoted by:

TFe(t)=TH(t)+TF(t).E25

The mechanical losses are constant. Therefore, the corresponding torque is as follows:

T0(t)=P0Ω(t).E26

By applying the Laplace transform to Eqs. (11) and (12), the electromechanical model of the DC motor at constant flux is obtained:

UA(s)E(s)ΔUp(s)=RAIA(s)+sLAIA(s)E27
T(s)=TL(s)+T0(s)+TH(s)+TF(s)+Tf+sJΩ(s)E28

Based on Eqs. (27) and (28), the energetic operational model of the DC motor is obtained as in Figure 3 [2].

6.1. Estimation of the DC drive losses components

By using zero‐order hold, the numerical energies are calculated as a sum of the local areas: i=0NViT(N the maximum sampling interval with constant sampling time T).

The losses in the rotor windings at the k‐th sampling time are as follows:

ΔPCu(kT)=RAIA2(kT),E29

and the total rotor copper energy over the control interval can be deducted as

ΔWCu=i=1NRAIA2(iT)T.E30

In the same way, the following energies are calculated:

  • The input energy of the DC motor

    WP1=i=1NU(iT)IA(iT)TE31

  • The accumulated energy in the rotor inductance

    ΔWL=i=1NLAIA(iT)[IA(iT)IA((i1)T)]E32

  • The accumulated energy in the rotational mass

    ΔWJ=i=1NJΩ(iT)[Ω(iT)Ω((i1)T)]E33

The brush, the mechanical, and the core losses have been ignored.

By knowing the above mentioned energies, the output energy could be calculated:

Wout=WP1ΔWCuΔWLΔWJE34

By using the same methodology, the losses of the power converter and the transformer are obtained.

7. Linear quadratic control

The DC machine operates at maximum efficiency at rated operating point, therefore, in steady state. During transient regime, the copper losses component is the higher loss in the DC machine. In order to reduce the power losses in DC drive, the optimal control block diagram is proposed. The proposed solution combines the advantages of the conventional cascaded control (PI) and optimal control [6, 7]. The designed software switch goes in position 1 when the speed error is zero, otherwise goes in position 2 ( Figure 4 ).

Figure 4.

Optimal control system of the DC motor at constant flux.

7.1. Problem formulation

The problem statement of the optimal control supposes a design of the performance index (functional cost). By minimizing the functional cost, the optimal control solution is obtained without any constraints. The optimal control limits are controlled by introducing the weighting matrices [6, 7]. The objectives of the optimal control include the objectives of the conventional drive system (regulation, stability assurance, and robustness to perturbations) and the energy reduction.

The gate drive control is denoted by GDC, the voltage control by uc ( Figure 4 ), the load torque estimator by TL estimator block, the tacho generator by TG, the imposed speed reference and the imposed firing angles. The switch is toggled between position 1 (for conventional control) and fixed position 2 (for optimal control). The conventional control is activated during the steady‐state regimes, and the optimal control is activated during transients (starting, stopping, and reversing regimes).

In order to control the DC motor in an optimal manner ( Figure 5 ), the adopting functional cost is with infinite time horizon:

J=120[xT(t)Qx(t)+uT(t)Ru(t)]dt.E35

Figure 5.

The optimal DC drive system.

By minimizing the adopted performance function, the optimal control is delivered:

u*(t)=R1BTKx(t),E36

in which the symmetrical gain matrix K:

K=[k11k12k21k22]>0,E37

is the solution of the algebraic Riccati equation (ARE):

KA+ATKKBR1BTK+Q=0.E38

8. Numerical implementation of the DC drive system

The continuous signals are converted into digital format by using sampling and hold stages. The reversibility takes place through the digital‐to‐analog converters (DACs), that is, the digital signals are converted into continuous ones.

The properties of the zero‐order hold are to maintain the captured signal at the constant value over the entire sampling period. Therefore, the obtained transfer function is

Hzoh(s)=1esTs.E39

8.1. Mathematical model of the digital current control loop

In Figure 6 , the block diagram of the numerical model of the current loop is shown [2].

Figure 6.

The armature current control loop.

The switch symbol from Figure 6 represents the sampling and hold process, T being the sampling time.

The transfer between the “s” plane and “Z” one is made by using the Z‐transform. By using the transfer function of the zero‐order hold, the discrete transfer function could be obtained according to

HFI(z1)=Z[HEOZ(s)HFI(s)]E40

or in the other form

HFI(z1)=Z[1esTs11+sTFI].E41

Taking into account that z=esT, the discrete transfer function Eq. (41) becomes

HFI(z1)=1z1TFIZ[1s(s+1TFI)].E42

Taking into account the residuum theorem of the simple poles, the Z‐transform can be calculated as

HFI(z1)=1z1TFI[11TFI11z1eT0+11TFI11z1eTTFI].E43

By the other side:

HFI(z1)=IFI*(z1)IA*(z1).E44

By taking into consideration Eqs. (43) and (44), the following recurrent relation is obtained

IFI*(k)=IFI*(k1)eTTI+IA*(k1)(1eTTI).E45

By starting from the current transducer transfer function

IR(s)IA(s)=kI1+sTIE46

a similar recurrent equation for the current feedback is obtained:

IR(k)=IR(k1)eTTI+IA(k1)(1eTTI)k.IE47

The discrete implementation of the current controller

HRI(s)=k2+k4s,E48

is made by using in the similar manner as for the current filter and using the linearity propriety of the Z‐transform

HRI(z1)=k3(1z1)Z[1s]+k4(1z1)Z[1s2].E49

On the other hand

HRI(z1)=UC(z1)IFI*(z1)IR(z1).E50

Taking into account the Z‐transform table, and using Eqs. (49) and (50), the digital implementation of the current regulator is

Uc(k)=Uc(k1)+k3[IFI*(k)IR(k)]+(k4Tk3)[IFI*(k1)IR(k1)].E51

Taking into consideration the dc‐dc power converter ideal amplifier model, the rotor voltage is obtained:

uA(k)=kDuc(k).E52

By taken into consideration one of the following equations, the output signal of the rotor current loop is obtained:

  • By neglecting the electromotive voltage

    IA(k)=IA(k1)eTTA+uA(k1)(1eTTA)1RAE53

  • By considering the electromotive voltage

    IA(k)=IA(k1)eTTA+[uA(k1)CeN(k1)](1eTTA)1RA.E54

8.2. Mathematical model of the digital speed control loop

In Figure 7 , the block diagram of the digital speed control loop is shown, in which the equivalent closed loop transfer function of the armature current control is replaced by current loop block.

Figure 7.

The speed control loop.

Taking into consideration the block diagram shown in Figure 7 , in the similar manner, the digital implementation of the speed loop is obtained.

Therefore, the imposed filtered speed is

NFT*(k)=NFT*(k1)eTTFT+N(k1)(1eTTFT).E55

The digital equation of the recurrent feedback speed is

NR(k)=NR(k1)eTTT+N*(k1)(1eTTT)kT.E56

The speed controller for numerical implementation is as:

IA*(k)=IA*(k1)+k1[NFT*(k)NR(k)]+(k2Tk1)[NFT*(k1)NR(k1)],E57

with the obtained numerical signal of the speed feedback

N(k)=N(k1)+TcJ[CmIA(k1)TL(k1)].E58

By organizing the numerical equations in the specified order Eqs. (55)(57), (45), (47), (51)(53), (58), the digital representation of the DC drive system is obtained.

9. Numerical simulation results

Taking into consideration the following DC motor of 12 W, 12 V/1 A, 90 r.p.m. at rated load torque of 1.37 Nm, the cascaded control loops are implemented in Matlab by using the deducted numerical equations. The following numerical results have been obtained.

In Figure 8 (left side), the dynamic mechanical characteristic for a starting under different load torque variation ( Figure 8 , right side) is shown. At the same time, in Figure 9 , the implemented load torque estimator result is presented.

Figure 8.

Mechanical characteristic of the DC motor (left side). Real (step signal) and the estimated load torque (delayed signal).

Figure 9.

The control signals of the DC drive.

Based on the above mentioned digital implementation and taking into consideration that the DC drive is formed by two parts, control and power, the following simulation results are obtained. Therefore, on the control side, there are only analog voltages ([0–10] V unified system) ( Figure 9 ). On the power side, the real signals are shown ( Figure 10 ). In Figure 9 , the following DC dive signals are shown: the filtered speed reference (nfilter), the feedback speed (Nfbck), the output of the speed controller (i.e., the reference of the rotor current, ref. rotor current), and the filtered rotor current reference (Ifilter).

Figure 10.

The power signals of the DC drive.

On power side, the real values of the DC drive signals are presented: the rotor voltage (Ua), the rotor current (Ia), the controlled feedback speed as the output signal of the DC drive (n), and the load torque signals (the real, TL and the estimated, TLe). The more accurate estimator performances are presented on the [0.4–0.8]s time interval, in Figure 11 .

Figure 11.

The performances of the second‐order load torque estimator.

10. Real‐time speed control

Based on the Arduino platform, the conventional control of the DC drive system is implemented in real time ( Figure 12 ). It consists of the cascaded control, on‐line estimation of the DC motor parameters ( Figure 13 ) based on the recursive least squares method [1], and real‐time estimation of the load torque ( Figure 14 ) [2]. The speed feedback is assured by using an incremental encoder [8]. In order to improve the speed response of the DC drive system, a feedforward additional voltage component has been introduced, as in Figure 15 [9]. In Figures 16 18 , the build s‐function and the associated Simulink blocks for speed and position calculus from the encoder signals are shown.

Figure 12.

The embedded DC drive cascaded control.

Figure 13.

The on‐line estimator of the DC motor.

Figure 14.

The second‐order load torque estimator.

Figure 15.

The feedforward control voltage component.

Figure 16.

The s‐function block of the encoder [8].

Figure 17.

The calculus of the DC rotor position [8].

Figure 18.

The numerical derivation of the position [8].

The appropriate Matlab functions [1] from Figure 13 are delivered as follows:

function tetael=cmmp_el(in)

global tetael_an Pel_an lambda_el Kfi T

y=in(1)‐Kfi*in(4);

fi=[in(2);(in(2)‐in(3))/T];

L=(Pel_an*fi)/(lambda_el+fi'*Pel_an*fi);

tetael=tetael_an+L*(y‐fi'*tetael_an);

Pel=(Pel_an‐(Pel_an*fi*fi'*Pel_an)/(lambda_el+fi'*Pel_an*fi))/lambda_el;

tetael_an=tetael;

Pel_an=Pel;

function tetamec=cmmp_mec(in)

global tetamec_an Pmec_an lambda_mec alpham denumm Pm Kfi T

y=Kfi*in(2);

fi=[(in(4)‐in(5))/T;1;in(4)];

denumm=(lambda_mec+fi'*Pmec_an*fi);

L=(Pmec_an*fi)/denumm;

alpham=(y‐fi'*tetamec_an);

tetamec=tetamec_an+L*alpham;

Pm=L*fi'*Pmec_an;

Pmec=(Pmec_an‐Pm)/lambda_mec;

tetamec_an=tetamec;

Pmec_an=Pmec;

By applying the numerical derivative of the position adapted to gear ratio the real speed value is obtained ( Figure 19 ).

Figure 19.

The DC drive platform.

11. Conclusions

This chapter is designed in the didactical manner that allows students and researchers to implement autonomously the mechatronic projects based on the DC drive. Starting from the nameplate data of the DC motor, the provided Matlab software has the ability to calculate the DC motor parameters, the parameters of the current and speed controllers, and includes the numerical implementation of the DC motor cascaded control, energy balance and of the load torque estimator. The price of the proposed DC drive is down due to the fact that the load torque is very expensive and it is replaced by the load torque estimator. By using the Z‐transform, the procedure of numerical control is implemented. The implementation of the digital filters and controllers are also provided. Numerical simulations confirm the accuracy of the proposed DC drive discretization method. Moreover, the real‐time control based to Arduino platform has been performed. In order to increase the DC drive performances, the on‐line estimator of the DC motor parameters is provided, and the feedforward control voltage component has been added.

Acknowledgments

This work was supported by a grant of the Romanian National Authority for Scientific Research, CNDI–UEFISCDI, project number PN‐II‐PT‐PCCA‐2011‐3.2‐1680.

% CONVENTIONAL AUTOMATION OF THE DIRECT CURRENT MOTOR

clear;clf;

%        DC DRIVE SYSTEM

% Nameplate Data

%  ‐Rated Power

     Pn=12    %W

%  ‐Rated Voltage

     Un=12     %V

%  ‐Rated Speed

     nn=90     %rot/min

%  ‐moment of inertia

   Jt=0.02    %kgm^2

   J=Jt;

%  ‐Rated efficiency

     etan=0.86 %

% Main data calculus

%  ‐Electrical Power(input)

     P1=Pn/etan  %W

%  ‐Rated current

     Ian=P1/Un  %A

%  ‐DC motor losses

     deltap=P1‐Pn  %W

%   ‐Rated winding losses

      pcun=deltap/2  %W

%  ‐Rotor resistance

     Ra=pcun/(Ian^2)  %ohmi

%  ‐Electromagnetic Power

     P=Pn+deltap/2  %W

%  ‐Electromagnetic torque

     Mn=30*P/pi/nn  %Nm

%  ‐Mechanical constant

     kfi=Mn/Ian

     Cm=kfi

%  ‐Electrical constant

     kefi=pi*kfi/30

     Ce=kefi

%  ‐Electromotive voltage

     E=Ce*nn  %V

%  ‐Rotor resistance value check Ra

     Ra=(Un‐E)/Ian  %ohmi

%  ‐volant moment

     g=9.81;  % gravit. acc.

     GD2=4*g*Jt  %m^2

%  ‐Maximum torque

     Mmax=2*Mn  %Nm

%  ‐Maximum rotor current

     Iamax=Mmax/Cm  %A

%  ‐Electrical constant (from identification procedure)Ta

     Ta=7/(10^3)  %sec

%  ‐Rotor inductance

     La=Ta*Ra  %H

%  ‐Load torque

     Mr=1*Mn;  %Nm

     k=pi/30;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%        Current loop‐ tuning of the controller parameters

%    (modulus criterion ‐ KESSLER variant)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%current transducer

%%%%%%%%%%%%%%%%%%%%

%  ‐for DC motor

     ka=1/Ra  %(1/ohmi)

%  ‐attenuation factor of the current transducer

     ki=10/Iamax  %(V/A)

%  ‐Current transducer time constant

     Ti=0.003  %sec

%%%%%%%%%%%%%%%%%%%%%%

%DC‐DC Power Converter

%%%%%%%%%%%%%%%%%%%%%%

%  ‐gain factor

     kd=Un/10

%%%%%%%%%%%%%%%%%%%%%%%

% PI Current Controller

%%%%%%%%%%%%%%%%%%%%%%%

%  ‐sum of the parasitic constant of the current loop

     Tsi=Ti  %sec

%  ‐Proportional coefficient

     tau1=Ta  %sec

%  ‐gain factor

     k1=1/(2*Tsi*kd*ka*ki)

%  ‐Time constant of the current filter

     Tf1=Ti  %sec

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%        Speed loop‐ tuning of the controller parameters

%     (symmetrical criterion ‐ KESSLER variant)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%speed transducer

%%%%%%%%%%%%%%%%%%%%

%  ‐attenuation factor of the speed transducer

     kt=10/nn  %(V/r.p.m.)

%  ‐Time constant

     Tt=Ti  %sec

%  ‐gain factor of the mechanical inertia(1/s*Jt)

     kj=375/GD2;

%  PARAMETERS OF THE PI SPEED CONTROLLER

%  ‐sum of the parasitic constant of the speed loop

     Tst=2*Tsi+Tt  %sec

%  ‐Proportional coefficient

     tau2=4*Tst  %sec

%  ‐gain factor

     k2=ki/(kj*kt*Cm*8*(Tst^2))

%  ‐Speed time constant

     Tf2=Tt

%        NUMERICAL SIMULATION OF THE DC DRIVE SYSTEM

%  ‐ sampling time

     T=Ta/10;  %sec

%  ‐initial conditions

%  a)current loop

    Ir=0;  %A  %output signal of the current transducer

    If=0;  %A  %output signal of the current filter Ii

    U=0;   % V  % DC‐DC voltage

    Ia=0;  %A  % rotor current

%  b)speed loop

    Nf=0;  %r.p.m.  %output signal of the speed filter Ni

    Nr=0;  %r.p.m.  %output signal of the speed transducer

    Ni=10; % V  reference speed

    N=0;  %r.p.m.  real speed

    Ii=0;  %A  reference current ‐initial value

    t=0;  %sec  % initial time

    tf=1; %sec  %final time

    i=1;  %counter

%%%%%%%%%%%%%%%%%%%%%%%%%

%power balance estimation

%%%%%%%%%%%%%%%%%%%%%%%%%

   swcu=0;   %estimation of the copper losses

   swl=0;   %estimation of the accum. energy in the rotor inductance

   swj=0;   %estimation of the accum. energy in thea motion masses

   wpr=0;   %estimation of the input energy

   wp=0;

%%%%%%%%%%%%%%%%%%%%%%%

%Load torque estimator

%%%%%%%%%%%%%%%%%%%%%%%

T0=0.0024  %2*T;

zita=0.707;

Mre=0;  vt2=0;  vt4=0;

taue=2*zita*T0;

k2e=2*zita/kj/T0;

while (t<=tf),

   vtnf(i)=Nf;  %speed vector

   vtnr(i)=Nr;   vtii(i)=Ii;

   vtn(i)=N;    vtir(i)=Ir;

   vtif(i)=If;   vtu(i)=U;

   vtia(i)=Ia;   mre(i)=Mre;

% perturbation load torque wp

   mre(i)=Mre;

   mp(i)=wp;

   epsilon(i)=wp^2‐Mre^2;

   %output signal of the speed filter at the current step(k)

   Nfu=exp(‐T/Tt)*Nf+(1‐exp(‐T/Tt))*Ni;

   % speed feedback at the current step(k)

   Nru=exp(‐T/Tt)*Nr+kt*(1‐exp(‐T/Tt))*N;

  %output signal of the speed controller=reference of the rotor current(k)

   Iiu=Ii+k2*tau2*(Nfu‐Nru)+k2*(T‐tau2)*(Nf‐Nr);

   % allowable limits of the rotor current

   if Iiu>10,

      Iiu=10;

   elseif Iiu<‐10,

      Iiu=‐10;

     else

      Iiu=Iiu;

   end

  % filtered reference of the rotor current,at the current step(k)

   Ifu=exp(‐T/Ti)*If+(1‐exp(‐T/Ti))*Ii;

   %feedback rotor current (k)

   Iru=exp(‐T/Ti)*Ir+ki*(1‐exp(‐T/Ti))*Ia;

   % output of the current controller= rotor voltage (k)

   Uu=U+k1*kd*tau1*(Ifu‐Iru)+k1*kd*(T‐tau1)*(If‐Ir);

   %load torque estimator

   vt2u=vt2+T*kj*(Cm*Ia‐Mre‐vt4);

   Mreu=Mre+T*k2e*(vt2‐N)/taue;

   %rotor current(k)

   Iau=exp(‐T/Ta)*Ia+ka*(1‐exp(‐T/Ta))*(U‐Ce*N);

   wl(i)=La*Iau*(Iau‐Ia); %acum. en. in the L.rotor inductance.at the current sampling

   swl=swl+wl(i);   % acum.en. in the L.rotor through the starting period

   %rotor speed(k)

   Nu=N+kj*T*(Cm*Ia‐wp);

   vt4u=(vt2u‐Nu)*k2e;

   %load torque variation

   if t<=0.5,

    wp=0.5*Mr;

   elseif (t<=0.6) & (t>0.5),

      wp=0.3*Mr;

    elseif (t<=0.7) & (t>0.6),

      wp=0.8*Mr;

     elseif(t<=0.8) & (t>0.7),

         wp=1*Mr; %alfa*t;

   elseif(t<=0.9) & (t>0.8),

    wp=1*Mr;

   else

    wp=1*Mr;

   end

   % acum. en.in the rotational mass

   wj(i)=(k^2)*Jt*Nu*(Nu‐N);

   swj=swj+wj(i);

   %energy estimation

   pcu(i)=Ra*(vtia(i)^2);  % copper power losses

   swcut(i)=pcu(i)*T;  % energy losses at each sampling time

   swcu=swcu+swcut(i);  % rotor energy losses

   pr(i)=vtu(i)*vtia(i);  % the input electrical power

   wpr=wpr+pr(i)*T;  % the input energy

   Nf=Nfu;   Nr=Nru;   Ii=Iiu;

   N=Nu;

   Ir=Iru;   %Ir(k‐1)

   If=Ifu;   %If(k‐1)

   U=Uu;   %U(k‐1)

   Ia=Iau;   %Ia(k‐1)

   Mre=Mreu;   vt2=vt2u;   vt4=vt4u;

   t=t+T;   % simulation time increment

   i=i+1;   % counter increment

  end

  wu=wpr‐swcu‐swl‐swj % DC motor output poweren.

  eta=wu/wpr; %the efficiency of the DC drive

figure(1)

t=0:T:tf;

  plot(vtia*Cm,vtn,'b','LineWidth',3)

  title('electromechanical characteristic','FontSize',12)

  xlabel('electromagnetic torque[Nm]','FontSize',12)

  ylabel('speed [rot/min]','FontSize',12)

  grid

  fprintf('vizualizati caracteristica mecanica')

figure(2)

  %t=0:T:tf‐T;

  t=0:T:tf;

  subplot(2,2,1);

  %plot(t,vtnf(1:length(t)),'c','LineWidth',3)

  plot(t,vtnf,'b','LineWidth',3)

  title('nfilter=f(t)','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('Nf [r.p.m.]','FontSize',12)

  grid

  subplot(2,2,2);

  plot(t,vtnr,'y','LineWidth',3)

  title('Nfbck=f(t)','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('Nfbck [r.p.m.]','FontSize',12)

  grid

  subplot(2,2,3);

  plot(t,vtii,'r','LineWidth',3)

  title('ref. rotor current','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('Ia* [A]','FontSize',12)

  grid

  subplot(2,2,4);

  plot(t,vtif,'k','LineWidth',3)

  title('Ifilter=f(t)','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('filtered Ia*[A]','FontSize',12)

  grid

figure(3)

  subplot(2,2,1);

  plot(t,vtu,'b','LineWidth',3)

  title('Rotor Voltage','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('Ua[ V ]','FontSize',12)

  grid

  subplot(2,2,2);

  plot(t,vtia,'y','LineWidth',3)

  title('Ia=f(t)','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('Ia [A]','FontSize',12)

  grid

  subplot(2,2,3);

  plot(t,vtn,'r','LineWidth',3)

  title('n=f(t)','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('speed [r.p.m.]','FontSize',12)

  grid

  subplot(2,2,4);

  plot(t,mp,'r',t,mre,'k','LineWidth',3)

  title('TL =f(t),TLe =f(t)','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('TL, TLe[N*m]','FontSize',12)

  grid

  fprintf('vizualizati fig.2')

figure(4)

  t=0:T:tf;

  %subplot(1,2,1);

  plot(t,mp,'r',t,mre,'k','LineWidth',3)

  title('TL =f(t),TLe =f(t)','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('TL, TLe[N*m]','FontSize',12)

  grid

  fprintf('vizualizati fig.3')

figure(5)

  t=0:T:34*T;

  i=1:35;

  subplot(1,2,1);

  plot(t,mp(i),'r','LineWidth',3)

  title('Mr =f(t)','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('Mr [N*m]','FontSize',12)

  grid

  subplot(1,2,2);

  plot(t,mre(i),'g','LineWidth',3)

  title('Mr^ =f(t)','FontSize',12)

  xlabel('time[sec]','FontSize',12)

  ylabel('Mre [N*m]','FontSize',12)

  grid

  fprintf('vizualizati fig.4')

  %energy components

  swcu %copper losses

  wpr %input energy

  swl %accum. Energy in rotor inductance Lrotor

  swj %accum. Energy in rotational mass

  eta %efficiency during starting

  omn=1/T0

  tr=‐log(0.05*sqrt(1‐zita^2))/zita/omn

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Marian Gaiceanu (May 3rd 2017). Embedded Control of the DC Drive System for Education, Design, Control and Applications of Mechatronic Systems in Engineering, Sahin Yildirim, IntechOpen, DOI: 10.5772/67461. Available from:

chapter statistics

839total chapter downloads

1Crossref citations

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

Remote Laboratories for Teaching and Training in Engineering

By Jesús García-Guzmán, Farah H. Villa-López, Jorge A. Vélez-Enríquez, Luz A. García-Mathey and Alfredo Ramírez-Ramírez

Related Book

Frontiers in Guided Wave Optics and Optoelectronics

Edited by Bishnu Pal

First chapter

Frontiers in Guided Wave Optics and Optoelectronics

By Bishnu Pal

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us