网站公告列表

  没有公告

加入收藏
设为首页
联系站长
您现在的位置: 61IC中国电子在线 >> DSP >> FAQ >> 硬件开发 >> 文章正文
  采用DSP技术设计复杂的嵌入式控制系统         ★★★ 【字体:
采用DSP技术设计复杂的嵌入式控制系统
作者:admin    文章来源:本站原创    点击数:    更新时间:2004-7-27    
In the last few years, engineers have begun experimenting with the use of di
gital signal processors in real-time control applications. In many respects
these processors are ideal for implementing real-time control systems, becau
se of their ability to do high-speed, real-time multiply/accumulate operatio
ns. Once considered a specialized type of processor (with a very narrow mark
et) digital signal processors are now finding their way into a wide variety
of real-time applications outside the traditional signal processing field.
Engineers are choosing digital signal processor chips over CISC and RISC chi
ps for several reasons:
Digital signal processor chips are cheaper.
Digital signal processor chips have wide accumulators for preserving accurac
y during long chains of computations. For example the Motorola DSP56001 has
56-bit-wide accumulators, and can operate on 48-bit-wide words, even though
it only has a 24-bit-wide data bus.
Because they're designed to interact closely with their I/O ports, most digi
tal signal processor chips are blessed with a wide variety of built-in I/O d
evices, such as synchronous serial ports (and, in some cases, asynchronous p
orts) and multiple DMA controllers.
Digital signal processor chip interrupts are more deterministic than either
RISC or CISC processors. Most respond directly to several different external
and internal interrupt sources (such as an external host computer, internal
serial-ports, or internal DMA controllers) by vectoring directly into the a
ppropriate interrupt service routine. This eliminates the overhead involved
with the software polling of register bits, to determine where the interrupt
came from. In doing so, it permits the processor to respond to interrupts w
ithin nanoseconds, instead of the microseconds required by RISC and CISC chi
ps.
Because the arithmetic hardware in a digital signal processor chip is very s
pecialized, it provides high-level computation operations, even at the assem
bly language level. This makes digital signal processors very easy to progra
m in assembly language.
When digital signal processor chips are programmed in a high-level language
(such as C) their large number of registers and accumulators permit huge red
uctions of the code size and the execution time, through the use of optimizi
ng compilers. Code size can often be reduced by as much as 50% over unoptimi
zed code. Comparative reductions in RISC and CISC code are roughly 20%;
Newer digital signal processors are being designed with parallel architectur
es in mind. For example, the TMS320C40 from Texas Instruments includes 6 int
ercommunication ports, for direct connection to other processor chips.
Until recently, the use of digital signal processors has been hampered by in
adequate software development support (compared to RISC or CISC architecture
s). However, these tools have now become sophisticated enough to compete wit
h their RISC and CISC counterparts, in terms of user-friendliness and power.

