Design of human-machine interface for intelligent mobile robot based on ARM2210

Publisher:快乐之源Latest update time:2010-08-29 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) 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 ARM2210 system block diagram

Basic composition of ARM221O

ARM221O is based on PHILIPS ARM7TDMI-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, data can be transmitted 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 COM1 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 receive and transmit FIFOs; the register position complies with the '550 industrial standard; the receiver FIFO trigger point 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 TI company DSP controller TMS320F2812 and ultrasonic sensors, etc., and then after information fusion by PC104, it is transmitted to ARM2210 through the serial port and displayed on 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 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 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 an I2C serial interface and a key interrupt signal for easy connection with 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 size of 240*128 and a yellow-green display as the human-machine interface display screen; S11, S12, and S13 of the 16 buttons of the ARM2210 system are used as the input part to realize the selection operation of the human-machine interface.

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-computer 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 that it can be tailored and high-speed. ZLG/GUI is a simple graphical user interface software for embedded systems developed by Zhou Ligong Company, which occupies small resources and is easy to use. ZLG/GUI provides the most basic functions of drawing points, lines, circles, arcs, ellipses, rectangles, squares, and filling. 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 the mobile robot.


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

Data Transfer

When receiving data sent by the host computer PC104, enable UART0's FIFO for data transmission/reception, and receive using interrupt processing. 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 program is 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; // Interrupt processing ends
}

Window display

The human-machine interface mainly uses the icon menu to display the motion parameters of the mobile robot and the 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 up the main window and display 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, where the icon data and text display can be converted into data through 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 the GUI_SetColor(1,0) function to set the foreground and background colors. 1 means the dots are on, and 0 means the dots are off.

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 an inter-chip serial transmission bus launched by Philips. It uses two wires to achieve 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 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. 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 buttons 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 LG7290_GetKey() function directly reads the key value on the device ZLG7290 by calling IRcvStr (ZLG7290,1,&rece,1). If S11 is pressed, it points to the previous icon menu; if S12 is pressed, it indicates that the current icon function is selected; if S13 is pressed, it points to the next icon menu.

key = ZLG7290_GetKey();
if(key==KEY_OK) break; // Click OK to selectif
(key==KEY_NEXT)
{ mainmenu[select].state = 0; // Cancel the previous
selectionGUI_MenuIcoDraw(&mainmenu [select]);
select++; // Point to the next menuif
(select>2) select=0;
mainmenu[select].state = 1;
GUI_MenuIcoDraw(&mainmenu [select]);
}
if(key==KEY_BACK)
{ mainmenu[select].state = 0; // Cancel the previous selectionGUI_MenuIcoDraw
(&mainmenu [select]);
if(select==0) select=2;
else select--; // Point to the next
menumainmenu[select].state = 1;
GUI_MenuIcoDraw(&mainmenu [select]);

The trajectory and related parameters of the mobile robot are displayed

In order to update the display data and driving 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 driving trajectory; at the same time, the new speed value and the distance value to the obstacle in front are updated to the corresponding position.

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.

Reference address:Design of human-machine interface for intelligent mobile robot based on ARM2210

Previous article:Design of APT control system for space optical communication based on ARM
Next article:Design of ultrasonic emission and control circuit based on ARM

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号