Electronic

The Design of the Wireless Control System of the Three-wheeled Robot Car

The wireless sensor network technology is used to design a real-time monitoring and control system for the movement of the mobile robot. With MC13214 as the main control chip, Zigbee protocol is used to wirelessly collect and transmit the motion state data of the three-wheeled robot car with MSP430 microcontroller as the microprocessor, and communicate with the host computer using serial communication technology. Using Labview as the development platform, a data acquisition, analysis, processing and Display system was constructed.

Introduction: A real-time monitoring and control system for the movement of mobile robots is designed using wireless sensor network technology. With MC13214 as the main control chip, Zigbee protocol is used to wirelessly collect and transmit the motion state data of the three-wheeled robot car with MSP430 microcontroller as the microprocessor, and communicate with the host computer using serial communication technology. Using Labview as the development platform, a data acquisition, analysis, processing and display system was constructed.

1 Introduction

With social development and technological progress, mobile robots have been widely used in various industries. The moving mechanism mainly includes wheel type, crawler type, leg type, snake type, jumping type and compound type. Wheeled mobile robots have the advantages of light weight, large load-bearing, simple mechanism, relatively convenient drive and control, fast walking speed and flexibility, and high work efficiency. They are widely used in industry, agriculture, anti-terrorism and explosion-proof, home, space detection and other fields. This system is designed for the three-wheeled mobile robot, the most common mechanism among the wheeled mobile robots. The MC13214 chip is used to realize the wireless serial communication between the computer and the robot. As a robot MCU, MSP430F1611 uses PI control algorithm to adjust the duty cycle of PWM wave to complete motor speed regulation, and realizes flexible steering by relying on differential speed. Use MSP430 on-chip ADC to collect three-way acceleration signals.

2 Overall system overview

The system uses the three-dimensional acceleration sensor MMA7260 to collect acceleration, and uses the MC13214 chip to receive commands from the host computer and send the robot motion status information through the wireless communication module in accordance with the RS232 industry standard. The robot end uses MSP430 single-chip microcomputer to control the DC motors of the two rear wheels, and the two photoelectric encoder disks feedback the two-wheel speed to the MSP430 single-chip in real time, and collect 3 acceleration signals through the on-chip 3-channel A/D module. To keep the balance of the robot. The upper computer selects the virtual instrument development platform LabVIEW to realize the control/data display and monitoring interface design of the trolley movement. Under this platform, add the Scrial subVI provided by the Labview Instrument I/O function template itself. Through data connection, real-time communication between the Labview interface and the wireless transceiver module can be realized. Operators can use keyboard, mouse, operating handle, virtual controls and other methods to input robot running instructions to control the motion of the robot car, and display sensor data information on the computer screen. The system block diagram is shown as in Fig. 1.

The Design of the Wireless Control System of the Three-wheeled Robot Car
Figure 1 System block diagram

3 System hardware design

The system uses a wireless communication module centered on the MC13214 chip. MC13214 is a short-distance, low-power, 2.4GHz ISM (Industry Science Medical) band from Freescale, USA, and includes a transceiver chip for the Zigbee physical layer (IEEE 802.15.4) protocol. It has an embedded microprocessor to support point-to-point, star, and mesh-structured networks. The chip contains a low-noise amplifier, 1.0mW high-frequency output amplifier, VCO (Voltage Controlled Oscillator), on-chip regulated power supply and spread spectrum encoding/decoding. In accordance with the IEEE 802.15.4 physical layer specification, the chip achieves a rate of 250kbps on a 2MHz broadband channel, and uses O-QPSK to achieve modulation/demodulation.

MMA7260 is a low-cost single-chip three-axis acceleration sensor from Freescale, USA. The miniature capacitive acceleration sensor integrates signal conditioning, single-pole low-pass filter and temperature compensation technology, and provides four acceleration measurement ranges: ±1.59, ±29, ±49, and ±69. MMA7260 has high sensitivity. When the side volume range of ±1.59 is selected, the sensitivity reaches soomv/g. It has a three-axis detection function, which enables portable devices to intelligently respond to changes in position, orientation, and movement.

The MCU chooses TI’s MSP430F1611 microcontroller. MSP430F1611 is a 16-bit ultra-low power mixed signal processor, with 48kB flash memory, 10kB RAM, 12-bit ADC, dual DAC, 2 USART, I2C, HW Mult and DMA.

The TimerB in the MSP430 chip can independently output two PWM signals to drive the left and right motors through a piece of L298, and the maximum current can reach 4A. The disk code of the DC motor is 100P/R, and the reduction ratio is 14:1; two 7.5V batteries are connected in series as the power source, and the required 5V, 9V and 3.3V voltages are output through 7805, 7809 and LP2987. The TB1 and TB2 pins of TimerB output two PWM signals. The TB1 pin is connected to the ENA pin of L298 to control the left motor, and the P5.0 and P5.1 pins are respectively connected to the INPUT1 and INPUT2 pins of L298, P5.0 high potential forward rotation, P5.1 high potential reverse; TB2 The pin is connected to the ENB pin of L298 to control the right motor. Among them, the TB1 and TB2 pins output two PWM waves, which are used to control the speed of the motor.

The two capture ports CA0 and CA1 pins of TimerA are connected to two-way code disc pulses to obtain the motor speed. A0, A1, and A2 are used as the input terminals of the ADC, and A2, A1, and A0 are respectively connected to the low-pass filtered output signals of the three-dimensional acceleration sensor MMA7260 in the X, Y, and Z directions. The hardware circuit diagram is shown as in Fig. 2.

