"trainer" shall, only be allowed on the stage. Fig.1 ... interface and three control pins for communication, ... connected with 4-pins (2 needed) for lower connection.
2005 WSEAS Int. Conf. on DYNAMICAL SYSTEMS and CONTROL, Venice, Italy, November 2-4, 2005 (pp72-77)
Embedded system for soccer’s robot control JIŘÍ KOTZIAN, ZDENĚK MACHÁČEK, VILÉM SROVNAL Jr, VILÉM SROVNAL Department of Measurement and Control VSB-Technical University of Ostrava 17. listopadu 15, 708 33 Ostrava-Poruba CZECH REPUBLIC
Abstract: The paper presents new generation of an embedded control system for the robot soccer. The robot soccer combines work and amusement. It is popular especially in university teams. The game puts a lot of requirements on hardware, firmware and software of the robot and also on cooperation between developers. Keywords: Robot soccer, Digital signal processor, PCB design, PID regulator, Control algorithms, Diagnostic system.
1 What is Robot Soccer?
2 Hardware of the Robot
The robot soccer is a discipline for two teams of robots. Each team has from 3 to 10 robots, it depends on category. One robot can be the goalkeeper. One host computer per team, mainly dedicated to vision processing and other location identifying, shall be used. The size of each robot shall be limited to 7.5 cm x 7.5 cm x 7.5 cm. The height of the antenna shall not be considered in deciding a robot's size. The ball is an orange golf ball. The Pitch size is 150cm x 130cm for Small League category (3 robots per team) and 220cm x 180cm for Middle League (5 robots per team). The computer equipped with camera is monitoring position of robots and sending commands to robots. The computer software ensures strategy of progress. Three human team members, a "manager", a "coach" and a "trainer" shall, only be allowed on the stage.
The robot for robot soccer consists of these mechanical and electrical parts: 1. Undercarriage (Chassis). It consists of four side plates compose together and 2 wheels with 50mm diameter. Side plates are made from sheet iron. 2. Control system. Control system uses several PCB board with microcontroller, motor drivers, remote communication, DC/DC converters etc. 3. Antenna for communication. 4. Motors. 5. Accumulator pack.
3. 2.
2.1 New Conception of Control System. A previous version of the control system used one board for all parts of robot control system. That conception has a lot of disturbance signals between power and control parts. Another disadvantage was low degree of improvableness. To improve the situation we have decided to use conception of more than one board. Using new conception will eliminate disturbance effect between power and control part. It will also enable to change the only board with part to change. The new conception uses one more advantage. We have added two more CCD sensors for the robot motion sensing at the bottom of the robot.
2.2 Connection Description 4. 5. 1.
Fig.1. Robot parts
The control system of robot for robot soccer has to fulfil two main requirements: First requirement is to control two direct current motors. Second requirement is fast and safe communication with base station. To satisfy first requirement is necessary to implement two synchronous PID regulators powered by motor driver. Each PID regulator uses several loop-backs. First loop-back is incremental sensor on the wheel. Second loop-back is current sensing of the motor. Third
2005 WSEAS Int. Conf. on DYNAMICAL SYSTEMS and CONTROL, Venice, Italy, November 2-4, 2005 (pp72-77)
loop-back is optical motion sensor of robot position at the bottom of the robot. The heart of the control system is the controller. The microcontroller has to have two quadrature timers, SPI interface and three control pins for communication, three AD converters for current sensing and battery monitoring, four PWM modulators and several control pins for motor driver control. Also possibility of external memory and flash connection is need for the future. (Next generation will be able to work as cooperating group with local intelligence on each robot). For following a lot of necessary connections, peripheries and speed the Freescale 56F805 hybrid controller was selected. This controller also supports JTAG interface for programming and debugging. Controlled motor is 6V DC and 1.2A peak. For controlling the motor the driver with high efficiency and low output saturation voltage is needed. There is low of space for chilling. The Freescale MC33887 was selected due to MOS transistor output (no saturation voltage). The problem is that the controller is 3.3V architecture and motor driver is 5V. Inputs of the controller are 5V tolerant but input of driver is 5V CMOS, so 3.3V from controller is not enough. It is necessary to equip each controller output pin with diode and resistor. Cathode is connected to controller output. Anode is connected to driver input and to 5V through 10k resistor. This connection shifts output voltage upon 0.7V. Table 1 The power consumption of given parts Part Supply voltage [V] Controller 3.3 Communication 3.3 Driver 5 Optical sensor 5 Motor 6
Consumption [mA] 150-200 20-200 20 30-130 0-2400
The robot is powered by the Battery (9 cells). Output voltage of the battery is changing from 9V to 13V. Some parts have large power consumption. In these reasons DC/DC converter is needed (linear supply will have lot of wattage looses). For other power saving there is possible to switch off power for optical sensor and motors. There are three DC/DC converters in control system: one continuous for microcontroller and communication 3.3V/1A; one switchable for motors 6V/3A and one switchable for optical sensors and drivers 5V/1A. The motor is controlled using from 10 to 30 kHz PWM signal, so we need DC/DC converter on high operating frequency. We also need to set output voltage for given periphery. In these reasons and for availability LM259x series was used. To satisfy second requirement we need band with low degree of disturbances. Usually is 433MHz band used,
but there are a lot of users and transitions. Used frequency has been moved to the 2.4 - 2.5 GHz ISM band. The nRF2401 has been selected, which is a singlechip radio transceiver for given band. Used channel is selectable by the software. For time base of the nRF chip precision and stable oscillator is needed. Power source Battery pack 10.8V
Board 3 L position sensor
R position sensor
ADNS2620
ADNS2620
Board 1 Antenna
JTAG
Transceiver Nordic
DSP Freescale 56F805
nRF2401
Board 2 3.3V/1 A 5A/1A DC/DC 6V/3A DC/DC
Enable
L motor Driver
R motor Driver
MC3388
MC3388
L motor Faulhaber
006SR
Inc Sensors
R motor Faulhaber
006SR
Fig.2. Blocks diagram of Robot control system
2.3 PCB Design Description Control boards are designed with Formica design system version 4.3. Control PCB boards are designed using two layers of copper and two layers of mask. Bottom layer serves mainly as ground and shield which protect sensitive parts from disturbance effect between power and control part. All components (except DSP filter capacitors and battery connector) are placed on the top sides of PCB boards. This enables easy measurement and developing on the board. Controller board (Board 1). The controller board collects controller and communication. It includes controller Freescale 56F805, 2.4 GHz band Nordic nRF2401 transceiver for communication, universal connectors for later use (4x), position sensing board
2005 WSEAS Int. Conf. on DYNAMICAL SYSTEMS and CONTROL, Venice, Italy, November 2-4, 2005 (pp72-77)
connection, JTAG connector for programming and debugging and standard antenna connector SMA. Power board (Board 2). The power board collects DC/DC converters and motor drivers. Power is connected with 4-pins (2 needed) for lower connection impedance. It includes 2x Motor driver Freescale MC33887 with current measurement, DC/DC converters for motors 6V/3A LM2596, DC/DC converters for optical sensors 5V/1A LM2595, DC/DC converters for microcontroller and communication 3.3V/1A LM2595, power supply switch and 3.3V to 5V interfaces circuits. The layout is on the picture 3. Sensor board (Board 3) – position sensors is connected to six pins connector P4 board1.
Motor connectors
3.3V x 5V
Matlab from MathWorks, especially than Simulink component of the Matlab. The PI controller block was programmed in language C for simple portability into DSP processor. (O’Dwyer A., 2003) 3.2 Identification of the system The constants of the PI controller are proposed on account of identification of the robot system. Identification of the system is made as the response on the step unit. The chosen model for identification is called Broïda model. Broïda studied the position of the inflection point for the systems from order 2 to order 6. (Broïda,V., 1969)
G (s ) =
G0 e − sL (2) n (1 + Ts )
He proposed in the first approximation to compute the model parameters of the equation by determination abscises the time t1 and t2 for witch the system response reach 28 % and 40 % respectively of the final value:
y1 (t ) = 0.28G0
y2 (t ) = 0.40G0
Motor Drivers
DC/DC converters Bat
(3, 4)
This supposes the knowledge of the system static gain. With this value we compute T = 5.5(t2 − t1 ) (5)
L = 2.8t1 − 1.8t2
(6)
Board 2
Fig.3. Component placement - power board
3 Speed control of the micro drive The control of the robot motion is divided into two parts. The first is control of the velocity of the motor motion. The second one is than control of the position. Both parts forms control circuit with auxiliary actuating quantity. For more sensitive control of the motor motion is used current feedback that is converted to PWM signal. This auxiliary circuit can be used or needn’t. The micro drive is controlled by the PWM signal from the DSP processor Motorola 56F805.Whence it follows that actuating variable is PWM signal. The duty cycle value of the PWM signal is given in DSP processor as integer value. This integer value matches to range 0 … 1100. Frequency of the PWM signal is 30 kHz. This signal is input value for H-Bridge Motorola 33887. 3.1 Simulation of the motor speed control For motor control is used PI controller whereof output value (actuating variable) is mentioned PWM signal. For design of the PI controller was used software
Fig. 4. Identification according to Broïda model The each robot has a bit different in mechanical gearing. So, it is important to identify each robot separately depending on area and surface where the robot is moving. The important affair for tuning of the constants for PI controller is frictional force and in the concrete drive slip. Thanks this we have to test settings of the robot on the specific surface. Total identification of the robot before the movement is conditional mentioned difficulties. 3.3 Current feedback for motor control For more sensitive control of the motion is fetch out from H-Bridge 33887 proportional current signal. This
2005 WSEAS Int. Conf. on DYNAMICAL SYSTEMS and CONTROL, Venice, Italy, November 2-4, 2005 (pp72-77)
current signal is converted to voltage signal and fetch to DSP processor. By means of current feedback we can eliminate pick during drive starts and stops. Constants of current controller go out from gain of current sensor and time constants are taken as sum of small constants of current control circuit.
4 Position control of mobile robot Scene of the area is scanning by the digital camera that recognize objects on the scene. This system is able recognize objects with accuracy + 0.02 meter. The optical sensors for position control bears improvement of the movement robot with good accuracy. Additional reason for use optical sensor is requirement of the feedback for micro drive control. Optical sensor should be able prevent drive slip at the start of the robot. Other good reason is predication of the next steps of the robot movement to the final position. Mentioned matter bear on location of the axis of robot rotation. Trajectory of the robot motion is depending on the chosen point of axis rotation. There were used two optical sensors for guarantee of continuous changing values of optical sensor position. During a movement it could be happened that the optical sensor get to location on the surface that is badly recognize by the CCD camera on the chip. If described situation occurs then the second one ensures that sensor’s mistake is eliminated. For gross determination of the position is used information from high resolving encoders. Robot is able to identify his position on the area through described system above.
G (s) = C ⋅ ( s ⋅ I − A ) × B + D −1
(10)
4.2 Robot control using vectors in 2D space Interconnection between both wheels is very important for position control. Cohesion of the both wheels motion has to be very close. That has a great reason for position control. Interlacing between micro drives is solved through the use by algorithm for vector control. Model is shown on the following figure. 7.
Fig. 5. Simulation of the position and speed control for both wheels
4.1 Robust position control of the mobile robot For the position control is used robust controller (optimization H∞). On the basis of the previous identification was approximated time-response characteristic and computed transfer function of the system. We went out from the Riccati differential equation and base on packed matrix we determined numerator and denominator constants of the transfer function. (Shahian B., Hassul M., 1993) A state description of the system: ⋅
x = A ⋅ x + B1 ⋅ w + B 2 ⋅ u z = C1 ⋅ x + D11 ⋅ w + D12 ⋅ u
(7, 8, 9)
y = C 2 ⋅ x + D 21 ⋅ w + D 22 ⋅ u z … matrix of control outputs w … matrix of disturbance, noise from sensors and tracking value y … matrix of measured value The packed matrix is shortened entry for transfer function:
Fig. 6. Robot control using vector field The consequent vector of robot motion is divided into two partial vectors - vector of the right and left wheel. The step size of the wheel motion is given by the angle ratio to desired vector position. Whereby the sensor
2005 WSEAS Int. Conf. on DYNAMICAL SYSTEMS and CONTROL, Venice, Italy, November 2-4, 2005 (pp72-77)
vector angle will be more close to requested final angle of the robot motion thereby position ratio of both wheels will be same.
4. FIRMWARE of the Robot 4.1 Development Environment An implemented developing program algorithm for the robot unit is saved and running inside DSP digital signal processor. The program is implemented with the help of programming environment Metrowerks CodeWarrior 5.5.1, which is intended for DSP processors Freescale (Motorola). Used processor is enough fast for all needed operations for this sophisticated project. Metrowerks CodeWarrior programming environment runs on PC personal computer and this PC is connected by parallel port. Processor state and program values could be watched by serial RS232 connection of DSP and PC. The developing program algorithm is written in C programming language.
Fig.7. Subroutines of soccer robot application
4. 2 Principle of Software Control Algorithm Software algorithms are implemented to DSP digital signal processor. Software design is important for an error free correct system function. Software algorithms have to be transparent and the easiest how it is possible. These requirements lead to separate to single functional
subroutines. Program subroutines are chosen according to their functionality. For soccer robot application are used these functional subroutines (fig. 7): Motor movement function - movement of robot’s wheels, robot unit motion. Communication function - special single chip radio transceiver Nordic for 2.4-2.5GHz ISM frequency band. Interrupt function - allows arbitrary access to DSP processor the execution operations of single subroutines. Regulation function - for the accurate and continues robot unit movement. Position function - feedback of robot unit movement and monitoring engine rotation. Diagnostic function - the robot state monitoring and occurred failure recognition.
4.3 Communication Software Design Communication of robot units and PC personal computer is one of a basic application function. This communication from PC to robot units is necessary to order commands to robot units. These commands represent next robot behaviour. An opposite communication from the robot unit to PC is used for the robot state control and feedback regulator control. Communication is compound of special single chip radio transceiver Nordic for 2.4-2.5GHz ISM frequency band and antenna. Communication part is formed by this microchip and DSP digital signal processor on robot side. On PC side, communication is compound by microchip Nordic, antenna and USB connection to PC. Communication on robot side is provided by SPI communication and other fourth digital controlling signals. This used serial communication and wireless communication is very fast and secure for a data transfer among PC and all playing robot units. Communication conception is designed by master-slave control. A master node is PC personal computer and slave nodes are robot units. Implemented communication software is designed by state graphs using. This method is chosen, because controlling commands are executed step by step. This control commands are used for the transceiver Nordic configuration, data transfer and direction communication definition. There is implemented the interrupt vector table, where are several communication modes – communication initialization, communication predefine, communication definition, communication to DSP, from DSP, communication receiving, communication transmission. When some requirements are executed and interrupt is handled, one mode is chosen according to robot unit state. In some chosen communication mode is executed jump in program sequence to given subroutine. These communication program subroutines are compound of separate steps. Every program step contain given
2005 WSEAS Int. Conf. on DYNAMICAL SYSTEMS and CONTROL, Venice, Italy, November 2-4, 2005 (pp72-77)
program code, which in sequence handle communication with Nordic microchip. The program step code is executed just one time and separately every invoke interrupt. This SPI communication is determined for receiving and transmission too. Commands for robot unit behavior are sent from PC personal computer – from control automated and user programs. These commands are chosen according to program strategy, which is running on PC personal computer. There exists special communication protocol. Packet structure of this protocol is compound of 8 bits of preamble, 16 bits of address, 18 x 16 data bytes, and 16 CRC bits. Data bytes of packet contain 8 command bytes, and other bytes determining rotation speed of motors, size of PWM value, state values and so on.
5. CONCLUSION New generation of robot control system brings enhancement in area of disturbance reduction and expandability. Multi board conception brings possibility of fast interchange necessary parts. New firmware makes behaviour of the robot precise and harmonious. At this time ten pierces of robot are assembled and all are working well. Robots are using incremental sensors inside the motors and current sensing as the feedback. The new control system with surface optical sensors as 3rd feedback is under developing and will be finished in several months.
6. ACKNOWLEDGEMENT The grant Academy of Sciences of Czech Republic supplied “Strategic system control with multi-agents“, number: 1ET101940418, for a years 2004 -2007.
References:
Fig.8. Communication design of robot units and PC
4.4 Implementing Diagnostic System The diagnostic system is used for a robot state verification. This is very important instrument for a state monitoring and a safe robot operating. Developing diagnostic system enables monitoring actual current of motor drivers, actual battery voltage, position of robot, rotation of robot wheels and communication verification. By these diagnostic procedures, there is evident problem or impending failure of robot unit. There exist some special commands, which are used for diagnostic execution. So by them, there is possibility to recognize and diagnose separate functions of robot unit.
[1] Freescale Semiconductor, Inc. 56F805 16-bit Hybrid Controller Rev. 12.0, 02/2004 [2] Freescale Semiconductor, Inc. 33887 -5.0A Hbridge with load current feedback, rev 9.0, 10/2004 [3] Nordic Semiconductor. nRF2401 - single-chip radio transceiver, rev 1.0, 03/2003 [4] National Semiconductor. LM2596 - simple switcher power converter 150 kHz 3A step-down voltage regulator, 03/2002 [5] National Semiconductor. LM2595 - simple switcher power converter 150 kHz 1A step-down voltage regulator, 03/1999 [6] Shahian B., Hassul M. (1993). Control System Design Using Matlab, Prentice Hall, New Jersey 1993, ISBN 0-13-174061-X [7] O’Dwyer A., (2003). Handbook of PI and PID Controller Tuning Rules, Imperial College Press, Singapore 2003, ISBN 1-86094-342-X [8] Broïda,V., (1969) Extrapolation des résponses indicielles apériodiques. Automatisme, vol. XVI, 1969 [9] Kester Walt (2000). Mixed signal and DSP design techniques. Analog Devices, Inc. ISBN 0-91655023-0. [10] Rorabaugh C. (1999). DSP Primer. McCraw-Hill Companies. USA. ISBN 0-07-054004-7. [11] Smith W. (1997). The Scientist and Engineer's Guide to Digital Signal Processing. California Technical Publishing.USA.ISBN0-9660176-3-3 [12] Stranneby D.: Digital Signal Processing DSP&Applications (2000). Newnes. Great Britain. ISBN 0-7506-48112.