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.
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
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Abnormal output of op amp
- Guys, please help me find out what the problem is.
- I would like to ask about the interrupt problem of msp430f5529
- Three questions on embedded ARM basics
- [Rawpixel RVB2601 development board trial experience] GRB breathing light
- Dancing flame pendant
- Do you purchase samples or apply for them for free?
- SDK BLE example project command line compilation (HeartRate device)
- EEWorld interviews Toshiba PCIM booth engineer: 2-minute short video shows you key products and solutions
- Is it necessary to learn TI's KeystoneII series multi-core heterogeneous processors?