Design of human-machine interface for mobile robot based on arm2210 development board

Publisher:chaochenLatest update time:2012-11-05 Source: 21IC Keywords:arm2210 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Introduction

Embedded systems, with their advantages of high performance, low power consumption and low cost, have greatly changed people's lives. For example, MP3 players, smart phones, digital cameras and other products have penetrated into all aspects of people's lives. With the continuous advancement of LCD display technology and the widespread application of graphical user interface GUI (graphical user interface) technology, the human-machine interface has become 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 a mobile robot human-machine interface based on the embedded microprocessor LPC2210 and using the ZLG/GUI software package.

The intelligent mobile robot we designed and developed is a comprehensive system with a PC104 embedded microcomputer as the central processor, TMS320F2812 as the motion controller, and ultrasonic sensors as obstacle avoidance. It integrates multiple functions such as environmental perception, dynamic decision-making and planning, behavior control and execution, and mainly includes a motion system, an electronic information system and a sensor system. It obtains video information through a CCD camera and an image acquisition card, and measures the distance of the obstacle in front through an ultrasonic sensor group to achieve obstacle avoidance. 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 in front, and the driving trajectory.


Figure 1 System block diagram of arm2210

The basic composition of ARM221O

ARM221O is based on Philips ARM7TDM1-S microcontroller LPC2210 to support embedded systems with real-time simulation and embedded tracking. The maximum CPU frequency of LPC2210 is 60MHz, and it has expanded a wealth of peripheral device interfaces, which greatly improves the stability of the system and makes development easier. Figure 1 is a system block diagram of ARM2210.

Since the system includes an RS232 conversion circuit, it can transmit data with the host computer PC104 through UART0. It also includes Toshiba's dot matrix LCD controller T6963C, which expands the LCD interface and provides LED digital tube display and 16 key inputs, so it is very convenient to develop a human-machine interface.

Hardware design of human-machine interface

Data transmission
The serial port of PC104 can be used as the COML communication port of a standard PC or expanded as a console serial port for keyboard input and display terminal output or serial input/output between computers.

UART0 of ARM2210 has 16-byte receiving and transmitting FIFO; the register position conforms to the 550 industrial standard; the trigger point of the receiver FIFO can be 1, 4, 8 and 14 bytes; and the baud rate generator is built in. The

motion information of the mobile robot is transmitted to the embedded microcomputer PC104 through the DSP controller TMS320F2812 of TI and the ultrasonic sensor, and then after the information fusion by PC104, it is transmitted to ARM2210 through the serial port and displayed by the LCD screen.

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 display requirements of the mobile robot human-machine interface. Figure 2 is the schematic diagram of the 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 buttons. ZLG7290 provides an I2C serial interface and a key interrupt signal, which is convenient for connecting to the processor; it can also drive an 8-bit common cathode digital tube or 64 independent LEDs and 64 keys, and the 8 function keys can detect the number of consecutive hits of any key.

This system uses the STN LCD screen YL240128A with a pixel of 240*128 and a yellow-green display as the human-machine interface display; and uses S11, S12, and S13 of the 16 keys of the ARM2210 system as the input part to realize the selection operation of the human-machine interface. [page]

Software design of human-machine interface

The key to the human-machine interface of mobile robots is menu operation and real-time display of graphics and data. GUI is a computer program used to improve the friendliness and ease of operation of human-machine interaction. It is a product based on computer graphics. People no longer need to memorize a large number of commands, but can 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 a simple graphical user interface software for embedded systems developed by Zhou Ligong Company. It takes up little resources and is easy to use. zlg/gui provides the most basic functions of drawing points, lines, circles, arcs, ellipses, rectangles, squares, and fills. The more advanced interface functions include ascii display, Chinese character display, icon display, windows, menus, etc. It supports monochrome, grayscale, pseudo-color, true color and other graphic display devices. Therefore, the zlg/gui software package can meet the design requirements of the human-machine interface of mobile robots.


Figure 2 Schematic diagram of a 240*128 dot matrix LCD module with built-in T6963C

Data transmission
When receiving data sent by the host computer pc104, enable the fifo of uart0 for data transmission/reception, and the reception adopts interrupt processing. Among them, the serial port mode and data structure of uart0 are set to: communication baud rate 9600, 8 data bits, 1 stop bit, no parity check. The 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-bit data bit
uart0_set.stpb = 1; // 1-bit 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<8; i++)
{ rcv_buf[i] = u0rbr; // Read fifo data, clear interrupt flag}
vicvectaddr = 0x00; // End of interrupt processing
}

