Summary of the invention
Under this background, utilize this platform of anthropomorphic robot, the information processing technology that the research information field is relevant also gets up to control anthropomorphic robot with the partial information technological incorporation simultaneously, improves the intelligent level of anthropomorphic robot.The objective of the invention is on the robot processing platform, merge the more information technology, attempt, on the limited resources of the limited space of robot, controller, seek the information processing technology that is fit to anthropomorphic robot by different experiments.
The technical solution adopted for the present invention to solve the technical problems is:
A kind of biped robot's the information processing platform comprises: the design of the hardware design of robot controller, robot communication agreement, the software design of control system.
The hardware design of robot controller comprises: the design of the design of power module, the design of data communication module, data memory module and the design of steering wheel control module.
Wherein the steering wheel control module is the core of robot controller, determined the performance quality of total system, it mainly acts on is exactly synchronously to produce the multi-channel PWM waveform in real time to come the drive machines person joint, this module is made up of the PIC16F877 microcontroller, realizes that control algolithm, slave computer are coordinated and the generation of multichannel steering wheel control signal.Wireless communication module, wire communication module and behavioral data memory module link to each other with the PIC16F877 microcontroller respectively.Controller is supported wire communication and two kinds of patterns of radio communication simultaneously, selects to get final product by the communication pattern switch, and the data of PC calculated off-line can be transferred on the robot information processing platform by wire module and wireless module are arranged.Wireless communication module is made up of nRF905 radio frequency chip and STC4051AD microcontroller, makes the upper and lower machine carry out data interaction by radio frequency (RF); The wire communication module is realized by the SP3232 level transferring chip, makes the upper and lower machine carry out data interaction by the RS232 bus; The behavioral data memory module is made up of the serial EEPROM of iic bus, selects for use AT24C512 to come the storage action data as outer extension memory, and there is 64K byte (65536 s') storage space its inside.In order to reduce the unnecessary traffic, a part of behavioral data can be stored in advance in the behavioral data module of robot controller during control robot, the steering wheel control module can be carried out read-write operation to it by iic bus; Power module provides stable voltage by linking to each other with the PIC16F877 microcontroller to above-mentioned each module.
The design of robot communication agreement comprises: host computer sends agreement and slave computer feedback protocols, and these two kinds of agreements all adopt the form of fixed length, and every frame data are 26 bytes.
It is data packet head (2 byte)+bag content (23 byte)+verification and (1 byte) that host computer sends data layout.The beginning of data packet head sign one bag data is made up of two bytes, and first byte is 0xFF, and second byte is 0xFE; The bag content is that host computer sends information to steering engine controller, and bag content implication is (separating by byte): controller address sign indicating number (1-252)+control command+data group number (0-255)+data frame number (0-255)+maximum frame number (0-255)+velocity information (0-7)+expected angle (0 of x road steering wheel-180).The control address sign indicating number is represented ID number of robot, and the robot of ID number coupling receives and deal with data, and arranging ID simultaneously and be at 127 o'clock is the broadcast address sign indicating number, and all robots all receive data or order; The mode of verification and employing " and verification ", with one 8 unsigned number, to data packet header, each byte addition summation of bag content is not considered to overflow, then to get complement code (with numeral 0 deduct this with) get final product.
The slave computer feedback protocols is the same substantially with the form that host computer sends protocol code, and different is bag content difference: controller address sign indicating number (1-252)+data label+data group number (0-255)+data frame number (0-255)+maximum frame number (0-255)+velocity information (0-7)+expected angle (0 of x road steering wheel-180).
The software design of control system comprises: the control of multichannel steering wheel, signal procedure design and data memory module program design.
The method that platform adopts single-chip microcomputer regularly to interrupt produces PPM (Pulse Position Modulation) signal controlling steering wheel.By steering wheel being carried out speed control and synchro control and adopting serial and parallel hybrid processing, utilize timer to interrupt producing the PPM signal and realize the control of multichannel steering wheel; Drive the software of nrf905 and under standby mode, dispose its internal register, adopt the UART serial ports to carry out wire communication or radio communication, if single-chip microcomputer does not have the SPI mouth can use software simulation under software by the SPI interface communication.Data memory module is selected the AT24C512 storer that has the IIC interface for use, AT24C512 has 65535 bytes, according to 19 bytes of every frame data (effective information 18 bytes+verification and 1 byte), stipulate that each distinguishes multipotency and store 128 frames, then a slice AT24C512 can divide 27 districts and store data.
Beneficial effect based on biped robot's information processing platform of the present invention is that the software of the information processing platform has adopted the format program of embedded software, is divided into Drive Layer, configuration layer, key-course and dispatch interface layer.Can increase the type of steering wheel, the parameter of modification steering wheel at configuration layer; Can be according to hardware circuit board actual hardware structural modification program parameter etc., thereby this information processing platform can be used as the general-purpose platform of steering wheel control, not only can on anthropomorphic robot, use, can also be used to control the other machines people joint, mechanical arm, machine fish etc. all with the mechanism of three-way steering wheel as the joint.
Embodiment
The present invention is further described below in conjunction with drawings and Examples.
One, the hardware design of robot controller
As shown in Figure 1, the hardware components of robot controller mainly comprises four module: transceiver communication module, steering wheel control module and data memory module, power module, wherein the steering wheel control module is the core of robot controller, determined the performance quality of total system, its main effect is exactly synchronously to produce the multi-channel PWM waveform in real time to come the drive machines person joint.
As shown in Figure 1, this controller adopts multistage distribution control method, is divided into upper and lower two-layer control, and function is respectively:
The upper strata: PC, finish the calculated off-line and the adjustment of robot behavior data, by wired or wireless network control with coordinate the action behavior of each robot, and can by robot with sensor obtain environmental information.
Lower floor: realize control algolithm, the coordinated movement of various economic factors of control multichannel steering wheel.The control corresponding system module can be divided into following content:
Power module: provide stable voltage to each module of lower computer system.
Algorithm, motor control module: form by the PIC16F877 microcontroller.Realize that control algolithm, slave computer are coordinated and the generation of multichannel steering wheel control signal.
Wireless communication module: form by nRF905 radio frequency chip and STC4051AD microcontroller.Realize that the upper and lower machine carries out data interaction by radio frequency (RF)
Wire communication module: realize by the SP3232 level transferring chip.Realize that the upper and lower machine carries out data interaction by the RS232 bus.
The behavioral data memory module: the serial EEPROM (24C512) by iic bus is formed.PIC16F877 carries out read-write operation by iic bus to it.
1, the design of power module
As shown in Figure 2; power module in the robot information processing platform controller of the embodiment of the invention; adopting rated voltage is 7.4V and the lithium polymer battery that has holding circuit, and the ability that sparks is strong, discharge current is big, provides stable voltage to each module of lower computer system.When a plurality of steering wheels were worked, electric current was very big in the circuit, and cell voltage will soon drop to about 6.5V, and in order to make circuit working at wide-voltage range, system all selects the chip of 3.3V power supply for use, and this just needs to use the voltage stabilizing chip to export 3.3V.In order to prevent that the battery reversal connection from causing damage to circuit, sealed in diode D1.U1 provides stable 3.3V operating voltage for the mu balanced circuit LM1117 of low pressure reduction to control system.U6 is another sheet LM1117, and the burning voltage of 5V is provided, so that the control line of steering wheel can also satisfy the demand of stable level when large power supply ripple very, thereby suppresses the jitter problem that steering wheel produces.
2, the design of data communication module
Because the action data of robot comes from PC, therefore need to use the communication technology that data are sent on robot hardware's controller.The biped robot has nearly 24 joints, and each frame data is minimum as to comprise 24 angle information values like this, belongs to long frame traffic.In more several bus communications, adopt the RS-232 bus the most suitable as communicating between PC and robot controller, reason is as follows:
(1) system resource is limit: PC generally all has serial ports, does not have direct IIC interface or CAN interface, uses RS-232 the most convenient, also saves most system cost;
(2) traffic rate: the traffic rate of RS-232 is minimum in several buses, what PC was passed to robot is action data, be that off line passes on the robot control panel, the synchronous driving data, but relatively and robot steering wheel working time also be very fast, so not high to required communication rate;
(3) frame information: because the byte that every frame comprises is a lot, the CAN bus is a kind of short frame traffic, and every frame transmits the data of 8 bytes at most, needs several frames to transmit, and receiving end deals with the comparison difficulty.
(4) transmission range: the transmission range of RS232 bus is longer than iic bus transmission range.
In order to debug conveniently, robot controller is supported wire communication and two kinds of patterns of radio communication simultaneously, selects to get final product by switch.Wireline side adopts the RS232 serial communication, wireless communication section is to have increased radio receiving transmitting module on the basis of wire communication part, be radio-frequency communication module NRF905, radio receiving transmitting module is that the wireless communication module in the slave computer is come out separately, add that RS232 level transferring chip and low pressure reduction voltage stabilizing chip (LDO) constitute, transmitter is given circuit supply by get 5V voltage from the USB mouth of PC, and three pins of RS232 are received on the transmitter by three pins of earphone cord.
3, the design of data memory module
The behavioral data of robot is calculated off-line and manual fine-tuning generation in host computer, host computer is to ROBOT CONTROL the time, in order to reduce the unnecessary traffic, a part of behavioral data can be stored in the behavioral data module of robot controller in advance.The behavioral data memory module of the embodiment of the invention: the serial EEPROM by iic bus is formed, and promptly selects for use AT24C512 to come the storage action data as outer extension memory, and there is 64K byte (65536 s') storage space its inside.The behavioral data of robot is calculated off-line and manual fine-tuning generation in host computer, in order to reduce the unnecessary traffic, a part of behavioral data can be stored in the behavioral data module of robot controller in advance during the PC control robot.The steering wheel control module can be carried out read-write operation to it by iic bus.
4, the design of steering wheel control module
As shown in Figure 3, the steering wheel control module is the minimum system of microcontroller, comprises master controller PIC16F877, electrify restoration circuit, oscillatory circuit, status indicator lamp.This steering wheel control module is based on master controller PIC16F877, electrify restoration circuit, and oscillatory circuit, status indicator lamp connect respectively and master controller, and electrify restoration circuit links to each other with master controller PIC16F877 pin one (nRST); The pin one of oscillatory circuit DEBUG chip is connected in master controller PIC16F877 pin one (nRST), andpin 4,5,6 is connected with pin 40 (RB7), 39 (RB6), 36 (RB3) of master controller PIC16F877 respectively; Status indicator lamp connects the pin 6 (LED) of master controller PIC16F877.The PIC single-chip microcomputer has also designed its unique on-line debugging and system from programming interface, is convenient to the debugging and the upgrade maintenance of program.The battery voltage sampling circuit that utilizes interior analog to digital conversion circuit (ADC) of sheet and resistance R 51 and R54 to constitute is realized the under-voltage protection to battery.
For compatible mutually with wireless module, the supply voltage that slave computer adopts is 3.3 volts, and the signal voltage of steering wheel then requires to more than the 5V, and this relates to mixed signal circuit and handles.If directly the port of PIC16F877 is linked on the signal wire of steering wheel, will be very dangerous.Because what this microcontroller adopted is CMOS technology, if its port voltage than its chip power voltage (3.3V) height, then chip can produce the distinctive electric current of CMOS chip " breech lock " effect, causes the electric current of chip sharply to increase, at last chip overheating and burning.
Mixed signal handle can application specific chip, as 74LVC245, realize the signal compatibility of 3.3V and 5V.But the invention belongs to the application scenario of low speed signal, can realize the processing of mixed signal circuit with the form of electric resistance partial pressure.
Two, the design of robot communication agreement
The communications portion of this information processing platform comprises the two large divisions: host computer (PC) sends agreement and robot control panel feedback protocols, and these two kinds of agreements all adopt the form of fixed length, and every frame data are 26 bytes.
1, host computer sends agreement
Host computer sends data layout: data packet head (2 byte)+bag content (23 byte)+verification and (1 byte).
(1) data packet head
The beginning of sign one bag data is made up of two bytes, and first byte is 0xFF, and second byte is 0xFE.
(2) bag content
Host computer sends information to steering engine controller, and bag content implication is (separating by byte): controller address sign indicating number (1-252)+control command+data group number (0-255)+data frame number (0-255)+maximum frame number (0-255)+velocity information (0-7)+expected angle (0 of x road steering wheel-180).The control address sign indicating number is represented ID number of robot, and the robot of ID number coupling receives and deal with data, and arranging ID simultaneously and be at 127 o'clock is the broadcast address sign indicating number, and all robots all receive data or order.
(3) verification and
Adopt the mode of " and verification ", specific practice is, with one 8 unsigned number, to data packet header, each byte addition summation (need not consider to overflow) of bag content, then to get complement code (with numeral 0 deduct this with), can generate verification with.
2, slave computer feedback protocols
The form that slave computer feedback protocols and host computer send protocol code is the same substantially, also is by data packet head+bag content+verification and constitutes.Different is bag content difference:
Controller address sign indicating number (1-252)+data label+data group number (0-255)+data frame number (0-255)+maximum frame number (0-255)+velocity information (0-7)+expected angle (0 of x road steering wheel-180).
Three, the software design of control system
The method that this platform adopts single-chip microcomputer regularly to interrupt produces PPM (Pulse Position Modulation) signal controlling steering wheel.
1, multichannel steering wheel control
The core missions of steering engine controller are exactly to the speed control of steering wheel and the synchro control of many steering wheels.The present invention adopts the method for differential, and promptly every the certain angle P of t change, then the speed of the big more steering wheel rotation of t is slow more, introduces the notion of stepping amount then in program, i.e. the instruction number of the interior change of each cycle 20ms, the speed control of realization steering wheel.The synchro control of many steering wheels makes two to forward the different steering wheels of angle to and arrive appointed positions simultaneously, and synchro control is meant the P value difference that changes every each steering wheel of T time.
In conjunction with the relative merits of serial and parallel processing, the present invention adopts the way of hybrid processing.Utilize timer to interrupt producing the PPM signal, steering wheel control signal maximum pulse width is 2.5ms, and the cycle is 20ms, a PPM signal period (20ms) can be divided into 8 periods, each period is 2.5ms, and this timing just in time satisfies the pulsewidth requirement of steering wheel maximum angle.8 sections modes that adopt serial processing, in each period, produce 3 road PPM signals, this three road PWM adopts parallel processing method, the passage FEFO of burst length section is put low, long is the most rearmounted low, if the long pulse of three road signals does not all have 2.5ms, wait for that then total timing arrives 2.5ms after, continue to carry out next group again.Can produce nearly 24 road PPM signals so altogether.The generation process flow diagram of multichannel PPM signal as shown in Figure 4.
2, signal procedure design
No matter be wire communication or radio communication, essence all is the UART serial communication, and the software-driven to nrf905 is very simple, only need dispose its internal register by the SPI interface communication under standby mode and get final product, if single-chip microcomputer does not have the SPI mouth can use software simulation under software.
3, data memory module program design
What this platform was selected for use is the AT24C512 storer that has the IIC interface, and AT24C512 has 65535 bytes, and host computer has 26 bytes when sending data, and wherein effective information is 18 bytes; Correct in order to guarantee to read after storage, simultaneously with verification with also be deposited among the AT24C512, therefore every frame data totally 19 bytes stipulate that each distinguishes multipotency and store 128 frames, then a slice AT24C512 can divide 65535/ (19*128+1)=26.9, promptly can divide 27 districts.
As shown in Figure 5, the robot of the present invention information processing platform, information acquiring technology, data communication technology and the joint Driving technique of anthropomorphic robot have been related generally to, described controller comprises that also information processing and the open interface of realizing information processing and behavior planning function give the user so that the user can carry out the application module of secondary development, and dashed bars is the part of secondary development and research among Fig. 5.
Robot platform control system of the present invention, information acquisition and information fusion technology and data communication technology are applied to receive the information of driver module and finish information fusion processing, the current running status of transfer robot simultaneously in its steering engine controller; According to the assignment instructions that receives from the PC Control Software, cook up robot the concrete behavior pattern that should take.