A kind of learning robot and control method
Technical field
The present invention relates to intelligent robot technology field more particularly to a kind of learning robot and control methods.
Background technique
Learning robot exactly integrates the relevant knowledge of Robot Design and robot and knowledge, includes programming, machinery
Structure, dynamic structure, power transmission, the application of sensor etc., through different teaching aids, course and match, allow child to borrow
Robot is helped to learn, them is made to generate strong learning interest and has very big curiosity, cultivates their think independently
And manipulative ability.
The function of learning robot excessively unicity at present, usually only graphic programming function, writing function or setting-out
Track function, when learning robot execution setting-out tracks function, since driving chip is easy to happen zero degree drift, and, seek
The precision of mark is lower.
Summary of the invention
It is an object of the invention to propose a kind of feature-rich learning robot.
To achieve this purpose, the present invention adopts the following technical scheme: the following steps are included:
Step A: it when the intelligent terminal and robot for being equipped with APP application interact, is obtained and is used by bluetooth module
It is requested by the control that APP application is sent at family;
Step B: the identification control request, and control the corresponding operating that robot completes the control request;
The control request includes direction controlling, voice control, setting-out tracks, piano mode, graphic programming, music are broadcast
It puts and intelligence is write.
Learning robot of the invention is feature-rich, and the APP application operating on intelligent terminal can be realized to machine in user
The control of device people, it can be achieved that direction controlling, music, piano mode, setting-out tracking, graphic programming, voice control and
The function of intelligently writing, multiple functions are integrated, and the function of solving existing learning robot excessively single is asked
Topic.
Preferably, in the step B, if control request tracks for setting-out, comprising the following steps:
Step B1: any line footpath is sketched out in the APP application of mobile terminal, APP is applied with the data of limited coordinate
It is sent to robot;
Step B2: the character data of coordinate information is converted into numerical value, and is stored in array;
Step B3: controlling the starting of driving chip U21 by triode U15, and setting delay starts for 2 seconds;
Step B4: judge whether data are empty: if data terminate this operation to be empty, if data are not sky, continue into
Row following steps;
Step B5: then comparing the coordinate information of target and the current state of robot, and current angular is passed through Eulerian angles public affairs
Course angle is carried out equivalent conversion by formula, and parameter that driving chip U21 is fed back is converted into using Euler's angle formula to the reality needed
Angle;
Step B6: controller adjusts the direction of robot according to the position of target by the control to steering engine, and is tied
Beam symbol judgement executes this operation of end, if processing terminate all coordinates, weighs if whole coordinates are disposed
Step B4 is executed again.
If robot is currently in first quartile, target is then turned left in the second quadrant, if target is turned right in other quadrants;
If robot is currently in the second quadrant, target is then turned right in first quartile, if target is turned left in other quadrants;If robot
Currently in third quadrant, target is then turned right in the second quadrant, if target is turned left in other quadrants;If robot is currently
Four-quadrant, target are then turned left in first quartile, if target is turned right in other quadrants.
Driving chip U21 restarting is controlled by triode U15, and is delayed 2 seconds, solving driving chip, there are zero degrees
The problem of drift, controls the on-off of driving chip U21 every time before setting-out, eliminate zero degree drift, greatly reduce angular error,
It can accurately realize that setting-out tracks.
Preferably, in the step B, if control request is direction controlling, master controller calls direction control function,
The control in direction is carried out according to the corresponding direction in operation APP application in conjunction with pid algorithm.
APP by being mounted on mobile terminal changes direction using upper control robot, can make three in robot
The respective direction that steering engine rotation changes, realizes the direction controlling function of robot.
Preferably, in the step B, if control request is voice control, the voice inputted in APP is applied is believed
Breath uploads to Cloud Server processing, the identifier after conversion is sent to master controller, and then control described in robot completion
Control request.
Cloud Server dissection process can be uploaded to by the voice messaging of the APP of mobile terminal application input, voice messaging,
Voice messaging is converted into identifier, identifier is sent to master controller, and then controls robot and complete the control request,
The voice control function for realizing learning robot keeps the operation of speech robot people more intelligent.
Preferably, in the step B, if control request is write for intelligence, upper pattern is applied according to APP, to machine
The coordinate of coordinate and target position where device people is analyzed and algorithm process, it can be deduced that the changing value of XYZ axis, respectively
Three steering engine rotations are controlled, robot is moved to target position.
Intelligent writing function is completed by three steering engines, and the first steering engine controls X-axis movement, and the second steering engine controls Y-axis movement, the
Three steering engines control the movement of Z axis, carry out Arithmetic of inverse kinematics processing by the coordinate that writes applied in APP, calculate target position
The angle set is output to the second steering engine, and then controls the movement of Y-axis;The rotation angle of the first steering engine is controlled according to the X value of coordinate
Degree, Z axis mainly handle the company's pen to write and non-company situation, are realized, the path of each stroke is divided into countless by third steering engine
A coordinate carries out analysis and algorithm process to coordinate, it can be deduced that the variation of XYZ axis to form a complete path
Value, so that the font or pattern ideally drawing processing on APP are realized the function intelligently to write by three steering engine rotations of control
Energy.
Preferably, in the step B, if control request is music, robot reads the song in RAM card
And play, it is acted by APP application execution playback action and pause.
RAM card is equipped in robot, RAM card, by playing the song in RAM card, realizes music for storing song
Playing function can complete the operation for playing and suspending by APP application, easy to operate.
Preferably, in the step B, if control request is piano mode, robot reads editing in RAM card
Song, and play according to APP apply inputted note;
It is when control request is piano mode, bluetooth Configuration of baud rate is maximum, switch the fluency of song, can complete
The perfect switching of each note, promotes result of broadcast.
Preferably, 8, in the step B, if control request is graphic programming, phase is inputted according in APP is applied
The graphical programming block answered stores corresponding identifier in each graphical programming block, keeps robot complete by identification marking symbol
At the control of the function of corresponding identifier.
Both of which is arranged in graphic programming function, the first mode is teaching pattern, is drawn according to the prompt of display screen
It leads new hand to learn how to go to program using figure, second of mode is freely to program, and user can pass through according to their own needs
Function block progress sequence arranges and then completes corresponding function, inputs corresponding graphical programming block, each figure according to user
Corresponding identifier is stored in programming block, master controller is transferred to by identification marking symbol, control makes described in robot completion
The control of the function of corresponding identifier.
A kind of learning robot, including a kind of control method of learning robot, which is characterized in that including main control
Track module, graphic programming module and intelligence of device, direction controlling module, music playing module, speech control module, setting-out is write
Word modules, the master controller respectively with the direction controlling module, the music playing module, the speech control module,
Track module, the graphic programming module and the intelligence of the setting-out is write module electrical connection, and the master controller is
STM32 controller;
The direction controlling module for changing robot the direction of motion;
The speech control module uploads to Cloud Server processing for receiving voice messaging, and voice messaging, receives
Cloud Server treated identifier, treated, identifier is sent on master controller;
The setting-out tracks module for receiving the data in APP using the coordinate of upper input, and compares the coordinate of target
Current angular is converted into the actual angle needed, and is sent to master controller by the current state of information and robot, to steering engine
Direction adjustment;
Graphic programming module is used to receive the respective identifier of the tablet pattern programming block in APP application, by identifier
It is sent to master controller, control robot completes the control that the graphical programming block corresponds to the function of robot;
Module of intelligently writing is obtained using the pattern of upper input by coordinate analysis and algorithm process for receiving APP
The changing value of XYZ axis controls three steering engine rotations respectively, robot is made to be moved to target position;
When music playing module is used for music and piano mode, the music in RAM card is read.
Learning robot of the invention passes through master controller to direction control module, music playing module, voice control respectively
Molding block, setting-out track module, graphic programming module and intelligence write module control, it can be achieved that direction controlling, music are broadcast
It puts, piano mode, setting-out tracking, graphic programming, voice control and the function of intelligently writing, multiple functions is integrated in one
It rises, solves the problems, such as that the function of existing learning robot is excessively single.
Preferably, the setting-out module that tracks includes driving chip U21, triode U15 and resistance R19, the driving core
The port SDA and the port SCL of piece U21 is electrically connected with the port PB9 of the master controller and the port PB8 respectively, the triode
The base stage of U15 is electrically connected with the port VCC of the driving chip, emitter and the master controller of the triode U15
The electrical connection of the port PA14, one end of the resistance R19 are electrically connected with the port GND of the driving chip U21, the resistance R19
The other end ground connection, the driving chip U21 be MPU6050 chip.
Driving chip U21 restarting is controlled by triode U15, and the setting-out of initialization in 2 seconds that is delayed tracks module, solution
There is zero degree drift in driving chip, the on-off that control setting-out tracks before setting-out every time eliminates zero degree drift, significantly
Reduce angular error, can accurately realize that setting-out tracks.It is logical to obtain control electric current for the resistance of series connection triode amplification factor
Without amplifying electric current while disconnected.
The invention has the benefit that learning robot of the invention pass through respectively master controller to direction control module,
Track module, graphic programming module and intelligence of music playing module, speech control module, setting-out is write the control of module, can
Realize direction controlling, music, piano mode, setting-out tracking, graphic programming, voice control and the function intelligently to write
Can, multiple functions are integrated, solve the problems, such as that the function of existing learning robot is excessively single.
Detailed description of the invention
The present invention will be further described for attached drawing, but the content in attached drawing does not constitute any limitation of the invention.
Fig. 1 is the structural schematic diagram of the one of embodiment of the present invention;
Fig. 2 is that the setting-out of the one of embodiment of the present invention tracks functional flow diagram;
Fig. 3 is that the setting-out of the one of embodiment of the present invention tracks the structural schematic diagram of module.
Wherein: master controller 1,2 speech control module 3 of direction controlling module, draw lines the module 4, graphic programming mould of tracking
Block 5, music playing module 6, intelligent write module 7, driving chip U21, triode U15, resistance R19.
Specific embodiment
With reference to the accompanying drawing 1~3 and pass through specific embodiment to further illustrate the technical scheme of the present invention.
A kind of control method of the learning robot of the present embodiment, comprising the following steps:
Step A: it when the intelligent terminal and robot for being equipped with APP application interact, is obtained and is used by bluetooth module
It is requested by the control that APP application is sent at family;
Step B: the identification control request, and control the corresponding operating that robot completes the control request;
The control request includes direction controlling, voice control, setting-out tracks, piano mode, graphic programming, music are broadcast
It puts and intelligence is write.
Learning robot of the invention is feature-rich, and the APP application operating on intelligent terminal can be realized to machine in user
The control of device people, it can be achieved that direction controlling, music, piano mode, setting-out tracking, graphic programming, voice control and
The function of intelligently writing, multiple functions are integrated, and the function of solving existing learning robot excessively single is asked
Topic.
In the step B, if control request tracks for setting-out, comprising the following steps:
Step B1: any line footpath is sketched out in the APP application of mobile terminal, APP is applied with the data of limited coordinate
It is sent to robot;
Step B2: the character data of coordinate information is converted into numerical value, and is stored in array;
Step B3: controlling the starting of driving chip U21 by triode U15, and setting delay starts for 2 seconds;
Step B4: judge whether data are empty: if data terminate this operation to be empty, if data are not sky, continue into
Row following steps;
Step B5: then comparing the coordinate information of target and the current state of robot, and current angular is passed through Eulerian angles public affairs
Course angle is carried out equivalent conversion by formula, and parameter that driving chip U21 is fed back is converted into using Euler's angle formula to the reality needed
Angle;
Step B6: controller adjusts the direction of robot according to the position of target by the control to steering engine, and is tied
Beam symbol judgement executes this operation of end, if processing terminate all coordinates, weighs if whole coordinates are disposed
Step B4 is executed again.
If robot is currently in first quartile, target is then turned left in the second quadrant, if target is turned right in other quadrants;
If robot is currently in the second quadrant, target is then turned right in first quartile, if target is turned left in other quadrants;If robot
Currently in third quadrant, target is then turned right in the second quadrant, if target is turned left in other quadrants;If robot is currently
Four-quadrant, target are then turned left in first quartile, if target is turned right in other quadrants.
Driving chip U21 restarting is controlled by triode U15, and is delayed 2 seconds, solving driving chip, there are zero degrees
The problem of drift, controls the on-off of driving chip U21 every time before setting-out, eliminate zero degree drift, greatly reduce angular error,
It can accurately realize that setting-out tracks.
In the step B, if control request is direction controlling, master controller 1 calls direction control function, in conjunction with
Pid algorithm carries out the control in direction according to the corresponding direction in operation APP application.
APP by being mounted on mobile terminal changes direction using upper control robot, can make three in robot
The respective direction that steering engine rotation changes, realizes the direction controlling function of robot.
In the step B, if control request is voice control, the voice messaging inputted in APP is applied is uploaded
To Cloud Server processing, the identifier after conversion is sent to master controller 1, and then controls the robot completion control and asks
It asks.
Cloud Server dissection process can be uploaded to by the voice messaging of the APP of mobile terminal application input, voice messaging,
Voice messaging is converted into identifier, identifier is sent to master controller 1, and then controls the robot completion control and ask
It asks, realizes the voice control function of learning robot, keep the operation of speech robot people more intelligent.
In the step B, if control request is write for intelligence, upper pattern is applied according to APP, to where robot
Coordinate and target position coordinate carry out analysis and algorithm process, it can be deduced that the changing value of XYZ axis, respectively control three
Steering engine rotation, robot are moved to target position.
Intelligent writing function is completed by three steering engines, and the first steering engine controls X-axis movement, and the second steering engine controls Y-axis movement, the
Three steering engines control the movement of Z axis, carry out Arithmetic of inverse kinematics processing by the coordinate that writes applied in APP, calculate target position
The angle set is output to the second steering engine, and then controls the movement of Y-axis;The rotation angle of the first steering engine is controlled according to the X value of coordinate
Degree, Z axis mainly handle the company's pen to write and non-company situation, are realized, the path of each stroke is divided into countless by third steering engine
A coordinate carries out analysis and algorithm process to coordinate, it can be deduced that the variation of XYZ axis to form a complete path
Value, so that the font or pattern ideally drawing processing on APP are realized the function intelligently to write by three steering engine rotations of control
Energy.
In the step B, if control request is music, robot reads the song in RAM card and broadcasting,
It is acted by APP application execution playback action and pause.
RAM card is equipped in robot, RAM card, by playing the song in RAM card, realizes music for storing song
Playing function can complete the operation for playing and suspending by APP application, easy to operate.
In the step B, if control request is piano mode, robot reads the song of editing in RAM card,
And it plays and inputted note is applied according to APP;
It is when control request is piano mode, bluetooth Configuration of baud rate is maximum, switch the fluency of song, can complete
The perfect switching of each note, promotes result of broadcast.
In the step B, if control request is graphic programming, according to inputting corresponding figure in APP is applied
Block is programmed, stores corresponding identifier in each graphical programming block, so that robot is completed the phase by identification marking symbol
The control of the function for the identifier answered.
Both of which is arranged in graphic programming function, the first mode is teaching pattern, is drawn according to the prompt of display screen
It leads new hand to learn how to go to program using figure, second of mode is freely to program, and user can pass through according to their own needs
Function block progress sequence arranges and then completes corresponding function, inputs corresponding graphical programming block, each figure according to user
Corresponding identifier is stored in programming block, master controller is transferred to by identification marking symbol, control makes described in robot completion
The control of the function of corresponding identifier.
A kind of learning robot, including master controller 1, direction controlling module 2, music playing module 6, speech control module
3, track module 4, graphic programming module 5 and intelligence of setting-out is write module 7, and the master controller 1 is controlled with the direction respectively
Molding block 2, the music playing module 6, the speech control module 3, the module 4, the graphic programming of tracking that draw lines
Module 5 and the intelligence write module 7 electrical connection, the master controller 1 be STM32 controller;
The direction controlling module 2 for changing robot the direction of motion;
The speech control module 3 uploads to Cloud Server processing for receiving voice messaging, and voice messaging, receives
Cloud Server treated identifier, treated, identifier is sent on master controller;
The setting-out tracks module 4 for receiving the data in APP using the coordinate of upper input, and compares the coordinate of target
Current angular is converted into the actual angle needed, and is sent to master controller by the current state of information and robot, to steering engine
Direction adjustment;
5 pieces of graphic programming mould are used to receive the respective identifier that the tablet pattern in APP application programs block, by identifier
It is sent to master controller 1, control robot completes the control that the graphical programming block corresponds to the function of robot;
Module 7 of intelligently writing is obtained using the pattern of upper input by coordinate analysis and algorithm process for receiving APP
The changing value of XYZ axis out controls three steering engine rotations respectively, robot is made to be moved to target position;
When music playing module 6 is used for music and piano mode, the music in RAM card is read.
Learning robot of the invention passes through master controller 1 to direction control module 2, music playing module 6, voice respectively
Control module 3, setting-out track module 4, graphic programming module 5 and intelligence write module 7 control, it can be achieved that direction controlling,
Music, piano mode, setting-out tracking, graphic programming, voice control and the function of intelligently writing, by multiple functions collection
It is excessively single at the function of, solving the problems, such as existing learning robot together.
The setting-out module that tracks includes driving chip U21, triode U15 and resistance R19, the driving chip U21's
The port SDA and the port SCL are electrically connected with the port PB9 of the master controller 1 and the port PB8 respectively, the base of the triode U15
Pole is electrically connected with the port VCC of the driving chip, the end PA14 of the emitter of the triode U15 and the master controller 1
Mouth electrical connection, one end of the resistance R19 are electrically connected with the port GND of the driving chip U21, and the resistance R19's is another
End ground connection, the driving chip U21 are MPU6050 chip.
Driving chip U21 restarting is controlled by triode U15, and the setting-out of initialization in 2 seconds that is delayed tracks module, solution
There is zero degree drift in driving chip, the on-off that control setting-out tracks before setting-out every time eliminates zero degree drift, significantly
Reduce angular error, can accurately realize that setting-out tracks.It is logical to obtain control electric current for the resistance of series connection triode amplification factor
Without amplifying electric current while disconnected.
The technical principle of the invention is described above in combination with a specific embodiment.These descriptions are intended merely to explain of the invention
Principle, and shall not be construed in any way as a limitation of the scope of protection of the invention.Based on the explanation herein, the technology of this field
Personnel can associate with other specific embodiments of the invention without creative labor, these modes are fallen within
Within protection scope of the present invention.