An example of an embedded control application
Some of the more recent applications for digital signal processor chips have
proved quite surprizing. For example, one steel company has used digital si
gnal processors to design a less expensive alternative to a new (and very ex
pensive) imported sheet metal cutting system. This alternative system employ
s a digital signal processing board (and standard off-the-shelf I/O boards)
to replace a collection of programmable logic controllers.
The Application
Sheet metal is often taken from a roll and cut to length, using a system lik
e the one shown in Figure 1. The roll of sheet metal is unrolled onto a conv
eyer, which carries it under a fixed shear. When the proper length of sheet
metal has been unrolled, the conveyor is stopped. Then the shear is activate
d, to cut the sheet metal to the appropriate length. Once the shear has done
its work, the conveyer starts again, unrolling an additional length of shee
t metal for the next cut.
This constant stopping and starting is costly, both in terms of time and in
terms of energy. Throughput could be increased greatly if the sheet metal co
uld be cut while in motion. This would eliminate the need to start and stop
the feed roll.
This can be accomplished by mounting the shear blade on a rotating assembly,
and then synchronizing the motion of the shear blade with the sheet metal o
n the conveyer, as shown in Figure 2. Because the shear is in constant motio
n, it's called a flying shear. Flying shears can outperform traditional shee
t metal cutters (like the one shown in Figure 1) by up to five times, depend
ing on the cut length.
Adjusting the cut length
The actual cut length is determined by how fast the rotating shear assembly
is turned between cuts. To adjust the cut length, the assembly is rotated fa
ster or slower between cuts. For example, if the cut length is short, the ro
tating shear assembly must be turned very quickly between cuts. If the shear
is turned too slowly, it will not be in position for the next cut by the ti
me the sheet metal moves into position. In contrast, if the cut length is lo
ng, the rotating shear assembly must be turned more slowly, to ensure that i
t doesn't begin the new cut before the sheet metal has been moved into the p
roper position.
Depending upon the length of the cut, the rotational speed of the blade asse
mbly between cuts may need to be either faster or slower than the speed of t
he sheet metal. However, at the time of the cut, the motion of the sheet met
al and the shear must be synchronized. In order to ensure this, a set-up dis
tance before the cut and a holding distance after the cut is defined.
A control system must then be designed to control the rotation of the shear
assembly in such a way that the shear accelerates or decelerates at exactly
the right speed between cuts, and then resynchronizes its velocity with the
sheet metal velocity, in preparation for the next cut. This requires very pr
ecise motor control.
Simple closed loop control systems
Figure 3 shows a simple closed-loop analog motor control system. This system
continuously monitors the rotational position of a motor shaft through an a
nalog position sensor. The analog output voltage of this sensor is proportio
nal to the motor's rotational position. The control system subtracts this an
alog feedback voltage from its reference voltage, to generate an error signa
l. This error signal is then amplified and used to drive the motor. When the
motor reaches a position where the feedback voltage matches the reference v
oltage, the error signal goes to zero, and the motor drive goes to zero.
Figure 4 shows a simple closed-loop digital control system. It works much li
ke the analog control system in Figure 3, except that the position sensor ge
nerates a digital signal to indicate the position of the motor. For example,
a shaft encoder and a digital counter might be used to indicate the rotatio
nal position of the motor shaft. As the shaft rotates, the shaft encoder gen
erates a pulse for each increment of rotation. These pulses are routed to th
e digital counter, which accumulates a digital count proportional to the rot
ation of the shaft. This count is continuously compared to a reference value
, and an A/D converter generates an analog signal proportional to the differ
ence, which is used to drive the motor.
The resolution of the shaft encoder is the number of pulses it generates for
each 360-degree revolution of the shaft. This resolution determines how acc
urately the system can monitor the shaft's rotation. High resolution shaft e
ncoders produce several thousand pulses per revolution.
Simple control systems (like the ones shown in Figure 3 and Figure 4 above)
can position their motors with enough accuracy to satisfy many applications.
.. given enough time. However, they don't provide much control over the dyna
mic behavior of the motor. For example, if the reference is suddenly changed
to a new level (far removed from the original level) these control systems
simply drive the motor with a very large drive current. If the inertia of th
e motor (or its load) is large, the motor might arrive at the desired positi
on with a large velocity, causing it to overshoot (or even oscillate) before
settling into the desired position. Another problem is that, as the motor a
pproaches the desired position, its positional error becomes very small, cau
sing the drive to the motor to drop below that required to overcome friction
. This causes the motor to halt just before it reaches the desired final pos
ition.
More sophisticated control systems offer a solution to these problems throug
h the use of PID control. (PID stands for Proportional, Integral, Differenti
al) These systems include a filter that computes the time derivative and the
time integral of the error signal, and then uses weighting factors to add s
ome fraction of the derivative and the integral to the positional error sign
al. (See Figure 5) The time derivative component compensates for inertial ef
fects, while the time integral component is used to nudge the motor into a m
ore accurate final position when it comes to a halt near (but not quite at)
the required destination, due to friction.
The choice of the weighting factors is based on the physical characteristics
of the motor. For example, a motor with a lot of inertia will require a lar
ge weighting factor for the time derivative component. The weighting factor
for the integral term is not as critical, since even a slight error in the m
otor's position integrates over time, becoming larger and larger, until it o
vercomes the motor's friction, and nudges the motor into its final position.

