Trapezoidal Profile for a de Motor
ih many applications we want to accelerate the motor to a desired speed and allow it to ru
at that-speed for some time before decelerating to a stop. Investigate whether an appli
‘. – voltage having a trapezoidal profile will accomplish this. Use the values R = 0.6 Q.,
L = 0.002 H, Kr = 0.04 N· miA, K. = 0.04 V· s/rad, c = 0, and I = ~x JO-s kg· m~
The applied voltage in volts is given by
{
lOOt 0::5 t < 0.1
JO 0.1 < t < 0.4
vet) = -100(1 – 0.4) + JO 0.4:; t ~ 0.5
,0 t > 0.5
•• This function Is shown in the top graph in Figure 8.6-6 .
j.
• Solution
First find the time constants using the .eig function. Use the following script file:
‘,R = O.o;L = 0.002;c = 0rJ I
K_T =.0.04;K_e = 0.04;1 = 6e-5;
A = [-R/L, -K_elL;” K,51I, ,-CIl];’ •.
% compute the characteristic roots and
disp(‘The characteristic roots are:’)
eig(A) 10′
disp(‘The time constants are:’j
-l./real(e~g(b)}·
time constants.
The roots~ s = ~”245.7427 and s = -54.2573. The time constants are T) = 0.0041
. and’ T2.=,fOI-8’4 s:the largest time CU!l~arit’indicates that the motor’s response time is
approximately 4(0.0184) = 0.0736 t:&c;ause this time is less than the time needed for
the applied voltage to reach 10.V, the motor should be able to follow the desired trapezoidal
profile reasonably-well. To know for certain. we must solve the motor’s differential

equations. Use the following derivative function file:
function xdot = dcmotor(t,x)
% dc motor model with trapezoidal voltage profile.
% First variable is current; second is velocity.
global c I K_T K_e L R
A = [-R/L, -K_e/L; K_T/l, -ell);
B = [l/L; 0);
ift<O.l
v = 100*t;
elseif t <= 0.3
v = 10;
elseif t <= 0.4
v -100*(t – 0.4) + 10;
else
\
v 0;
end
xdot A*x + B*v;
Using the initial conditions x,(O) = 0, X2(O) = 0, the sol~tr is called as follows:
global c I K_T K_e L R
R = 0.6;L = 0.002;c.,= 0;
K_T = 0.04;K_e = 0:04;l =
[t, x) = ode23(‘dcmotor’,
6e-5;
[ 0 , O. 5), [ 0 , O·n;

The results are plotted in Figure 8.6-6. The motor’s velocity follows a trapezoidal profi e
as expected, although there is some slight deviation because of its electrical resistance a
inductance and its mechanical inertia.