Electronic
Design of Robot Human-Computer Interaction System Based on LPC2210 Microcontroller

Design of Robot Human-Computer Interaction System Based on LPC2210 Microcontroller

The mobile robot man-machine interface provides intuitive path graphics, motion speed and angle, obstacle information, etc. for the motion control of mobile robots. Receive the motion information of the central processor PC104 through the serial port UART0 of ARM2210, use the LCD controller T6963C of Toshiba to drive the STN LCD screen YL240128A, and the basic drawing and menu operation functions provided by the ZLG/GUI software package. The mobile robot man-machine interface of the board, and the I2C interface function and keyboard interrupt signal provided by the I2C device ZLG7290 of ARM2210 are used to realize menu selection, which has strong practicability.

Author: Toshiba, ARM

The mobile robot man-machine interface provides intuitive path graphics, motion speed and angle, obstacle information, etc. for the motion control of mobile robots. Receive the motion information of the central processor PC104 through the serial port UART0 of ARM2210, use the LCD controller T6963C of Toshiba to drive the STN LCD screen YL240128A, and the basic drawing and menu operation functions provided by the ZLG/GUI software package. The mobile robot man-machine interface of the board, and the I2C interface function and keyboard interrupt signal provided by the I2C device ZLG7290 of ARM2210 are used to realize menu selection, which has strong practicability.

1 Introduction

Embedded system has changed people’s life to a great extent with its advantages of high performance, low power consumption and low cost. For example, MP3 players, smart phones, digital cameras, etc. have penetrated into all aspects of people’s lives. With the continuous advancement of liquid crystal Display technology and the wide application of Graphical User Interface (GUI) technology, the human-machine interface is becoming more and more friendly. It can provide intuitive path graphics, data parameters, etc. for the motion control of mobile robots. This paper introduces a method of designing mobile robot man-machine interface based on embedded microprocessor LPC2210 and applying ZLG/GUI software package.

The intelligent mobile robot we designed and developed is a PC104 embedded microcomputer as the central processor, TMS320F2812 as the motion controller, and ultrasonic sensor as a set of environmental perception, dynamic decision-making and planning, behavior control and execution and other functions for obstacle avoidance. The integrated system mainly includes motion system, Electronic information system and sensing system. It obtains video information through a CCD camera and an image acquisition card, and uses the ultrasonic sensor group to measure the distance of obstacles ahead to avoid obstacles. The human-machine interface of the mobile robot mainly displays the motion information of the mobile robot to the user, such as the current motion speed, the distance to the obstacle ahead and the driving trajectory.

2 The basic composition of ARM221O

ARM221O takes ARM7TDMI-S microcontroller LPC2210 of PHILIPS Company as the core, in order to support the embedded system of real-time simulation and embedded tracing. The maximum CPU frequency of LPC2210 is 60MHz, and it expands a wealth of peripheral device interfaces, which greatly improves the system stability and makes development easier. Fig. 1 is the system block diagram of ARM2210.

Design of Robot Human-Computer Interaction System Based on LPC2210 Microcontroller
Figure 1 System block diagram of ARM2210

Since the system includes the RS232 conversion circuit, it can transmit data with the host computer PC104 through UART0, and also includes Toshiba’s dot-matrix LCD controller T6963C, which expands the LCD interface and provides LED digital tube display and 16 key input. , so the development of man-machine interface is very convenient.

3 Hardware Design of Human-Machine Interface

3.1 Data transmission

The serial port of PC104 can be used as a COM1 communication port of a standard PC or extended to a console serial port for keyboard input and display terminal output or a serial input/output port between computers.

UART0 of ARM2210 has 16-byte receive and transmit FIFO; register location conforms to ‘550 industry standard; receiver FIFO trigger point can be 1, 4, 8 and 14 bytes; built-in baud rate generator.

The motion information of the mobile robot is transmitted to the embedded microcomputer PC104 through TI’s DSP controller TMS320F2812 and ultrasonic sensors. After information fusion by PC104, it is transmitted to the ARM2210 through the serial port and displayed on the LCD screen.