More precise control methods
PID control provides a technique for getting a motor to a desired position i
n the shortest time possible. However, in some applications, you need to hav
e more precise control. For example, in our flying shear application, we nee
d to continuously adjust the rotational velocity of the shear (as it makes i
ts rotation for the next cut) so that it arrives at the beginning of the set
-up distance at precisely the right time.
For example, suppose short cuts are being made. At the end of the hold dista
nce the shear must be accelerated from the sheet metal's velocity to some hi
gh speed, and then decelerated, so that its velocity exactly matches that of
the sheet metal again, at the beginning of the set-up distance. Since the m
otor used to drive the shear has some inertia, its velocity can't be changed
instantaneously, so its velocity must be continuous with respect to time. A
velocity profile that meets these requirements is shown in Figure 6.
The corresponding acceleration profile can be obtained by computing the slop
e of the velocity curve. It is shown in Figure 7. If we assume that the shee
t metal is moving at a constant velocity, the shear's acceleration is initia
lly zero. Then it rises to some positive value, as the velocity of the shear
increases. Its acceleration then falls to zero, during which the shear's ve
locity continues to increase, but at a lesser rate. When the shear's acceler
ation crosses zero, it is rotating at its maximum velocity. When the acceler
ation goes negative, the shear begins to slow down, and when the shear's acc
eleration returns to zero, its velocity becomes constant again.
The peak values for the acceleration and for the velocity both depend upon t
he cut length. If the cut length is very short, the peak acceleration and th
e peak velocity will be very large, in order to quickly move the shear into
position for the next cut.
On the other hand, if the cut length is very long, the curves might be inver
ted, as shown in Figures 8 and 9. The velocity of the shear initially decrea
ses, to keep it from arriving at the next cut too soon. Its velocity then in
creases, to match that of the sheet metal.
Both pairs of curves can be represented by a common pair of equations, as lo
ng as those equations include a term that is positive for short cut lengths
and negative for long cut lengths.
Computing the required position, velocity and acceleration profiles
Suppose we want to build a controller for a flying shear. In order to synchr
onize the shear to the sheet metal, we must slave the motion of the shear as
sembly to that of the sheet metal. To do that we must find a way to drive th
e shear motor in such a way that its acceleration and velocity profiles look
like Figures 6 through 9.
If we study the acceleration profile shown in Figure 7, we find that (betwee
n the end of the hold time and the beginning of the set-up time) it resemble
s a cubic curve. (See Figure 10) Each of the zero crossings represents a roo
t of this cubic equation. Thus, we can use a cubic equation to generate the
acceleration curve for the rotating shear assembly between the hold time and
the set-up time.
Since we're interested in keeping the motion of the shear synchronized to th
e motion of the sheet metal, we'll write our cubic "acceleration" equation a
s the second derivative of the shear's rotational position with respect to t
he sheet metal position, instead of taking its second derivative with respec
t to time...
a(r) = d2q/dr2
Technically speaking, this is not really an acceleration equation but (for t
he time being) we will assume that the velocity of the sheet metal is consta
nt, so the position of the sheet metal is proportional to time, and our pseu
do acceleration curve will actually represent the acceleration of the shear'
s rotation with respect to time. (Note: If the sheet metal is not always mov
ing at a constant velocity, we'll have to make some modifications to this ac
celeration equation, to take that into account.)
Figure 11 shows how we'll define the terms for this equation. The rotational
position of the shear assembly (q) is represented as a function of the hori
zontal position of the sheet metal (r)...
q(r) = (r - rh)/ra
Where...
ra is the cut length of the sheet metal, less the set-up and hold distances
rh is the hold distance.
We define the origin for the rotational motion of the shear such that:
q = 0 at the end of the hold time
q = 1 at the beginning of the set-up time.
Since the sheet metal is moving at constant velocity (and since the rotation
al velocity of the shear is synchronized to the sheet metal from the beginni
ng of the set-up time to the end of the hold time) we know that the accelera
tion of the shear assembly is zero at q = 0 and at q = 1. If we choose to ma
ke our cubic equation symmetrical, then the acceleration curve will also pas
s through zero when q = 1/2.
Since 0, 1/2 and 1 are the three roots of the cubic acceleration equation, w
e can derive the equation as follows...
a(r) = K [ (q - 0) (q - 1/2) (q - 1) ]
= K [ q3 - (3/2) q2 + (1/2) q ]
By substituting for q(r), we get...
a(r) = K ra2 [ (1/ra)(r -rh)3 - (3/2)(r -rh)2 + (ra/2)(r -rh) ]
To find the "velocity" equation for the shear, we integrate this equation wi
th respect to r...
w(r) = (1/2) K ra2 [ (1/2ra)(r -rh)4 - (r -rh)3 + (ra/2)(r -rh)2 ] + C1
...where C1 is a constant of integration.
Since the velocity of the shear is the same as the velocity of the sheet met
al at the end of the hold time, (r = rh) we know that w(rh) = dq/dr = 1. Whe
n we substitute rh for r in the equation above, all of the (r -rh) terms go
to zero, and we find that C1 = 1.
To find the "position" equation for the shear, we integrate this w(r) equati
on with respect to r...
q(r) = (1/2) K ra2 [ (1/10ra)(r -rh)5 - (1/4)(r -rh)4 + (ra/6)(r -rh)3 ] +
r + C2
...where C2 is another constant of integration.
Based on our earlier definition, q(r) = (r -rh)/ra, we know that q(rh) = 0.
When we substitute rh for r in the equation above, all of the (r -rh) terms
go to zero, and we find that C2 = -rh.
The only remaining problem is to determine the value of K. K determines the
amplitude and direction of the cubic acceleration curve, and is a function o
f the cut length. For example, if the cut length is short, K will be positiv
e, causing the shear to first accelerate, and then decelerate. On the other
hand, if the cut length is long, K will be negative, causing the shear to fi
rst decelerate, and then accelerate.
We can solve for K substituting a value of (ra + rh) for r in the above equa
tion...
q(ra + rh) = (1/2) K ra2 [ (1/10ra)(ra)5 - (1/4)(ra)4 + (ra/6)(ra)3 ] + ra
Solving for K, we get...
K = 120 (ra)-6 [q(ra + rh) - ra]

               欢迎点击进入:TI德州中文网   (国内唯一针对TI应用的中文技术网站)    文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    基于DSP的电子节气门PID控制
    基于DSP的多路音/视频采集处…
    低功耗实时可编程DSP数字助听…
    基于DSP+CPLD的断路器智能控…
    基于DSP+CPLD的交流电机调速…
    基于DSP的分布式微机保护测控…
    基于DSP的语音实时变速系统设…
    以ARM和DSP嵌入式系统为核心…
    基于双DSP的运动目标智能跟踪…
    高性能定点DSP位处理单元(BM…
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    站长:61IC 湘ICP备05002478号