Disclosure of Invention
The technical problem to be solved by the embodiment of the invention is to provide a wireless remote control intelligent vehicle, which can solve the problems that the existing wireless remote control intelligent vehicle cannot be controlled by a mobile phone rocker anytime and anywhere and the actual running speed and direction show deviation, and further improve the intelligence.
In order to solve the technical problem, the embodiment of the invention provides a wireless remote control intelligent vehicle which is matched with a mobile phone for use and comprises a trolley provided with four Mecanum wheels, a main controller, a motor driving module, four motors, a Bluetooth communication module and a gyroscope, wherein the main controller, the motor driving module, the four motors, the Bluetooth communication module and the gyroscope are all arranged on the trolley; wherein the content of the first and second substances,
the input end of the Bluetooth communication module is connected with the mobile phone in a Bluetooth communication mode, and the output end of the Bluetooth communication module is connected with the first end of the main controller and used for forwarding a current trolley control instruction formed by a user through a built-in simulation rocker of the mobile phone to the main controller after Bluetooth communication connection with the mobile phone is established;
The gyroscope is connected with the second end of the main controller and used for monitoring the running direction of the trolley in real time by acquiring relevant running data of the trolley in real time when the trolley runs and forwarding the real-time acquired relevant running data of the trolley to the main controller;
the third end of the main controller is connected with the input end of the motor driving module, and is used for distinguishing the motion state of the trolley to be realized by the current trolley control command after receiving the current trolley control command output by the mobile phone, and combining a preset motion state and speed mapping table to obtain the speeds required by the four Macnahme wheels and further generate corresponding four speed control signals to be sent to the motor driving module; after the relevant operation data of the trolley, which is acquired by the gyroscope in real time when the trolley runs, is received, correcting the speeds required by the four obtained Macnahme wheels according to the received relevant operation data of the trolley in real time, regenerating corresponding four speed control signals, and sending the four speed control signals to the motor driving module;
the output end of the motor driving module is connected with four motors connected with the four Mecanum wheels, and the motor driving module is used for correspondingly driving the rotating speeds of the four motors according to four speed control signals issued by the main controller every time, so that the four Mecanum wheels obtain respective corresponding speeds, and the adjustment of speed deviation and direction deviation in the running process of the trolley is realized.
The motion state of the trolley comprises a motion state that the trolley body moves along the left-right direction, a motion state that the trolley body moves along the front-back direction and a motion state that the trolley body rotates.
When the motion state of the trolley is the motion state of the trolley body moving along the left-right direction, the preset motion state and speed mapping table passes through a formula vω1=-vtx、vω2=+vtx、vω3=-vtxAnd vω4=+vtxTo realize the operation; wherein, VtxIndicating the velocity, V, of the vehicle moving to the rightω1~Vω4Representing the speed of four mcnam wheels;
when the motion state of the trolley is the motion state of the trolley body moving along the front-back direction, the preset motion state and speed mapping table is represented by a formula vω1=vty、vω2=vty、vω3=vtyAnd vω4=vtyTo realize the operation; wherein, VtyRepresenting the speed of the trolley when moving forward;
when the motion state of the trolley is the autorotation motion state of the trolley body, the preset motion state and speed mapping table is expressed by a formula vω1=+ω(a+b)、vω2=-ω(a+b)、vω3- ω (a + b) and vω4+ ω (a + b); wherein a represents the length of the trolley body, b represents the width of the trolley body, and omega represents the angular velocity of the trolley during rotation.
The main controller adopts an ATmega328 chip, Arduino system software is burned on the ATmega328 chip, 4GB RAM is supported, a dual-frequency 2.4/5.0GHz wireless local area network interface, a Bluetooth 5.0 interface, an Ethernet interface, a USB 3.0 interface and a PoE interface are supported.
The motor driving module adopts a TB6612 chip, is connected with the main controller through a serial port, is correspondingly connected with the four motors through four encoders respectively, and outputs PWM waves to change duty ratios so as to control the rotating speeds of the four motors.
The model adopted by the Bluetooth communication module is WH-BLE 103.
The type of the gyroscope is Mpu605 u.
The system also comprises an RGB colored lamp module connected with the fourth end of the main controller; the RGB colored lamp module integrates luminous LED lamps and a control circuit, wherein each LED lamp is a pixel point and consists of RGB three primary colors, and each color has eight bits.
The DC-DC conversion module is connected with the fifth end of the main controller; the DC-DC conversion module adopts a TP3605 chip to realize the voltage conversion function.
The embodiment of the invention has the following beneficial effects:
the invention is based on a Bluetooth communication mode, a main controller not only receives a current trolley control command formed by a user through a built-in analog rocker of a mobile phone to distinguish the motion state of the trolley, but also obtains four speed control signals corresponding to the speeds required by four Mecanum wheels by combining a preset motion state and speed mapping table, and enables a motor driving module to drive the four motors to rotate so as to drive the trolley, and also can correct the speeds required by the four Mecanum wheels and regenerate the corresponding four speed control signals according to the relevant running data of the trolley acquired by a gyroscope in real time in the running process, and enables the motor driving module to adjust the rotating speeds of the four motors so as to realize the adjustment of the speed deviation and the direction deviation in the running process of the trolley, thereby solving the problems that the existing wireless remote control intelligent trolley can not control the real-time and anywhere through the rocker of the mobile phone and the actual running speed and direction show deviation, and the intelligence is further improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, in an embodiment of the present invention, a wireless remote control intelligent vehicle is provided, which includes a trolley 1 equipped with four mecanum wheels, a main controller 2, a motor driving module 3, four motors 4, a bluetooth communication module 5, and a gyroscope 6, all of which are mounted on the trolley 1, and is used in cooperation with a mobile phone (not shown); wherein the content of the first and second substances,
the input end of the Bluetooth communication module 5 is connected with the mobile phone in a Bluetooth communication mode, and the output end of the Bluetooth communication module is connected with the first end of the main controller 2, so that after Bluetooth communication connection with the mobile phone is established, a current trolley control instruction formed by a built-in simulation rocker (not shown) of the mobile phone by a user is forwarded to the main controller 2; it should be noted that the trolley control command includes a movement direction command such as forward, backward, left turn, right turn, and the like, and certainly includes other commands such as a light command, a voice command, and the like; in one example, the bluetooth communication module 5 is of the model WH-BLE 103;
the gyroscope 6 is connected with the second end of the main controller 2 and is used for monitoring the running direction of the trolley in real time by acquiring relevant running data of the trolley in real time when the trolley runs and forwarding the relevant running data of the trolley acquired in real time to the main controller 2; it should be noted that the relevant operation data of the trolley includes, but is not limited to, the coordinate position, the moving direction, the moving speed, the coordinate position of the obstacle, etc. of the trolley; in one example, gyroscope 6 is of the type Mpu605 u;
The third end of the main controller 2 is connected with the input end of the motor driving module 3, and is used for distinguishing the motion state of the trolley to be realized by the current trolley control command after receiving the current trolley control command output by the mobile phone, and combining the preset motion state and the speed mapping table to obtain the speeds required by the corresponding four mecanum wheels, further generating corresponding four speed control signals, and sending the corresponding four speed control signals to the motor driving module 3; after receiving the relevant operation data of the trolley acquired by the gyroscope 6 in real time when the trolley runs, correcting the speeds required by the four obtained Mecanum wheels according to the received real-time relevant operation data of the trolley, regenerating corresponding four speed control signals, and sending the four speed control signals to the motor driving module 2; it should be noted that the correction of the speeds required by the four mecanum wheels may be performed by setting coefficients or constants for a preset motion state and speed mapping table to correct the mapped speeds, or directly correcting the current speeds of the four mecanum wheels; in one example, the main controller 2 adopts an ATmega328 chip, on which Arduino system software is burned, and supports 4GB RAM, a dual-frequency 2.4/5.0GHz wireless local area network interface, a Bluetooth 5.0 interface, a gigabit Ethernet interface, a USB 3.0 interface and a PoE interface;
The output end of the motor driving module 3 is connected with four motors 4 connected with the four Mecanum wheels, and is used for correspondingly driving the rotating speeds of the four motors 4 according to four speed control signals issued by the main controller 2 every time, so that the four Mecanum wheels obtain the corresponding speeds respectively, and the adjustment of speed deviation and direction deviation in the running process of the trolley is realized. In one example, the motor driving module 3 uses a TB6612 chip, which is connected to the main controller 2 via a serial port, is correspondingly connected to the four motors 4 via four encoders, and outputs PWM waves to change duty ratios to control the rotation speeds of the four motors 4.
It can be understood that the running direction of the trolley is monitored in real time through the gyroscope 6, then the main controller 2 processes relevant running data of the trolley obtained from the gyroscope 6, and corrects the rotating speeds and directions of the four motors 4 to form a negative feedback adjusting system for the state of the intelligent vehicle, so that the intelligent vehicle runs more straightly; meanwhile, the speed of each Mecanum wheel is obtained by a kinematic formula, and the speed can be modified in the kinematic formula, for example, a constant is added to the speed formula of a certain Mecanum wheel, or a coefficient is modified.
In the embodiment of the invention, for the Mecanum wheels, a certain relation exists between the motion state of the vehicle body and the motion speed of the four wheels. Since the mecanum wheels belong to a pure linear system, the motion state of the vehicle body in actual motion is synthesized from three motion states of front and back directions, left and right directions and rotation along the central axis. Therefore, the motion of the chassis is firstly decomposed into three variables, namely X-axis translation, Y-axis translation and geometric center autorotation. The rotational speed required for each wheel in the actual movement of the vehicle body can be obtained by knowing the forward and backward direction, the leftward and rightward direction, and the rotational speed of the four wheels.
Firstly, defining the motion state of the trolley, including the motion state of the trolley body moving along the left-right direction, the motion state of the trolley body moving along the front-back direction and the motion state of the trolley body rotating; second, it is used forDefinition of VtxIndicating the velocity, V, of the vehicle moving to the righttyIndicating the speed, V, of the vehicle as it moves forwardω1~Vω4Representing the velocity of the four mecanum wheels and omega the angular velocity of the cart as it spins.
Then, when the motion state of the trolley is the motion state of the trolley body moving along the left-right direction, the preset motion state and speed mapping table is represented by a formula v ω1=-vtx、vω2=+vtx、vω3=-vtxAnd vω4=+vtxTo realize the operation;
when the motion state of the trolley is the motion state of the trolley body moving along the front-back direction, the preset motion state and speed mapping table is represented by a formula vω1=vty、vω2=vty、vω3=vtyAnd vω4=vtyTo realize the operation;
when the motion state of the trolley is the autorotation motion state of the trolley body, the preset motion state and speed mapping table passes through a formula vω1=+ω(a+b)、vω2=-ω(a+b)、vω3- ω (a + b) and vω4Implemented as + ω (a + b); wherein a represents the length of the trolley body and b represents the width of the trolley body.
Therefore, the mapping table of the motion state and the speed is shown in table 1 below, and when the intelligent vehicle is required to travel at a certain speed in a certain direction, the speed required by each wheel can be calculated, and then the motor speed is controlled by outputting a proper signal control command, so that the desired control is realized:
TABLE 1
In the embodiment of the invention, the device further comprises an RGB colored lamp module 7 connected with the fourth end of the main controller 2; this RGB color lamp module 7 has integrateed luminous LED lamp and control circuit, and wherein, every LED lamp is a pixel and comprises RGB three primary colors, and every colour has eight bits.
In the embodiment of the present invention, the controller further includes a DC-DC conversion module 8 connected to the fifth terminal of the main controller 2; the DC-DC conversion module 8 adopts TP3605 chip to realize voltage conversion function
As shown in fig. 2 to fig. 2, application scenarios of the wireless remote control intelligent vehicle provided by the embodiment of the present invention are further described:
fig. 2 is a schematic structural diagram of a main controller of the wireless remote control intelligent vehicle. The main controller selects an ATmega328 chip which is also adopted by the Arduino Uno development board. Only need produce a minimum system board according to the schematic diagram, burn into the back with Arduino firmware, just can use Arduino's development tool Arduino IDE. The Arduino IDE is used because it is easy for beginners to master, programming instructions are simple and easy to read, and the requirement for proficiency in mastering C language is not high. It also does not require the user to know the internal hardware structure and register settings, only the port role. As the software and hardware of the Arduino are open sources, a plurality of common basic function modules have written library files and can be directly called. And related resources on various forum websites are very much, and the data can be conveniently searched after problems are met. Therefore, the ATmega328 chip can greatly accelerate the development speed and bring great convenience
Fig. 3 is a schematic structural diagram of a motor driving module of the wireless remote control intelligent vehicle. The motor driving module adopts a direct current motor driving chip of TB6612 model. The continuous driving current of 1.2A can be output in each channel, and the starting peak current reaches 2A. The motor can be used for realizing four motor modes of forward transmission, reverse rotation, braking, stopping and the like, and a pin for receiving the PWM wave to control the rotating speed can support the PWM wave with the frequency of 100 KHz. The TB6612 chip is selected instead of the L298N chip because its peripheral circuit is simpler and only needs to be connected with some filter capacitors. Meanwhile, no additional radiating fins are needed, and the size is smaller.
In fig. 3, AIN1 and AIN2 as input pins control the output of the AO1 and AO2 pins, and BIN1 and BIN2 control the output of the BO1 and BO2 pins. The output duty ratios of the PWMA pin and the PWMB pin are different, the rotating speed of the motor is correspondingly changed, and the STBY pin is directly connected with 5V.
The capacitance at pin VM2 is connected for filtering, with a large capacitance for filtering out high frequency interference and a small capacitance for filtering out low frequency interference. The C1 capacitance on the VCC pin is also used to filter out noise and ac components of the power supply.
The right half can see that the signal DIR2_ D4+, DIR1_ D7+, DIR1_ D8+, DIR1_ D11+ passes through a triode circuit before entering pin TB 6612. When the input signal is at high level, the triode is conducted, the output signal is at low level state, when the input signal is at low level, the triode is not conducted, and the output signal is at high level state due to the existence of the pull-up resistor. For example, the input signal DIR2_ D4+ is connected to the AN1 pin, and the output signal DIR2_ D4-is connected to the AN2 pin, so that the input signals of AN1 and AN2 of TB6612 are always kept in opposite states, and the vehicle is always in a forward state and AN inverse state according to a truth table. If the trolley is controlled to stop, the PWM signal is not generated on the PWM pin any more.
In general, signals output by four pins DIR2_ D4+, DIR1_ D7+, DIR1_ D8+ and DIR1_ D11+ led out from the main control chip ATMega328 are processed by a TB6612 chip to control the rotating directions of four driving motors. And the four pins of PWM1_ D6, PWM2_ D5, PWM2_ D10 and PWM2_ D9 output PWM waves to control the rotation speed of the motor by changing the duty ratio.
Fig. 4 is a schematic structural diagram of a bluetooth communication module of the wireless remote control intelligent vehicle. The bluetooth communication module supports modules of the bluetooth 4.0 protocol or higher. The most significant advantage is that power consumption is very low, but the disadvantage is that both the speed of transmission and the amount of data are small. The BLE Bluetooth can use a TTL serial port to carry out bidirectional transparent transmission during data transmission, has the characteristic of master-slave integration, and can be used as a master machine and a slave machine.
BLE bluetooth is transmitted using a parameter, called a characteristic, which is read, written, notified, etc. by a client. The service is to classify a plurality of characteristics, and one classified class is a service. One service contains multiple features. Each property, in turn, contains a number of attributes such as value, length, authority, description, and the like. In a bluetooth protocol, a number of services and feature values are included, so that each service and feature is numbered with a UUID.
The WH-BLE103 module is used in the Bluetooth module, and the Bluetooth module is. The blue LED is a pairing state indicator lamp, is in a flashing state when no other Bluetooth is connected with the blue LED, and becomes a normally-on state after the blue LED is successfully connected with the blue LED.
The development is carried out by adopting the APP inventor, so that the method is simple. Firstly, the BLE Bluetooth module on the trolley only plays a role of receiving data from the Bluetooth of the mobile phone, and the address of the Bluetooth is required to be known for pairing with other Bluetooth. A BLE Bluetooth debugging assistant is downloaded on the mobile phone, when the BLE Bluetooth debugging assistant is turned on, nearby BLE Bluetooth can be seen, the name of each Bluetooth can be displayed, and the address of each Bluetooth can be displayed below the BLE Bluetooth debugging assistant.
Fig. 5 is a schematic structural diagram of an RGB color lamp module of the wireless remote control intelligent vehicle. The model number adopted by the RGB colored lamp module is WS2812, and the RGB colored lamp module integrates luminous LED lamps and a control circuit, wherein each LED lamp is a pixel point and consists of RGB three primary colors, each color has eight bits, so that the RGB colored lamp module can display 256 brightness in total of 28, and one LED colored lamp can display 256 color in total of 256 color in 16777216 color. The WS2812 module requires only one line to receive data. And as long as the transmission speed of the signals meets the requirements, the number of the connected LED lamps is not influenced by signal transmission.
Fig. 6 is a schematic structural diagram of a DC-DC conversion module of the wireless remote control intelligent vehicle. The DC-DC conversion module uses a TP3605 chip to implement this function. TP3605 is a DC-DC converter, belonging to PWM boost type, with natural frequency of 1MHz and constant current mode. One lithium battery can output load current with voltage of 5V and current of 1A, and the highest output voltage can reach 12V. The integration level is also very high, and only a rectifier diode and an inductor need to be added externally when the high-power-density LED is used. The efficiency is good and can reach more than 94%. In terms of security, the TP3605 provides a series of protection mechanisms, such as turn-off protection, under-voltage protection, over-current protection, and the like, so that the chip can be sufficiently protected. And the power consumption of TP3605 is also very little, and is very power-conserving, and when being in the off mode, operating current only needs 1 uA.
The embodiment of the invention has the following beneficial effects:
the invention is based on a Bluetooth communication mode, a main controller not only receives a current trolley control command formed by a user through a built-in analog rocker of a mobile phone to distinguish the motion state of the trolley, but also obtains four speed control signals corresponding to the speeds required by four Mecanum wheels by combining a preset motion state and speed mapping table, and enables a motor driving module to drive the four motors to rotate so as to drive the trolley, and also can correct the speeds required by the four Mecanum wheels and regenerate the corresponding four speed control signals according to the relevant running data of the trolley acquired by a gyroscope in real time in the running process, and enables the motor driving module to adjust the rotating speeds of the four motors so as to realize the adjustment of the speed deviation and the direction deviation in the running process of the trolley, thereby solving the problems that the existing wireless remote control intelligent trolley can not control the real-time and anywhere through the rocker of the mobile phone and the actual running speed and direction show deviation, and the intelligence is further improved.
While the invention has been described in connection with what is presently considered to be the most practical and preferred embodiment, it is to be understood that the invention is not to be limited to the disclosed embodiment, but on the contrary, is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.