Disclosure of Invention
In order to solve the above problems, an object of the present invention is to provide an intelligent vehicle control method for moving an intelligent vehicle according to a real-time drawn track on a touch display screen, which facilitates changing a motion track of the intelligent vehicle and facilitating practical use of the intelligent vehicle.
The technical scheme adopted by the invention for solving the problems is as follows: the intelligent trolley control method comprises a control terminal with a touch display screen and the intelligent trolley, wherein the touch display screen has a function of drawing a graph line, the control terminal and the intelligent trolley perform information transmission in a wireless transmission mode, and the intelligent trolley moves according to a track drawn in real time on the touch display screen.
Further, when the real-time track is formed, the control terminal samples a point which is being formed in the real-time track at intervals of the same time as an identification point, each identification point has a coordinate corresponding to the identification point, the control terminal sends the coordinate of the identification point to the intelligent trolley, and the intelligent trolley adjusts the speed direction and the speed value according to the coordinate of the identification point.
Further, the control terminal sorts the identification points according to the sampling sequence of the identification points, the identification point sampled first is arranged in front of the identification point sampled later, according to the sequence, every two adjacent identification points are in a group, the first identification point and the second identification point are in a first group, the second identification point and the third identification point are in a second group, the third identification point and the fourth identification point are in a third group, the rest are analogized in turn, the slope of each group is calculated, the direction of the speed of the intelligent trolley is adjusted according to the slope change between the adjacent groups, if the angle corresponding to the second group of slopes is one degree more than the angle corresponding to the first group of slopes, the direction of the speed of the intelligent trolley rotates one degree anticlockwise, the angle corresponding to the second group of slopes is one degree less than the angle corresponding to the first group of slopes, the direction of the speed of the intelligent trolley rotates one degree clockwise, and the rest of the conditions are analogized in turn.
Furthermore, the control terminal sorts the identification points according to the sampling sequence of the identification points, the identification point sampled first is arranged in front of the identification point sampled later, the numerical value of the speed of the intelligent trolley moving from the first identification point to the second identification point is determined by the distance between the first identification point and the second identification point, the numerical value of the speed of the intelligent trolley between the two identification points is equal to the distance between the two identification points multiplied by a proportionality coefficient, the proportionality coefficient is adjusted according to practical application, and the distance between the identification points refers to the linear distance calculated according to the coordinates of the identification points.
Furthermore, the control terminal only sends one identification point coordinate at a time, the intelligent trolley moves according to the identification point coordinate sent by the control terminal, the intelligent trolley sends feedback information to the control terminal after the moving target is completed at each time, and the control terminal sends the coordinate of the next identification point to the intelligent trolley after receiving the feedback information. The intelligent trolley avoids the trouble of recognizing the sequence of the coordinates, and can effectively improve the reaction speed of the intelligent trolley.
And furthermore, the intelligent trolley comprises three working modes, namely a line drawing tracking mode, a common control mode and a ground tracking mode, and when the line drawing tracking mode is started, the intelligent trolley moves according to a track drawn in real time on the touch display screen.
Furthermore, the line drawing tracking mode has two working modes, the first working mode is that the real-time track on the touch display screen is drawn, and the intelligent trolley moves according to the real-time track on the touch display screen; and in the second working mode, after the real-time track on the touch display screen is drawn, the intelligent trolley moves according to the real-time track on the touch display screen.
Further, when the common control mode is started, the control terminal transmits a control instruction to the intelligent trolley, the intelligent trolley moves according to the control instruction, and the control instruction comprises an upward instruction, a downward instruction, a leftward instruction, a rightward instruction, a stop instruction and a start instruction.
Further, when the ground tracking mode is started, the touch display screen enters a tracking mode page, and a tracking mode switch is arranged on the tracking mode page, so that the trolley starts tracking or finishes tracking.
Further, the intelligent trolley is provided with an LM339 infrared drive to provide infrared obstacle avoidance for the trolley and an infrared tracking function.
The invention has the beneficial effects that: the intelligent trolley moves according to the track drawn in real time on the touch display screen, so that the movement track of the intelligent trolley is changed conveniently, and the intelligent trolley is used practically conveniently.
Detailed Description
Fig. 1 is a block diagram of a hardware structure of the present invention, fig. 2 is a flowchart of a procedure of the present invention, fig. 3 is a schematic diagram of mode page selection of the present invention, as shown in fig. 1 to fig. 3, the present invention is an intelligent vehicle control method, which includes a control terminal 3 having a touch display screen and an intelligent vehicle, the touch display screen has a function of drawing a graph, information transmission is performed between the control terminal 3 and the intelligent vehicle in a wireless transmission manner, and the intelligent vehicle moves according to a track drawn in real time on the touch display screen. When the real-time track is formed, the control terminal 3 samples a point which is being formed in the real-time track at intervals of the same time as an identification point, each identification point has a coordinate corresponding to the identification point, the control terminal 3 sends the coordinate of the identification point to the intelligent trolley, and the intelligent trolley adjusts the speed direction and the speed value according to the coordinate of the identification point. The control terminal 3 sorts the identification points according to the sampling sequence of the identification points, the identification point sampled first is arranged in front of the identification point sampled later, according to the sequence, every two adjacent identification points are in a group, the first identification point and the second identification point are in a first group, the second identification point and the third identification point are in a second group, the third identification point and the fourth identification point are in a third group, the rest are analogized in turn, the slope of each group is calculated, the direction of the speed of the intelligent trolley is adjusted according to the slope change between the adjacent groups, if the angle corresponding to the second group of slopes is one degree more than the angle corresponding to the first group of slopes, the direction of the speed of the intelligent trolley rotates one degree anticlockwise, the angle corresponding to the second group of slopes is one degree less than the angle corresponding to the first group of slopes, the direction of the speed of the intelligent trolley rotates one degree clockwise, and the rest of the conditions are analogized in turn.
Specifically, the control terminal 3 sequences the identification points according to the sampling sequence of the identification points, the identification point sampled first is arranged in front of the identification point sampled later, the speed value of the intelligent trolley moving from the first identification point to the second identification point is determined by the distance between the first identification point and the second identification point, the speed value of the intelligent trolley between the two identification points is equal to the distance between the two identification points multiplied by a proportionality coefficient, the proportionality coefficient is adjusted according to actual application, and the distance between the identification points refers to a straight-line distance calculated according to the coordinates of the identification points. The control terminal 3 only sends one identification point coordinate at a time, the intelligent trolley moves according to the identification point coordinate sent by the control terminal 3, the intelligent trolley sends feedback information to the control terminal 3 after the moving target of the intelligent trolley is completed each time, and the control terminal 3 sends the coordinate of the next identification point to the intelligent trolley after receiving the feedback information. The intelligent trolley avoids the trouble of recognizing the sequence of the coordinates, and can effectively improve the reaction speed of the intelligent trolley. The intelligent trolley comprises three working modes, namely a line drawing tracking mode, a common control mode and a ground tracking mode, and when the line drawing tracking mode is started, the intelligent trolley moves according to a track drawn in real time on the touch display screen. The line drawing tracking mode has two working modes, the first working mode is that the real-time track on the touch display screen is drawn, and the intelligent trolley moves according to the real-time track on the touch display screen; and in the second working mode, after the real-time track on the touch display screen is drawn, the intelligent trolley moves according to the real-time track on the touch display screen. When the common control mode is started, the control terminal 3 transmits a control instruction to the intelligent trolley, the intelligent trolley moves according to the control instruction, and the control instruction comprises an upward instruction, a downward instruction, a leftward instruction, a rightward instruction, a stop instruction and a start instruction. When the ground tracking mode is started, the touch display screen enters a tracking mode page, and a tracking mode switch 2 is arranged on the tracking mode page, so that the trolley starts tracking or finishes tracking. The intelligent trolley is provided with an LM339 infrared drive to provide infrared obstacle avoidance for the trolley and an infrared tracking function.
Preferably, the intelligent vehicle comprises a power supply 1, a switch 2, a Bluetooth module 4, a single chip microcomputer 5, a motor 8 driving module 6, an infrared obstacle avoidance module 7 and a motor 8. The intelligent trolley of the invention uses the singlechip 5 as the MCU to control the trolley to walk, and a common trolley model with universal wheels and two motors 8 is selected as the model of the intelligent trolley in order to facilitate the trolley to enter the door. L298N double-path H-bridge motor drive control motor 8, LM339 infrared drive provides infrared obstacle avoidance for the trolley, and infrared tracking function. HC05 Bluetooth module 4 is the Bluetooth module 4 of dolly communication, and the walking of the bluetooth control dolly of cell-phone still has the marking off and seeks the mark function with the ground simultaneously. Firstly, initializing the IO ports of each part of sensors and the singlechip 5, specifically initializing a signal interface of the Bluetooth module 4, initializing a signal interface of the driving module 6 of the motor 8, and initializing an infrared tracking signal interface. After initialization is completed, the app selects a trolley running mode, and the mode is run after the mode is selected. In addition, an obstacle avoidance function is added in an app line drawing tracking mode, and the trolley stops if an obstacle is met. The model of singlechip 5 is STC89C52, and power 1 is connected with singlechip 5 through switch 2. The control terminal 3 is connected with the singlechip 5 through a Bluetooth signal.
Preferably, the app information is waited for first, and the mode selection information sent from the app is received by using the serial port to connect with the bluetooth. And enters the corresponding mode code.
app line drawing tracking mode: after the information of starting to walk is received, two groups of coordinates (one group of two coordinates) are taken as a unit, the slopes of the two groups of coordinates are compared, the speed is selected according to the length of the previous coordinate, the driving of the trolley is controlled, the motor 8 is controlled to form different speeds, meanwhile, the phenomenon of skewing of the trolley in the walking process is controlled according to the feedback of the two velometers, and the error of the trolley in the walking process is reduced. After walking of one unit is finished, the coordinate of the next unit is sent to the app, the walking of the whole graph is finished, the finishing information sent by the app is received, and then the walking of the trolley is stopped. When the trolley encounters an obstacle in the walking process, the trolley stops running continuously, and the trolley is prevented from colliding with the obstacle.
The common control mode is as follows: and after receiving the information of up, down, left, right, speed regulation or stop sent from the app, making corresponding action and running along with obstacle avoidance. The method has the advantages that the defects that the error of the line drawing tracking mode is large and the speed is difficult to control are overcome by achieving simple and fine control.
Ground tracking mode: and after the information sent by the app that the tracking mode key is opened is received, the trolley tracks on the tracking track.
The app has 4 pages, which are a mode selection page, an app line-drawing tracking mode page, a general control mode page, and a ground tracking mode page, respectively. The mode selection page provides buttons for three jump pages. And detects bluetooth to perform bluetooth data connection. The three control mode pages are respectively:
app draws a line tracking mode page: the multifunctional drawing board comprises a core drawing board, and has the functions of acquiring coordinates of a touch screen, drawing a drawing line, acquiring the coordinates, and simultaneously having a plurality of buttons as controls, wherein the control comprises screen clearing, trolley operation mode selection and the like. In the line drawing walking function, there are two modes, one mode is to draw and walk, and the other mode is to start walking only by button confirmation. Since the coordinates obtained by the app can obtain coordinates with different numbers and distances according to the sliding speed of the fingers, the sliding speed of the trolley is related to the sliding speed of the fingers, and the faster the sliding speed is, the faster the trolley speed is.
Normal control mode page: the trolley is subjected to common operation and comprises simple operation buttons such as up, down, left and right, and the like, and the trolley is subjected to simple remote control.
Ground tracking mode page: entering the page will have a start button and a stop button for the tracking mode to start or end tracking of the cart.
The specific control flow of the invention comprises the following steps:
s1, start;
s2, initializing the system;
s3, judging which mode to enter;
s4, controlling the intelligent trolley according to the corresponding mode;
s5, moving the trolley according to the control instruction;
s6, judging whether meeting the obstacle, if yes, turning to the step S7, otherwise, turning to the step S5;
and S7, stopping the trolley.
Compared with the prior art, the method takes the hand-drawn route in the app as the walking route, and sends the hand-drawn route to the MCU on the trolley through the algorithm, so that the trolley can accurately walk according to the drawn route. As the route drawn by a user has obstacles in the process in the actual situation, the obstacle avoidance function is added, and the trolley stops immediately when encountering the obstacles during walking so as to avoid the collision of the trolley. According to the traditional track-seeking trolley, the track is moved to a mobile phone, the track can be designed by the user, the obstacle avoidance function is provided, the track for seeking tracks is not needed to be paved on the ground, and the track can be designed at will. The app can acquire different numbers of coordinates through the speed of finger sliding, and the faster the sliding is, the fewer the coordinates are, so that the speed of the trolley can be controlled through the distance of the coordinates. Therefore, the walking speed of the trolley can be controlled according to the sliding speed of the fingers. And the existing Bluetooth control and ground tracing technology is added, and the intelligent app trolley integrating drawing lines, controlling and tracing is manufactured.
The above description is only a preferred embodiment of the present invention, and the present invention is not limited to the above embodiment, and the present invention shall fall within the protection scope of the present invention as long as the technical effects of the present invention are achieved by the same means.