3.2 LCD display and menu selection

Toshiba’s LCD controller T6963C has a unique hardware initialization setting function, the maximum driving dot matrix LCD is monochrome 640*128 (single screen), supports separate display and mixed display of graphics and text, and has a character generator, which can meet the needs of Display requirements for mobile robot human-machine interface. Figure 2 is a schematic diagram of a 240*128 dot matrix graphic LCD module with built-in T6963C.

In addition, the ARM2210 system is equipped with an I2C device ZLG7290 and 16 keys. ZLG7290 provides I2C serial interface and key interrupt signal, which is convenient to connect with the processor; and can drive 8-bit common cathode digital tubes or 64 independent LEDs and 64 keys, and the 8 function keys can detect the number of consecutive clicks of any key.

This system selects the STN LCD screen YL240128A with a dot pixel of 240*128 points and yellow-green display as the man-machine interface display screen; uses S11, S12, S13 of the 16 buttons of the ARM2210 system as the input part to realize the selection of the man-machine interface operate.

4 Software design of man-machine interface

The key to the human-machine interface of the mobile robot is the menu operation, as well as the real-time display of graphics and data. GUI is a computer program used to improve human-computer interaction friendliness and operability, and it is a product based on computer graphics. People no longer need to memorize a large number of commands, but operate conveniently through windows and menus. Due to the limited resources of embedded systems, the requirements for GUI are tailorable and high-speed. ZLG/GUI is developed by Zhou Ligong Company. It is a simple graphical user interface software for embedded systems that takes up less resources and is easy to use. ZLG/GUI provides the most basic functions of drawing points, lines, circles, arcs, ellipses, rectangles, squares, fills, etc. The more advanced interface functions include ASCII display, Chinese character display, icon display, window, menu, etc. Support monochrome, grayscale, pseudo-color, true color and other graphics display devices. Therefore, using the ZLG/GUI software package can meet the design requirements of the mobile robot man-machine interface.

Design of Robot Human-Computer Interaction System Based on LPC2210 Microcontroller
Figure 2 Schematic diagram of 240*128 dot matrix LCD module with built-in T6963C

4.1 Data transfer

When receiving the data sent by the host computer PC104, enable the FIFO of UART0 to send/receive the data, and use the interrupt processing method to receive. Among them, the serial port mode and data structure of UART0 are set as: communication baud rate 9600, 8 data bits, 1 stop bit, no parity check. Its main procedures are as follows:

/*Define serial port mode and data structure*/
typedef struct Uart0Mode
{ uint8 datb; // word length
uint8 stpb; // stop bit
uint8 parity; // parity bit
} UART0MODE;
/*Initialize serial port*/
uart0_set.datb= 8; // 8 data bits
uart0_set.stpb = 1; // 1 stop bit
uart0_set.parity = 0; // no parity UART0_Ini(9600, uart0_set); // initialize serial port mode
/*Serial port UART0 receive interrupt*/
void __irq IRQ_UART0(void)
{ uint8 i;
if( 0x04==(U0IIR&0x0F) ) rcv_new = 1; // set new data flag
for(i=0; i{ rcv_buf = U0RBR; // read FIFO data, clear interrupt flag}
VICVectAddr = 0x00; // end of interrupt processing

}

4.2 Window display

The man-machine interface mainly realizes the display of the motion parameters of the mobile robot and the related operations of the motion trajectory through the icon menu, such as “open”, “pause”, “close” and so on.Therefore, first define the data structure of a window, and set the starting coordinates, size, title and other related parameters of the window; then call GUI_WindowsDraw() to output the display window

/* Set up the main window and display the output */
mainwindows.x = 0;
mainwindows.y = 0;
mainwindows.with = 240;
mainwindows.hight = 128;
mainwindows.title = (uint8 *) “Mobile Robot Interface”;
mainwindows.state = NULL;
GUI_WindowsDraw(&mainwindows); // draw the main window

The icon menu also needs to define the relevant data structure, in which the icon data and text display can be converted into data by the font software. For example, the corresponding “Open” icon is converted into data:

uint8 const menuico1[]={
0x00,0x70,0x00,0x1C,0x00,0x12,0x1C,0x1A,
0x17,0x0A,0x21,0xF1,0x20,0x1A,0x4F,0xFE,
0x58,0x02,0x50,0x02,0x60,0x06,0x60,0x04,
0x60,0x04,0x40,0x08,0x7F,0xF8,0x00,0x00,
}; /*; icon “open”; width x height (pixels): 16 x 16*/
Then, after setting the display coordinate address of each icon menu item, the data pointer of the icon, the corresponding service function, etc., GUI_MenuIcoDraw() can be called to realize the display output.
mainmenu[0].icodat = (uint8 *) menuico1;
mainmenu[0].title = (uint8 *) “open”;
mainmenu[0].Function = (void

())Runopen;

In addition, the main program needs to call the GUI_SetColor(1, 0) function to set the foreground color and background color. 1 means dot display, 0 means dot off.

4.3 Icon menu selection

The interface also needs to implement the selection operation of the icon menu. I2C device ZLG7290 provides I2C interface function and keyboard interrupt signal. The I2C bus is an inter-chip serial transmission bus introduced by Philips. It realizes complete full-duplex synchronous data transmission with 2 wires, and can easily form a multi-computer system and an expansion system for peripheral devices. The I2C bus adopts the hardware setting method of the device address, and completely avoids the chip select line addressing method of the device through software addressing, so that the hardware system has the simplest and most flexible expansion method. I2C operation mode is divided into master mode I2C and slave mode I2C, corresponding to LPC2210 as master and slave respectively.

In this paper, the main mode I2C is used to send and receive data, so as to control the scanning of the three buttons S11, S12 and S13 and detect the number of consecutive hits. In the program, set the default menu first, and then call the function ZLG7290_GetKey() to read the pressed key value. The ZLG7290_GetKey() function directly reads the key value on the device ZLG7290 by calling IRcvStr (ZLG7290,1,&rece,1). If S11 is pressed, it means that it points to the previous icon menu; if S12 is pressed, it means that the current icon function is selected; if S13 is pressed, it means that it points to the next icon menu.
key = ZLG7290_GetKey();
if(key==KEY_OK) break; // Click OK to select
if(key==KEY_NEXT)[select]{ mainmenu
.state = 0; // cancel the previous selection [select]GUI_MenuIcoDraw(&mainmenu
);
select++; // point to the next menu
if(select>2) select=0;[select]mainmenu
.state = 1; [select]GUI_MenuIcoDraw(&mainmenu
);
}
if(key==KEY_BACK)[select]{ mainmenu
.state = 0; // cancel the previous selection [select]GUI_MenuIcoDraw(&mainmenu
);
if(select==0) select=2;
else select–; // point to next menu[select]mainmenu
.state = 1; [select]GUI_MenuIcoDraw(&mainmenu

);

4.4 Display of the mobile robot’s trajectory and related parameters

In order to update the display data and driving trajectory in real time, PC104 converts the speed, driving direction, turning angle and other information of the mobile robot into coordinate information on the LCD screen, and calls the basic drawing function GUI_Line(uint32 x0, uint32 y0, uint32 x1, uint32 y1 , TCOLOR color), draw the current driving trajectory; at the same time, update the new speed value and the distance value from the obstacle ahead to the corresponding position.

4.5 Human-machine interface display effect

Figure 3 is the effect diagram of the man-machine interface. The size of the entire display window is 240*128; the size of the icon menu is 16*16, and there are six icons in total; users can add icons and corresponding functions according to their needs. The size of the display window of the mobile robot’s driving track is 160*100; the size of the display window of other motion parameters is 80*100, which can display the current speed, the distance of obstacles and the rotation angle of the robot. The position of the car in the figure represents the starting point of the trajectory, and there is a coordinate display and a scale of 1:500 in the lower left corner.

Figure 3 Human-machine interface realization effect diagram

Epilogue

The Links:   SKIIP38AC12T4V1 SKKH 106/16E