Application of TMS320F2812 DSP in Vehicle Four-Wheel Steering Control System

1 Introduction

This article refers to the address: http://

The Digital Signal Processor (DSP) is a microprocessor suitable for digital signal processing operations, enabling real-time and fast digital signal processing algorithms. Usually, a DSP-based core with peripheral function circuits required for measurement control is integrated into a single chip, which greatly reduces the price of the chip, reduces the size, is compact, easy to use, and improves reliability. Therefore, the multi-function board with integrated DSP chip is ideal for motor applications, excitation pulse control systems, and power protection systems. In this paper, the CS4U9813 programmable intelligent multi-function board of Super Extension Industrial Control is used as the controller of the servo motor to realize the rear wheel steering function of the car. The board integrates TI's high-performance DSP chip TMS320F2812.

2 Structural features of TMS320F2812 [1][4]

TMS320F2812 is TI's latest and most powerful 32-bit fixed-point DSP chip on the market. It has digital signal processing capability, powerful event management capability and embedded control functions, especially suitable for industrial automation, motor and motor servo control systems. TMS320F2812 chip structure uses improved program and data storage separate Harvard architecture, 8-stage pipeline operation, 128-bit key protection, almost all instructions are completed in 6.67ns (150MHZ), up to 1MB external memory interface, up to 56 A separate programmable, versatile input/output (GPIO) pin is the best choice for motion control systems. The functional block diagram is shown in Figure 1. Its main performance is as follows:

Figure 1 Functional Block Diagram


(1) High performance 32-bit CPU
l Main frequency 150MHZ (clock cycle 6.67ns), low power consumption (core low voltage 1.8V, I/O port 3.3V)
l 16-bit × 16-bit and 32-bit × 32-bit multiply and accumulate operations and two multiply and accumulate 16 bits × 16 bits
l Uniform register programming mode, up to 4M word linear program address and data address


(2) On-chip memory
l 8Kx16-bit flash memory
l 1Kx16-bit OTP type read-only memory
l L0 and L1: two 4Kx16-bit single-port random access memory (SARAM)
l HO: an 8Kx16-bit single-port random access memory
l M0 and M1: two 1Kx16-bit single-port random access memories


(3) Clock and system control
l Support dynamic change of phase-locked loop frequency (PLL)
l On-chip oscillator
l Watchdog timer module
l Control system combining CPU level and peripheral level interrupt
(4) Rich peripherals
l Two event managers (EVA, EVB)
l Serial peripheral interface (SPI)
l Two serial communication interfaces (SCI), standard UART
l Improved Controller Area Network (ECAN)
l Multi-channel buffered serial interface (MCBSP)
l 16-channel 12-bit digital-to-analog converter (ADC)

3 Four-wheel steering control system Four-Wheel Steering (4WS) system refers to the vehicle in the process of steering, two groups of four wheels can be turned according to needs, can effectively improve the flexibility of the vehicle Sexuality and handling stability are being continuously developed and applied. When the 4WS car turns at low speed, the front and rear wheels are reversed in phase, which can reduce the turning radius of the vehicle. In the high-speed cornering, the front and rear wheels are mainly used for the same phase steering, which can reduce the vehicle center-of-plane angle β and reduce the stability of the vehicle yaw rate. State overshoot, etc., to further improve vehicle handling stability.


The four-wheel steering platform constructed in this paper consists of a DC servo motor with a worm gear reduction mechanism, an electromagnetic clutch and a common front wheel steering mechanism. The motor power supply is DC12V, the reduction ratio is set to 10: 1 (adjustable), and the electromagnetic clutch power supply is DC48V. The experimental platform is shown in Figure 2. The control strategy adopts direct yaw rate closed-loop control combining feedforward and feedback. The front wheel angle signal is collected by the absolute angular displacement sensor; the rear wheel angle is obtained by the higher precision incremental photoelectric encoder; the vehicle speed is five rounds. The instrument is obtained; the rear wheel steering is realized by the DC servo motor through the electromagnetic clutch connected mechanical steering mechanism; the core of the ECU hardware electronic system is composed of TMS320F2812, and the structural block diagram is shown in Figure 3:

Figure 2 Experimental platform

Figure 3 block diagram

4 control system hardware design and simulation

According to the control strategy designed above, the ECU unit collects the front wheel angle signal, the rear wheel angle signal, the wheel speed signal and outputs the driving voltage of the motor through the CPU operation to realize the automatic steering of the rear wheel. In this paper, the C language programming program is used to realize the control algorithm of the design, and in the case of the simulator connection, the hardware-in-the-loop simulation debugging is completed in the CCS (Code Compose Studio) environment. CCS2000 is a set of Windows-based DSP integrated development environment for TI's TMS320C2000 series DSP, and is also the best DSP development software. In the CCS environment, program development, debugging, compiling, linking, support assembly and C/C++ for software development, powerful debugging tools such as breakpoints, probes, profiling and graphic display, etc., and finally output target files Burning.


