Beruflich Dokumente
Kultur Dokumente
and
REFERENCES
which is G s ( s ) × 1s (speed to position
conversion). The position sensor has 1. R. Chassaing, Digital Signal
a ratio of 0.625. The system input Processing, Laboratory Experiments
was ± 5v, representing a desired Using C and the TMS320C31 DSK, Wiley,
output of ± 90 degrees (or a total of 1999.
180 degrees). Again, the system was
run without (D(z)=1) and with a 2. C. L. Phillips and H. T. Nagle,
controller. Since the system is Digital Control System Analysis and
already of type 1, no steady-state Design, Prentice Hall, Inc., 1995.
errors were expected. Figure 6a shows
that the system output had an 3. J. Tang, "Laboratory Development
overshoot of about 12% without a for a Digital Control System Course,"
controller, which matched the Journal of Engineering Technology,
corresponding theoretical results as Vol. 14, No. 2, fall 1997.
shown in figure 6b. When a PID
controller was added with parameters
K P =1, K I =0, and K D =1.9, the
*CONTROL2.ASM - PID controller using the C31 DSK
.start ".text", 0x809900 ;starting address of text
.start ".data", 0x809C00 ;starting address of data
.include "AICCOM31.ASM" ;include AIC comm routines
.entry BEGIN ;start of code
.text ;assemble into text
BEGIN LDP @COEFF_ADDR ;init to data page 128
CALL AICSET ;initialize AIC
PID LDI @COEFF_ADDR,AR0 ;AR0 points to coefficients address
LDI @DLY_ADDR,AR1 ;AR1 points to addr of delay samples
CALL AICIO_P ;call AIC for polling
FLOAT R6,R3 ;stage input
MPYF3 *AR0++,*AR1++,R0 ;b[0]*dly[0]
LDI STAGES-1, RC ;initialize stage counter
MPYF3 *AR0++,*AR1--,R1 ;b[1]*dly[1]
|| SUBF3 R0,R3,R3 ;input-b[0]*dly[0]
MPYF3 *AR0++,*AR1++,R0 ;a[1]*dly[0]
|| SUBF3 R1,R3,R2 ;dly=input-b[0]*dly[0]-b[1]*dly[1]
MPYF3 *AR0++,*AR1--,R1 ;a[2]*dly[1]
ADDF3 R0,R1,R3 ;a[2]*dly[1]+a[1]*dly[0]
LDF *AR1,R4 ;dly[2]
|| STF R2,*AR1++ ;dly[0] = dly
MPYF3 R2,*AR0++,R2 ;dly*a[0]
|| STF R4,*AR1++ ;dly[1] = dly[0]
MPYF3 *AR0++,*AR1++,R0 ;b[0]*dly[0]
|| ADDF3 R2,R3,R3 ;controller output
FIX R3,R7 ;convert output to integer
BR PID
.data ;b[0] b[1] a[1] a[2] a[0]
COEFF .float -1.0000E+0, 0.0000E+0, -0.99996E+0, 0.0000E+0, 1.00004E+0
DLY .float 0, 0 ;init delay var for each stage
STAGES .set 1 ;number of stages
COEFF_ADDR .word COEFF ;address of COEFF
DLY_ADDR .word DLY ;address of DELAY
AICSEC .word 162Ch,1h,3872h,63h ;AIC config data, Fs = 10 kHz
.end ;end