Window display
The human-machine interface mainly uses the icon menu to display the motion parameters of the mobile robot and related operations of the motion trajectory, such as "open", "pause", "close", etc. Therefore, first define a window data structure, and set the window's starting coordinates, size, title and other related parameters; then call gui_windowsdraw() to output the display window
/* Set 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 through 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 × height (pixels): 16×16*/
Then, after setting the display coordinate address, icon data pointer, corresponding service function, etc. of each icon menu item, you can call gui_menuicodraw() to realize 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 gui_setcolor(1,0) function to set the foreground color and background color. 1 means dot display, 0 means dot off. [page]

Icon menu selection
The interface also needs to implement the selection operation of the icon menu. The i2c device zlg7290 provides the i2c interface function and keyboard interrupt signal. The i2c bus is a serial transmission bus between chips launched by Philips. It uses two wires to realize perfect full-duplex synchronous data transmission, which can easily form a multi-machine system and peripheral device expansion system. The i2c bus uses a hardware setting method for device addresses, 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. The i2c operation mode is divided into master mode i2c and slave mode i2c, corresponding to lpc2210 as the host and slave respectively.
This article uses the master mode i2c to send and receive data, thereby controlling the scanning of the three keys s11, s12, and s13 and detecting their consecutive click times. In the program, the default menu is set first, and then the function zlg7290_getkey() is called 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 pointing to the previous icon menu; if s12 is pressed, it means selecting the current icon function; if s13 is pressed, it means pointing to the next icon menu.
key = zlg7290_getkey();
if(key==key_ok) break; // Click the ok key to select
if(key==key_next)
{ mainmenu[select]. state = 0; // Cancel the previous selection
gui_menuicodraw(&mainmenu [select]);
select++; // Point to the next menu
if(select>2) select=0;
mainmenu[select].state = 1;
gui_menuicodraw(&mainmenu [select]);
}
if(key==key_back)
{ mainmenu[select].state = 0; // Cancel the previous selection
gui_menuicodraw(&mainmenu [select]);
if(select==0) select=2;
else select--; // Point to the next menu
mainmenu[select].state = 1;
gui_menuicodraw(&mainmenu [select]);

Display of the mobile robot's trajectory and related parameters
In order to update the display data and trajectory in real time, pc104 converts the mobile robot's speed, driving direction, turning angle and other information 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) to draw the current trajectory; at the same time, the new speed value and the distance value to the obstacle in front are updated to the corresponding position.
Human-machine interface display effect
Figure 3 is a human-machine interface effect diagram. The entire display window size is 240*128; the icon menu size is 16*16, with a total of six icons; users can add icons and corresponding functions according to their needs. The mobile robot's driving trajectory display window size is 160*100; the other motion parameter display window size is 80*100, which can display the current speed, obstacle distance and robot rotation angle. The position of the car in the figure indicates 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 effect diagram

Conclusion

With the rapid development of embedded system applications, the development of human-computer interaction systems will become more extensive. This article describes the design method of the human-computer interface of a mobile robot based on the arm2210 embedded system. This method is simple in design and low in cost, making the interaction between the operator and the robot more friendly.

References:

[1]. t6963c datasheet http://www.dzsc.com/datasheet/t6963c_635050.html.
[2]. zlg7290 datasheet http://www.dzsc.com/datasheet/zlg7290_734333.html.
[3]. lpc2210 datasheet http://www.dzsc.com/datasheet/lpc2210_454566.html.
[4]. tms320f2812 datasheet http://www.dzsc.com/datasheet/tms320f2812_1116432.html.
[5]. arm7tdmi-s datasheet http:// www.dzsc.com/datasheet/arm7tdmi-s_1231795.html.
[6]. rs232 datasheet http://www.dzsc.com/datasheet/rs232_585128.html.
[7]. s11 datasheet http://www.dzsc.com/datasheet/s11_1617658.html.
[8]. s12 datasheet http://www. dzsc.com/datasheet/s12_1619040.html.

Keywords:arm2210 Reference address:Design of human-machine interface for mobile robot based on arm2210 development board

Previous article:Design of two-phase stepper motor subdivision driver based on STM32
Next article:Bluetooth Baseband Controller Solution

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号