The Design of the Wireless Control System of the Three-wheeled Robot Car
Figure 2 Hardware circuit diagram

The MC13214 communication module is used as the wireless transceiver of the upper computer. The MC13214 is connected to the serial port of the upper computer through MAX232. The MC13214 communication module of the lower computer is used as the wireless transceiver. The RX and TX pins of MC13214 are connected to the TX and RX of the MSP430 microcontroller, using Z-STACK. The platform configuration MC13214 forms a wireless transparent data transmission module. The function of the host computer MC13214 module is set as a coordinator, and the MC13214 on the robot car is set as a router, so that the robot can send and receive signals as well as a relay node, which is convenient for multi-robot networking.

4 MCU software design

The MSP430F1611 microcontroller program design includes two parts: motor control and communication. The robot motion parameters are obtained by collecting and calculating the acceleration value of the acceleration sensor and the speed value of the encoder. The speed of the trolley can be obtained by calculating the return value of the code wheel. The program flow chart is shown as in Fig. 3.

The Design of the Wireless Control System of the Three-wheeled Robot Car
Figure 3 Program flow chart

The adjustment of the motor speed is achieved by adjusting the duty cycle of the two PWM signals generated by the MSP430. The MSP430 itself has a PWM module to realize it is more convenient. When the car collides with an obstacle, the car is given an automatic backward steering command. When the car is uphill and downhill, the acceleration or deceleration of the car is realized by calculating the angle between the acceleration and the gravity to increase or decrease the PWM duty cycle. The two motors must input two PWM waves at the same time, that is, to ensure that the two rounds can obtain the corresponding voltage output synchronously. The duty cycle adjustment amount of the motor is determined by comparing the encoder feedback with the required speed. Here, the PI incremental algorithm is used and calculated according to formula (1).

△u=uk-uk-1=Kp(ek-ek-1)+KITsamek (1)

Where ek is the error value of this time, ek-1 is the error value of the last time, Tsam is the sampling time, Kp and KI can be obtained by experiment or Matlab simulation. The speed measured by the encoder is:

n×2π/100/T (2)

Where T is the sampling period; N is the number of pulses. The flow chart of the motor adjustment subroutine is shown in Figure 4.

The Design of the Wireless Control System of the Three-wheeled Robot Car
Fig. 4 Flow chart of motor adjustment subroutine

5 LabVIEW control program design

The PC program is written in the graphical programming language LabVIEW. LabVI EW provides 5 serial communication nodes, which respectively implement serial port initial setting, serial port writing, serial port reading, detection of the number of bytes in the serial port input buffer, and serial port interruption. Before the serial communication between the PC and the wireless acquisition module, the serial port must be configured first, that is, the serial port is initialized, so that the parameter settings of the computer serial port are consistent with the serial port parameters of the wireless transceiver module.

(1) VISA Configure Serial Port.vi: Use this node to set parameters such as serial port baud rate, data bits, stop bits, parity, buffer size, and flow control.
(2) VISA Write: Complete the input of a series of commands sent from the computer to the data acquisition board, such as acquisition, stop, forward and backward movement, left spin, right spin, 6 speeds, automatic cruise, etc.
(3) VISA Read: Used to read data of a specified length from the serial port buffer.
(4) VISA Close: Close an opened serial port to release LabVIEW’s occupation of the serial port resource.
(5) Simple Error Handler.VI: Simple Error Handler, which displays and handles wrong input.

LabVIEW provides a function library Input Device Control that collects keyboard, mouse, and operating handle information. Through Acquire Input Data.vi, you can obtain the current status of the keyboard, mouse, and operating handle.

The operating instructions input by the operator through the keyboard, mouse, operating handle, etc. are converted into operating instructions of the mobile robot. After using Acquire Input Data.vi to obtain the original input information of the handle, use the Unbundle By Name function to extract the required axis and button values, and use Bundle, Cluster To Array, Boolean Array To Number and other functions to convert the input information into the command analysis program. Numerical type is required. In the wheeled movement mode, the Y axis numerically controls the robot’s running speed, and the X axis rotation axis numerically controls the robot’s steering. In the legged or compound mode, the operating mode of the robot can be changed by entering the number keys.

When the program starts running, first open the receive data button, and then open the serial port, you can display the collected data. At the same time, you can see the historical curve of the data from the running interface. The right end of the graph curve is the current acceleration, which can be seen from the curve and the exact data can be seen from the digital control. The runtime interface is shown in Figure 5. When you click the button of each node, you can view the change of its acceleration.

The above method is used to establish a human-machine interaction system for a mobile three-wheeled robot car on the Labview platform. Through this system, the operator can conveniently and intuitively observe the robot’s motion information, and realize the control operation of the robot through the interface. Figure 5 shows the acceleration curve displayed on the Labview chart when the robot car collides.

The Design of the Wireless Control System of the Three-wheeled Robot Car
Figure 5 Acceleration curve when a car collides

6 Conclusion

Because of its simple structure, high flexibility and convenient operation, the wireless mobile three-wheeled robot car has been widely used in outdoor environment applications. The car can also be loaded with various sensors, chips and cameras to complete various tasks in a specific environment. With the development of robot technology and the improvement of robot performance requirements, wheeled mobile robots need to be improved in terms of movement control, path planning, etc. and develop in a composite direction.

The Links:   2MBI200U4H-120 CS8900A-CQZ