Design of Tracked Model Vehicle Measurement and Control System Based on VeriStand and Simulink

This paper presents the composition and working principle of the hardware and software of the measurement and control system based on VeriStand and Simulink for a tracked model vehicle. The hardware of the system is composed of a CompactRIO controller and acquisition cards, torque/speed sensors and a gyroscope. The vehicle control logic model and data processing model are built in Matlab/Simulink. VeriStand is adopted to manage models and interact with people. The system can control motor speed on both sides of the vehicle and collect data such as sprocket torque and speed, vehicle attitude on real-time. At last, we test and verify the system can work successfully.


Introduction
Tracked vehicles have a wide range of applications in the military field and are an important part of active armored equipment.The actual vehicle experiment of tracked vehicles can verify theoretical problems such as ground mechanics and dynamics of tracked vehicles.The research results can ultimately improve the driving performance of the vehicle.However, it is not easy to use a large tracked vehicle for actual vehicle experiments due to military confidentiality and site constraints.Based on the similarity theory, a large-scale tracked model vehicle can be developed to verify the above theoretical problems.And, it is important to design a stable measurement and control system for the tracked model vehicle.
VeriStand is a software environment for configuring real-time testing applications, and it can be used to interact with models from various modeling environments and programming languages, and can run compilation models created in any supported modeling environment.At present, many scholars and research institutes at home and abroad have established monitoring and control systems for various applications based on the VeriStand and Simulink software platforms.ITI, based in Germany, built a hardware-in-the-loop (HIL) test bench for Armored Multipurpose Vehicle (AMPV) built-in systems based on VeriStand and SimulationX.Texas Tech University's Timothy Maxwell and others founded VeriStand on a semi-physical test platform for dual-mode hybrid electric vehicles, creating an opportunity for students to innovate automobiles [1].Zhenhua Jin of Tsinghua University developed a HIL test platform based on VeriStand and Simulink specifically for hybrid powertrain controller testing, and through actual testing, it has shown that the platform can meet the requirements of HCU testing [2].Huiyuan Xiong of Sun Yat-sen University achieved real-time online adjustment of vector control and PID parameters of permanent magnet synchronous motor (PMSM) based on VeriStand and Simulink [3].Wenhua Zheng of Nanjing University of Aeronautics and Astronautics designed a general-purpose real-time simulation platform for certain type of aeroengine based on VeriStand and Simulink [4].
Based on the above and other researcher's design experience, we use a CompactRIO controller and VeriStand, Simulink software platform to complete the design of the measurement and control system for the tracked model vehicle.communication system, and a measurement and control system.The hardware structure of the vehicle is shown in Figure 1: The following describes the hardware components of the measurement and control system.

Controller of the System
The controller of the system is mainly composed of a National Instruments (NI) CompactRIO controller and a voltage output card.
In order to achieve real-time control of the servo motors on the vehicle and real-time acquisition of sensor data, the NI Company's embedded CompactRIO 9035 controller is used.The controller supports the Linux Real-Time (64-bit) operating system with a highperformance real-time processor and a reconfigurable FPGA.The system design mainly uses this controller's high-performance real-time processor.
Because the servo motors use voltage analog input control, the NI 9264 voltage output card is used.The NI 9264 has 16 analog output channels, each with an output voltage range of  10V.The forward and reverse rotation and speed control of the servo motors can be completed by using two of the channels to input the voltage signal to the motor drivers.

Measuring Components of the System
The Measurement components include torque/speed sensors, gyroscopes and analog, digital acquisition cards, and high-speed CAN card.
In order to measure the torque and speed signals of the sprocket wheels on both sides, two torque/speed sensors are installed between the output shafts of reducers and the sprocket wheels.The sprocket wheels torque signals are two voltage analog signals, so the NI 9207 analog input card is used.The NI 9207 has a total of 16 channels, including 8 channels of  20mA current input and  10V of 8-channel voltage input.
The sprocket wheels speed signals are two digital pulse signals, so we choose NI 9403 two-way digital card.The NI 9403 has 32 channels and each channel is compatible with 5V/TTL signal input and output.
The data transmission method of the gyroscope is CAN communication, so we choose the NI 9862 highspeed CAN card.The maximum baud rate of the NI 9862 high-speed CAN card is 1Mbps, which fully satisfies the acquisition of measurement data.However, this module requires external power supply and the supply voltage range is +9~+30VDC.

Software Design of the Measurement and Control System for Tracked Model Vehicle
The system design software consists of VeriStand and Simulink.Among them, we use VeriStand to design the control and data acquisition interface of the upper computer, and use Simulink to build the control logic model and data processing model of the tracked model vehicle.
VeriStand supports interaction with models built and compiled successfully based on Simulink, so after building the control logic model and data processing model of the vehicle with Simulink, a '.so' file that matches the operating system of the CompactRIO 9035 controller can be compiled and generated.It is then imported into VeriStand to configure the model interface.The flow is shown in Figure 2:

Models Based on Simulink
The control logic model and data processing model of the tracked model vehicle were built by using Simulink.Since the tracked model vehicle is a double-side electric driven vehicle, the straight running and steering of the vehicle are accomplished by controlling the rotational speeds of the two side motors.The servo motors are PMSM, the control mode is the voltage analog input speed control mode, the rated speed is 3000r/min corresponding to 10VDC, so the relationship between the input voltage of the motor driver and the target speed of the motor is  For example, in order to perform a test for a fixed condition, the Signal Builder module in the Simulink model library can be used to predefine the target speed of the motors on both sides.With the operation of the model, the motor drivers on both sides will receive their own target speed command in real time, so that the vehicle can complete the test of a fixed condition.The motor control logic model is shown in Figure 3.
During the test, since the torque/speed sensors feedback analog voltage and digital pulse signals, it needs to be processed and converted into the torque values and speed values of the sprocket wheels on both sides.
The torque signal of the sprocket output shaft is amplified and conditioned by the sensor to output a corresponding analog voltage signal, and the clockwise torque output is positive and the counter clockwise torque output is negative.The range of the torque sensor is  100Nm, the corresponding voltage output range is  5V, and the relationship between the torque and the output voltage is linear, so the relationship is T is the value of the torque on the sprocket output shaft; feedback U is the voltage value output by the torque/speed sensor.The rotation signal of the sprocket wheel is a digital pulse signal, and the output is a 60-pulse/revolution 5VTTL pulse signal.The digital pulse counting method usually uses the edge counting method to count the number of pulses generated per unit time.However, in order to improve the measurement accuracy of the rotation speed of the sprocket wheel, the measurement system will record the time required to generate each pulse.So, the sprocket wheel speed calculation formula is n is the motor is the value of the rotation speed of the sprocket wheel; 0 T is the time required for the rising edge of the adjacent pulse generated by the torque/speed sensor.
Gyro output signals are transmitted via CAN messages.Using a pre-defined DBC file format, CompactRIO controller and the NI 9862 High-Speed CAN card can directly process the signal and output the value of the vehicle attitude.
Therefore, the data processing model is shown in Figure 4:

Interface Based on VeriStand
The design of VeriStand mainly includes configuration and processing of its System Explorer and Workspace.
The system explorer is used to configure the realtime engine, including the loading and configuration of models, the loading and configuration of custom devices, the loading and configuration of DBC files, and the mapping of input and output channels.
The Workspace includes a simple control library that comes with VeriStand, so we can configure a simple monitoring and control interface through the control library.According to the input and output ports of the Simulink model, we design the monitoring and control interface as shown in Figure 5:

Test Verification
The tracked model vehicle is shown in Figure 6: We set the relationship between the target speed of the servo motors on both sides of the vehicle and the time in the Simulink model.That is, within 1-3s, the target speed of both sides of the motors are linearly accelerated from 0 r/min to  1200 r/min respectively; 3-8s, both sides of the motors maintain their respective target speed; within 8-10s, the target speed of the motors are gradually reduced to 0 r/min.Since the gear ratio of the reducers on both sides are both 30, the rotational speed of the sprocket wheels on both sides are  40r/min.It can be seen from Figure 7 (a) (b) and (c) that the vehicle had pivot steering according to the predetermined operating conditions, and both of torque and rotational speed of the sprocket wheels on both sides of the vehicle and the yaw rate of the vehicle can be collected successfully.

Conclusion
The design of the measurement and control system based on the VeriStand and Simulink software platforms provides a real-time and reliable solution for the control and data acquisition of the tracked model vehicle.Moreover, the development and design process based on the VeriStand and Simulink software platforms is simple and convenient, and the control strategy of the tracked model vehicle can be redeveloped based on Simulink software.The experience gained in the development of this system can be applied in the control and data acquisition process in vehicles and other fields.

Figure 1 .
Figure 1.The Hardware Structure of the Vehicle.

Figure 2 .
Figure 2. The flow of VeriStand.The following will introduce the control logic model and data processing model based on Simulink and the control and data acquisition interface of the upper computer based on VeriStand.
time, in order to facilitate the use of the vehicle for testing, manual and automatic control methods are set in the model.

Figure 3 .
Figure 3.The motor control logic model based on Simulink.

Figure 4 .
Figure 4.The data processing model based on Simulink.

Figure 6 .
Figure 6.The picture of the tracked model vehicle.

Figure 7
Figure 7 (a).The rotation speed of the sprocket wheels.

Figure 7 (
Figure 7 (b).The torque of the sprocket wheel output shafts.

Figure 7
Figure 7 (c).Yaw rate of the vehicle.