4.1 Front wheel angle signal acquisition The front wheel angle is obtained by the absolute angular displacement sensor. The output voltage is linearly proportional to the front wheel angle, and the range is 0~12V. This article uses the ADCHA0 pin acquisition of the CS4U9806 board, sampling the peripheral circuit DSP chip internal integration. The single channel sampling time of this board is 200nS, and the input signal range can be selected by jumper -5~+5V, 0~10V, 0~20V, default -5~+5V. Since the range of the front wheel angle is limited, the jumper is selected from 0 to 10V, and the sampling frequency is set to 96HZ. Part of the programming process is as follows:
AdcRegs.ADCMAXCONV.all=0x0002;
// Set the maximum conversion channel register to 2; AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0;
// Set the ADCHAO channel to sample continuously 3 times;
AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 0x0;
AdcRegs.ADCCHSELSEQ1.bit.CONV02 = 0x0;
EvaRegs.T2CMPR=0x0080;
// Set the compare register of timer 2;
EvaRegs.T2PR=0xFFFF;
// Set the period register of timer 2;
EvaRegs.GPTCONA.bit.T2TOADC=3;
// Enable comparison interrupt to start the sampling module;
EvaRegs.T2CON.all=0x1442;
/ / Enable the comparison unit, the sampling frequency is 96HZ;
Interrupt void adc_isr(void)
// sampling interrupt service subroutine;
{ voltf0 = AdcRegs.ADCRESULT0/16;
// Average the three consecutive samples to improve accuracy;
Voltf1=AdcRegs.ADCRESULT1/16;
Voltf2=AdcRegs.ADCRESULT2/16;
Averagef=(voltf0+voltf1+voltf2)/3.0;
Deltaf=(averagef-2970.0)*3.2133/(4096-2970.0); } //calculate the front wheel angle, take the arc;


4.2 Rear wheel angle signal acquisition The rear wheel angle signal is obtained by a high precision incremental photoelectric encoder. The angle at which the worm rotates becomes a corresponding increase and decrease count pulse according to the direction of rotation, and 2048 pulses are generated per revolution, and the output is a clock signal and a direction signal. In this paper, the DICH0 (CAP2) pin is used to capture the clock signal, and the input pin DICH19 (GPIOF12) is used to obtain the direction signal. The switch input circuit with optocoupler is designed as shown in Figure 4. The capture unit circuit is integrated inside the DSP chip.

Figure 4 Input circuit block diagram


Part of the programming process is as follows:
EvaRegs.CAPFIFO.all=0x0400;
// Set the initial value of the capture FIFO status register;
EvaRegs.CAPCON.bit.CAPQEPN=0x1;
// enable capture unit 2;
EvaRegs.CAPCON.bit.CAP12TSEL=1;
// Select timer 1 as the reference;
EvaRegs.CAPCON.bit.CAP2EDGE=0x1;
// Check that the rising edge is valid;
EvaRegs.T1CMPR=0x0080;
// Set timer 1 for capture unit 2;
EvaRegs.T1PR = 0xFFFF;
EvaRegs.T1CON.all = 0x1042;
Interrupt void cap2_int(void)
// Capture interrupt service routines;
{ if(GpioDataRegs.GPFDAT.bit.GPIOF12==1)PositivePulsecount++;
Else NegativePulsecount++;
Deltar=(PositivePulsecount-NegativePulsecount)*pi/1024.0;
}
// Calculate the rear wheel angle based on the I/O pin, taking the arc;


4.3 The basic idea of ​​algorithm design and D/A output algorithm is: when 4WS starts, input a front wheel angle, compare it with the speed-dependent ideal yaw rate steady-state response gain G0 through yaw rate feedback, and then The controller G1 controls the rear wheel angle to realize four-wheel steering, and the output centroid side yaw angle, yaw rate and lateral acceleration are used for monitoring. The control block diagram is shown in FIG. 5. The drive voltage of the motor is generated by the DSP's compare register and is output by the D/A converter circuit. In this paper, the timer 4 is used to generate PWM, which is output by the DA4 pin. The D/A conversion circuit of the first stage amplification is shown in Fig. 6.

Figure 5 control block diagram

Figure 6 D / A conversion circuit


Part of the programming process is as follows:
EvbRegs.T4PR=0x3FF;
// Set the period register of timer 2;
EvbRegs.T4CMPR=0x0080;
// Set the initial value of the compare register of timer 4;
EvbRegs.T4CON.all=0x1042;
// enable the comparison unit;
EvbRegs.GPTCONB.bit.TCOMPOE=1;
// Drive the PWM output of Timer 4;
EvbRegs.GPTCONB.bit.T4PIN=1;
// The compare output of timer 4 is active low;
Y0[0]=c[0][0]*x0[0]+c[0][1]*x0[1]+d[0][0]*u[0]+d[0][1 ]*u[1]; // Output centroid side yaw;
Y0[1]=c[1][0]*x0[0]+c[1][1]*x0[1]+d[1][0]*u[0]+d[1][1 ]*u[1]; // output yaw rate;
Y0[2]=c[2][0]*x0[0]+c[2][1]*x0[1]+d[2][0]*u[0]+d[2][1 ]*u[1]; // output lateral acceleration;
Dutycycle=volt_out/10.0*1024;
// Calculate the duty cycle;
EvbRegs.T4CMPR=Dutycycle;
// Reload the period register of timer 4;

5 Conclusion In this paper, the control algorithm designed above is used to simulate the 4WS vehicle based on TMS320F2812 DSP hardware-in-the-loop. The vehicle parameters are selected as: m=1740kg; I= 3214kg.m2; a=1.058m; b=1.756m; K1= 29000N/rad; K2=60000N/rad; at the same time, for the sake of simplicity, the interception speed u= 30m/s, the result is shown in Figure 7. The result shows that the yaw rate tracking control of the 4WS vehicle in the high-speed range of steering control its centroid The slew rate, side yaw angle and lateral acceleration response can maintain better dynamic and steady-state performance compared to the two-wheel steering. At the same time, the CCS2000 is used for debugging development with short cycle and low cost. Therefore, DSP-based hardware control systems have broad prospects in the fields of industrial control and automotive control.

Figure 7 Simulation results

Energy Saving Lamp

Energy Saving Lamp,Light Bulb,Plastic Energy Saving Lamp

Hand Tools Co., Ltd , http://www.nshandtools.com