CN107015561A - A kind of electric two-wheel balance car system and electric two-wheel balance car control method - Google Patents

A kind of electric two-wheel balance car system and electric two-wheel balance car control method Download PDF

Info

Publication number
CN107015561A
CN107015561A CN201710130706.3A CN201710130706A CN107015561A CN 107015561 A CN107015561 A CN 107015561A CN 201710130706 A CN201710130706 A CN 201710130706A CN 107015561 A CN107015561 A CN 107015561A
Authority
CN
China
Prior art keywords
speed
slave
electric
balance car
wheel balance
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710130706.3A
Other languages
Chinese (zh)
Inventor
詹文广
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Gobao Electronic Technology Co Ltd
Shenzhen Gobao Electronic Technology Co Ltd
Original Assignee
Guangdong Gobao Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Gobao Electronic Technology Co Ltd filed Critical Guangdong Gobao Electronic Technology Co Ltd
Priority to CN201710130706.3A priority Critical patent/CN107015561A/en
Publication of CN107015561A publication Critical patent/CN107015561A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/02Control of position or course in two dimensions
    • G05D1/021Control of position or course in two dimensions specially adapted to land vehicles
    • G05D1/0212Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory
    • G05D1/0214Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory in accordance with safety or protection criteria, e.g. avoiding hazardous areas
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/02Control of position or course in two dimensions
    • G05D1/021Control of position or course in two dimensions specially adapted to land vehicles
    • G05D1/0276Control of position or course in two dimensions specially adapted to land vehicles using signals provided by a source external to the vehicle

Landscapes

  • Engineering & Computer Science (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Electric Propulsion And Braking For Vehicles (AREA)
  • Control Of Multiple Motors (AREA)

Abstract

The present invention is applied to electric two-wheel balance car field, there is provided a kind of electric two-wheel balance car system and electric two-wheel balance car control method, system includes controller, the single-chip microcomputer positioned at electric two-wheel balance car both sides, single-chip microcomputer, after energization, detect whether that power switch key is pressed, if power switch key is pressed, then the controller of minute book side is main frame, choose and perform the function required for main frame, automatic shield slave function, and send host signal and have been switched on signal to the controller of opposite side;The controller Receiving Host signal of opposite side and have been switched on after signal, mark is chosen from as slave and performs the function required for slave, automatic shield host function, send slave signal and have been switched on signal to main frame;Main frame and slave transmit mutually the exercise data of this side when electric two-wheel balance car is moved, to realize mutually coordinated control of the slave under motion state.The present invention improves the stability of electric two-wheel balance car.

Description

A kind of electric two-wheel balance car system and electric two-wheel balance car control method
Technical field
The invention belongs to electric two-wheel balance car field, more particularly to a kind of electric two-wheel balance car system and electric two-wheel Balance car control method.
Background technology
Electric two-wheel balance car is a kind of using the design of left and right two-wheeled, posture, monolithic with reference to residing for gyroscope measurement vehicle body Machine sends the novel electric vehicle that order-driven motor reaches self-balancing.
Electric two-wheel balance car entirety control structure be:Left and right sides is respectively two three-phase brushless motors, is now needed same When control two three-phase brushless motors, current way has two schemes, the first scheme:One controller, one control chip is same When control two motors, second scheme:Two controllers control two motors respectively.
However, at present in the control program of electric two-wheel balance car, it is impossible to automatically select slave function, it is impossible to realize master The mutually coordinated control of slave motion state.The reason is that the control program of current electric two-wheel balance car, is present following The deficiency of aspect, details are as follows:
First aspect:One controller, one control chip control, two motors are typically due to answering for motor control computing Polygamy, will pass through simplified motor control calculating to solve, now just loses often due to low-cost chip computing capability is limited The comfortableness of part experience, and high operational capability chip further relates to Cost Problems.Simultaneously because two circuit for controlling motor It is all integrated on a circuit board, the single space that controller needs is very big, often can not be divided into two pieces again.
Second aspect:To make two controllers using two low-cost chips, two motors are controlled.Left side controller control Left side motor processed, the right controller control the right motor, although both have communication simply carried out to square controller whether therefore Barrier, to square controller whether the simple information state of switching on and shutting down, both sides controller do not accomplish motion state coordination control, example Such as when one side motor because outside cause causes motion state to change, the control system of opposite side electric machine controller does not add other side The coordination control of motion state, causes vehicle fluctuation of service, and double swerve is swung, the various dangerous situations such as shake.Pass simultaneously The full-vehicle control logical course function expansibility and manufacture simplification of system are poor, for example:When balance car needs many external functions When, being typically due to mcu resource not enough causes two kinds of different programs of left and right sides controller needs, when increasing function also It is that increase needs to separate left side controller and right side control in left side controller or right control, during manufacture to need selection Device, so easily causes production routine confusion, produces the situation of difficult to govern control.
The content of the invention
The purpose of the embodiment of the present invention is to provide a kind of controller, it is intended to solve in a kind of control of electric two-wheel balance car Method, it is intended in the control program for solving current electric two-wheel balance car, it is impossible to automatically select slave function, it is impossible to realize master The problem of mutually coordinated control under slave motion state.
The embodiment of the present invention is achieved in that a kind of electric two-wheel balance car system, positioned at electric two-wheel balance car two Controller, the single-chip microcomputer of side;
The single-chip microcomputer, after energization, has detected whether that power switch key is pressed, if power switch key is pressed, Then the controller of minute book side is main frame, chooses and performs the function required for main frame, automatic shield slave function, and sends master Machine signal and signal is had been switched on to the controller of opposite side;
The controller Receiving Host signal of opposite side and have been switched on after signal, mark from as slave, choose and perform from Function required for machine, automatic shield host function sends slave signal and has been switched on signal to main frame;
The main frame and the slave transmit mutually the exercise data of this side when the electric two-wheel balance car is moved, To realize mutually coordinated control of the slave under motion state.
Further, in described electric two-wheel balance car system, the main frame and the slave use asynchronous receiving-transmitting Transmitter UART, IC bus IIC or serial peripheral equipment interface SPI carry out data transmission.
Further, in described electric two-wheel balance car system, confirm starting up success after, the main frame and The mutual transmitting switch machine state of slave, fault message, gyroscope angle, motor speed, motor target drives dutycycle, electricity The actual driving dutycycle of machine.
Further, in described electric two-wheel balance car system, the either side of the electric two-wheel balance car is outside The power switch key for starting controller is offered on shell.
Further, in described electric two-wheel balance car system, the main frame and the slave read gyroscope number M_Angle is obtained according to calculating, and is updated into the data for needing to send, communication data is read and obtains offside angle of inclination S_ Angle, using 0 angle as desired value, the objective speed that PI computings obtain electric two-wheel balance car is carried out by value of feedback of M_Angle Value M_REF_Speed.
Further, in described electric two-wheel balance car system, the main frame is used to calculate the actual speed of this side motor Degree M_Speed and the slave are used to calculate this side motor actual speed S_Speed, and the main frame and the slave are according to M_ Speed and S_Speed, obtains both sides speed difference Diff_speed, is entered using both sides speed difference Diff_speed as value of feedback Row PI computings, obtain the motor motivation value Adjust_REF_Speed for needing to adjust, by the M_REF_Speed+ calculated Adjust_REF_Speed is input in speed loop, is obtained motor drive current reference value M_REF_PWM, is adjusted repeatedly with this Section, to control both sides motor speed deviation, makes the straight trip of electric two-wheel balance car steady.
Further, in described electric two-wheel balance car system, the main frame and slave setting turning vehicle Speed M_Turn_MAX_Speed=M km/h, if speed target value M_REF_Speed is more than M_Turn_MAX_Speed, are controlled M_REF_Speed processed is decremented to M_Turn_MAX_Speed in the way of every Ius equivalent is successively decreased, while it is actual to calculate this side motor Speed M_Speed and offside motor actual speed S_Speed difference are Diff_speed, setting turning motors differential T_Ref_ Speed=S km/h, PI computings are carried out by value of feedback of both sides speed difference Diff_speed and obtain needing the motor adjusted to drive Dynamic value Adjust_REF_PWM, motor vector is input to by current motor drive current reference value and Adjust_REF_PWM In control electric current loop, new motor motivation value M_PWM is obtained, is adjusted repeatedly with this, to realize both sides motor speed in differential T_Ref_Speed=S km/h and vehicle speed is turned under the conditions of M km/h, it is ensured that the security of turning.
Further, in described electric two-wheel balance car system, the main frame and the slave are in this cant angle When the difference for spending M_Angle and offside angle of inclination S_Angle is more than predetermined angle, reduce motor drive current reference value M_ REF_PWM。
Further, in described electric two-wheel balance car system, the main frame and the motor new from machine testing Whether the difference between motivation value M_PWM and the actual driving dutycycle S_PWM of motor is more than default motivation value, if new motor Motivation value M_PWM is more than default motivation value with the rapid differences of the actual driving dutycycle S_PWM of motor, reduces the M_PWM.
Another embodiment of the present invention is that providing a kind of electric two-wheel based on above-mentioned electric two-wheel balance car system puts down Weigh car control method, including:
After the single-chip microcomputer is powered, detects whether that power switch key is pressed, if power switch key is pressed, then recorded The controller of this side is main frame, chooses and performs the instruction of selection power lights, battery capacity indication, trouble light are indicated, left-hand rotation lamp control work( Can, automatic shield slave function, and send host signal and have been switched on signal to the controller of opposite side;
The controller Receiving Host signal of opposite side and have been switched on after signal, mark from as slave, selection speed indicates, The too high instruction of overspeed alarming, temperature, right-hand rotation lamp control function, automatic shield host function send slave signal and have been switched on letter Number arrive main frame;
The main frame and the slave transmit mutually the exercise data of this side when the electric two-wheel balance car is moved, To realize mutually coordinated control of the slave under motion state.
In embodiments of the present invention, main frame and slave transmit mutually this side when the electric two-wheel balance car is moved In exercise data, the control program for solving current electric two-wheel balance car, it is impossible to automatically select slave function, it is impossible to realize master The problem of slave motion state mutually coordinated control.Beneficial effect be two aspect, on the one hand, can automatic identification slave, Automatically select slave function, without distinguishing slave program, on the other hand, the controllers of both sides according to it is strict when Sequence, adds information and carries out mutually coordinated control, is in normally travel in electric two-wheel balance car and abnormality can be quick Response, substantially increases the vehicle performance of electric two-wheel balance car.
Brief description of the drawings
Fig. 1 is the structured flowchart of electric two-wheel balance car system provided in an embodiment of the present invention;
Fig. 2 is the implementing procedure figure of electric two-wheel balance car control method provided in an embodiment of the present invention;
Fig. 3 a are the Booting sequence figures of electric two-wheel balance car provided in an embodiment of the present invention;
Fig. 3 b are electric two-wheel balance cars provided in an embodiment of the present invention from the realization that straight-going state transition is turn condition Flow chart;
Fig. 3 c are the shutdown process figures of electric two-wheel balance car provided in an embodiment of the present invention.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Embodiment one
Fig. 1 is the structured flowchart of electric two-wheel balance car system provided in an embodiment of the present invention, and details are as follows:
The single-chip microcomputer, after energization, has detected whether that power switch key is pressed, if power switch key is pressed, Then the controller of minute book side is main frame, chooses and performs the function required for main frame, automatic shield slave function, and sends master Machine signal and signal is had been switched on to the controller of opposite side;
The controller Receiving Host signal of opposite side and have been switched on after signal, mark from as slave, choose and perform from Function required for machine, automatic shield host function sends slave signal and has been switched on signal to main frame;
The main frame and the slave transmit mutually the exercise data of this side when the electric two-wheel balance car is moved, To realize mutually coordinated control of the slave under motion state.
The main frame and the slave are additionally operable to when the electric two-wheel balance car is moved, according to default sequential, plus Enter the exercise data of this side corresponding with sequential, by transmitting the exercise data of this side mutually, to realize slave in motion shape Mutually coordinated control under state.
In embodiments of the present invention, beneficial effect is two aspects, on the one hand, being capable of automatic identification slave, automatic choosing Slave function is selected, without distinguishing slave program, on the other hand, the controller of both sides is added according to strict sequential Information carries out mutually coordinated control, electric two-wheel balance car in normally travel and abnormality can quick response, greatly The big vehicle performance for improving electric two-wheel balance car.
Embodiment two
Fig. 2 is the implementing procedure figure of electric two-wheel balance car control method provided in an embodiment of the present invention, and details are as follows:
S201, after the single-chip microcomputer is powered, has detected whether that power switch key is pressed, if power switch key is pressed, Then the controller of minute book side is main frame, chooses and performs the instruction of selection power lights, battery capacity indication, trouble light are indicated, left-hand rotation lamp Control function, automatic shield slave function, and send host signal and have been switched on signal to the controller of opposite side;
S202, the controller Receiving Host signal of opposite side and has been switched on after signal, and mark selects speed from as slave Instruction, overspeed alarming, the too high instruction of temperature, right-hand rotation lamp control function, automatic shield host function send slave signal and opened Machine signal is to main frame;
S203, the main frame and the slave transmit mutually the motion of this side when the electric two-wheel balance car is moved Data, to realize mutually coordinated control of the slave under motion state.
Embodiment three
The embodiment of the present invention describes electric two-wheel balance car control method preferably application flow, and details are as follows:
Wherein, for purposes of illustration only, the controller of this side, sketch as " left side controller ", the controller of opposite side, sketch and be " right control ".
With reference to Fig. 3 a, Fig. 3 a are the Booting sequence figures of electric two-wheel balance car provided in an embodiment of the present invention, and details are as follows:
Carried out data transmission between left side controller and right control using UART, IIC or SPI, when being provided with power supply The power switch key of the controller of switch key is pressed, and the controller of power switch button is not installed and is made by communication power supply acquisition The voltage that single-chip microcomputer can work, has persistently detected whether that power switch key is pressed after the single-chip microcomputer energization work of both sides, if Power switch key is pressed, and records this side controller for main frame, and single-chip microcomputer sets power control pin to be that power supply keeps opening shape State, while choose and perform the function required for main frame, automatic shield slave function, and send host signal and have been switched on signal To the controller of opposite side.
It is main machine that the controller of opposite side, which is received to square controller, and to have been switched on then marking after signal oneself be slave, Single-chip microcomputer sets power control pin to be power supply opening state, while choosing and performing the function required for slave, automatic shield Host function, sends slave signal and has been switched on signal to console controller, if console controller receives slave in X ms Signal is had been switched on, then confirms starting up's success, communication failure is judged if slave enabling signal is not received in X ms Or slave power failure.
Original state:
Main frame and the mutual transmitting switch machine state of slave, fault message, gyroscope angle, motor speed, motor target are driven The actual driving dutycycle of dynamic dutycycle, motor;
Main frame and slave are carried out per Y us communications once, speed be Z bps's and data volume be N bit data transfer, For I us once, gyroscope posture is processed as Jus once to setting speed ring processing speed, then needs to meet Y<=I, Y<=J and N bit data volume is transferred in Y us under Z bps speed;
Current limit is calculated, and voltage limitation is calculated, and it is Hus that controlling cycle is calculated in the operation of motor control vector.
The angle of inclination that this side controller single-chip microcomputer collection gyro data is calculated is M_Angle, velocity sensor Motor speed is detected for M_Speed, motor target drives dutycycle is calculated for M_REF_PWM by speed ring, passed through It is M_PWM that electric current loop, which calculates the actual driving dutycycle of motor,.The offside angle of inclination received from communication port is S_ Angle, motor speed is S_Speed, and motor target drives dutycycle is S_REF_PWM, and the actual driving dutycycle of motor is S_ PWM.It is that timing is positive direction to provide all value data symbols, and numerical symbol is opposite direction when being negative.
With reference to Fig. 3 b, Fig. 3 b be electric two-wheel balance car provided in an embodiment of the present invention from straight-going state transition be turning shape The implementation process figure of state, details are as follows:
To ensure the stationarity of straight trip, turning speed M_Turn_MAX_Speed=0 is set, two side controllers calculate this side Motor actual speed M_Speed and offside motor actual speed S_Speed difference are Diff_speed, with speed Diff_ Ref_Speed=0 deviations are desired value, and PI computings are carried out by value of feedback of both sides speed difference Diff_speed, are needed The motor motivation value Adjust_REF_Speed of adjustment, this PI computing needs Ius to carry out once.The M_REF_ calculated Speed+Adjust_REF_Speed is input in speed loop draws new motor drive current as reference value progress computing Reference value M_REF_PWM, is adjusted to realize both sides motor speed difference Diff_Ref_Speed=0 as target guarantee two repeatedly using this Side motor speed deviation is in minimum zone so that vehicle straight trip is steady.
To ensure the security of turning, it is necessary to limit turning speed, turning vehicle speed is set as M_Turn_ MAX_Speed=M km/h, when M_REF_Speed is more than M_Turn_MAX_Speed, M_REF_Speed is needed in every Ius Equivalent is decremented to M_Turn_MAX_Speed.Meanwhile, calculate this side motor actual speed M_Speed and offside motor actual speed S_Speed difference is Diff_speed, using turning motors differential T_Ref_Speed=S km/h as desired value, with both sides speed Degree difference Diff_speed is that value of feedback carries out motor motivation value Adjust_REF_PWM, this PI that PI computings obtain needing to adjust Computing needs Ius to carry out once.The M_REF_PWM+Adjust_REF_PWM calculated is input to motor vector controlled electric current In loop, new motor motivation value M_PWM is obtained, adjusts to realize both sides motor speed with differential T_Ref_ repeatedly with this Speed=S km/h and vehicle speed is turned under the conditions of M km/h, so as to ensure the security turned.
With reference to Fig. 3 c, Fig. 3 c are the shutdown process figures of electric two-wheel balance car provided in an embodiment of the present invention, and details are as follows:
Abnormality is judged, when this cant angle degree M_Angle and offside angle of inclination S_Angle difference are more than Err_ During Diff_Angle angles then, then two side controllers reduce rapidly M_REF_PWM reached reduction motor actual drive level make it is whole Vehicle speed is reduced.Reduce M_PWM values if M_PWM and the rapid differences of S_PWM are more than Err_Diff_PWM.Judging more than can The quick response processing under abnormality is controlled so as to ensure that bigger hidden danger occurs.
Voltage and current is limited, and the under-voltage value AD values of setting are desired value, with AD sample voltage AD values to feed back Value carries out the current reference value VDec_Ref_PWM that PI control outputs need to subtract, and the bus cut-off current AD values of setting are target It is worth, the current reference value subtracted for value of feedback progress PI control output needs for the bus current AD values returned of being sampled with AD CDec_Ref_PWM, to obtain motor drive current reference value M_REF_PWM.
It is desired value (minimum 0) of limitation, to gather with (M_REF_PWM-Vdec_Ref_PWM-Cdec_Ref_PWM) It is that desired value progress electric current loop PI calculating obtains real electrical machinery motivation value M_PWM to obtain phase line current, then carries out motor vector control System is calculated, and is finally loaded into hardware.
During shutdown, when Host Detection is pressed to power switch button, shutdown command is sent to slave, while reducing driving Value is until being that 0 and then powered-down machine drive.Slave first reduces driving dutycycle until for 0 and then powered-down machine when receiving shutdown command Driving, slave, which is sent, is ready for shutdown command to main frame, and slave is power down state in F us rear-mounted power sources controlling switch, It is power down state that main frame, which receives slave and is ready for shutdown command to put power control pin, and shutdown is completed.If slave is in G The data that main frame transmission is not received by us then reduce motivation value until for 0 and then automatic shutdown, if main frame does not have in G us There are the data for receiving slave transmission then to reduce motivation value until then showing communication failure for 0.
X is set as 50~3000.
Y settings 500~5000 will meet Y simultaneously<=I, Y<=J.
I is speed ring process cycle, is usually set to 500~5000;
J is gyroscope posture process cycle, is usually set to 500~5000;
Z minimum calculation methods are:N*1000000/Y, then the condition that Z is set as:>N*1000000/Y
N is the required data amount bit quantity transmitted.
M is the turning vehicle speed of safety, is usually set to 5~10.
Both sides motor speed difference, 4~8 are usually set to based on security consideration when S is turns;
F is transmits the time of delay switching-off after data, and F needs to be more than Y, is usually set to 10*Y~100Y;
G is the time of judgement communication error, setting value>=F, is usually set to 10*Y~100Y;
H is traditionally arranged to be 12khz~18khz;
Err_Diff_Angle both sides gyroscope differential seat angle can tolerate maximum, be typically set to 15 °~35 °
Err_Diff_PWM both sides motors driving difference can tolerate maximum, be typically set to drive maximum 50%~ 100%;
Example IV
The embodiment of the present invention describes electric two-wheel balance car control method preferably control flow, and details are as follows:
UART baud rates are used to carry out data transmission for 115200 speed between the controller of both sides, when being provided with power supply The power switch key of the controller of switch key is pressed, and the controller for marking this side is main frame, and selection power lights are indicated, electricity refers to Show, trouble light is indicated, left-hand rotation lamp control function, the controller of opposite side, which is received, to be main machine to square controller and have been switched on letter It oneself is slave then to be marked after number, the instruction of selection speed, overspeed alarming, the too high instruction of temperature, right-hand rotation lamp control function.
Confirm after starting up's success, main frame and the mutual transmitting switch machine state of slave, fault message, gyroscope angle, The actual driving dutycycle of motor speed, motor target drives dutycycle, motor.Main frame and slave are carried out per 1500us once, number According to data transfer of the amount for 96bit, for 2000us once, gyroscope posture is processed as 1500us mono- to setting speed ring processing speed It is secondary.Current limit is calculated, and voltage limitation is calculated, and it is 62.5us that controlling cycle is calculated in the operation of motor control vector.
The angle of inclination that this side controller single-chip microcomputer collection gyro data is calculated is M_Angle, velocity sensor Motor speed is detected for M_Speed, motor target drives dutycycle is calculated for M_REF_PWM by speed ring, passed through It is M_PWM that electric current loop, which calculates the actual driving dutycycle of motor,.The offside angle of inclination received from communication port is S_ Angle, motor speed is S_Speed, and motor target drives dutycycle is S_REF_PWM, and the actual driving dutycycle of motor is S_ PWM.It is that timing is positive direction to provide all value data symbols, and numerical symbol is opposite direction when being negative.
When needing straight trip, to ensure the stationarity of straight trip, turning speed M_Turn_MAX_Speed=0, both sides are set The difference that controller calculates this side motor actual speed M_Speed and offside motor actual speed S_Speed is Diff_speed, Using speed Diff_Ref_Speed=0 deviations as desired value, PI fortune is carried out by value of feedback of both sides speed difference Diff_speed The motor motivation value Adjust_REF_Speed for obtaining needing to adjust is calculated, this PI computing needs Ius to carry out once.Calculate M_REF_Speed+Adjust_REF_Speed is input in speed loop show that new motor drives as reference value progress computing Streaming current reference value M_REF_PWM, is adjusted repeatedly with this, to realize both sides motor speed difference Diff_Ref_Speed=0 as mesh Mark, and then ensure both sides motor speed deviation in preferred scope so that vehicle straight trip is steady.
When needing to turn, to ensure the security turned, it is necessary to limit turning speed, setting turning vehicle speed Spend for M_Turn_MAX_Speed=8km/h, work as M_REF_Speed>During M_Turn_MAX_Speed, M_REF_Speed needs Subtract 1 in every 2000us.This side motor speed difference Diff_speed=M_Speed-S_Speed is calculated simultaneously, it is poor with turning motors Fast T_Ref_Speed=5km/h is desired value, and PI computings are carried out by value of feedback of both sides speed difference Diff_speed to be needed The motor motivation value Adjust_REF_PWM to be adjusted, this PI computing needs 2000us to carry out once.The M_REF_ calculated PWM+Adjust_REF_PWM is input in motor vector controlled current loop, obtains new motor motivation value M_PWM.
Abnormality is judged, when this cant angle degree M_Angle and offside angle of inclination S_Angle difference are more than 20 ° When, then two side controllers reduce rapidly M_REF_PWM;If M_PWM is more than 60% maximum drive value with the rapid differences of S_PWM, Reduce M_PWM values.
Voltage and current is limited, and the under-voltage value AD values of setting are desired value, with AD sample voltage AD values to feed back Value carries out the current reference value VDec_Ref_PWM that PI control outputs need to subtract, and the bus cut-off current AD values of setting are target It is worth, the current reference value subtracted for value of feedback progress PI control output needs for the bus current AD values returned of being sampled with AD CDec_Ref_PWM, to obtain motor drive current reference value M_REF_PWM.
With (M_REF_PWM-Vdec_Ref_PWM-Cdec_Ref_PWM) for desired value, limited target value minimum 0, with Collection gained phase line current is that desired value progress electric current loop PI calculating obtains real electrical machinery motivation value M_PWM, then carries out motor Vector controlled is calculated, and is finally loaded into hardware.
During shutdown, when Host Detection is pressed to power switch button, shutdown command is sent to slave, while reducing driving Value is until being that 0 and then powered-down machine drive.Slave first reduces driving dutycycle until for 0 and then powered-down machine when receiving shutdown command Driving, slave, which is sent, is ready for shutdown command to main frame, and slave is power-off shape in 15000us rear-mounted power sources controlling switch State, it is power down state that main frame, which receives slave and is ready for shutdown command to put power control pin, and shutdown is completed.
Reduce motivation value if slave is not received by the data of main frame transmission in 50000us until then automatic for 0 Shutdown, reduces motivation value until being that 0 and then display are communicated if main frame is not received by the data of slave transmission in 50000us Failure.
, can be with several embodiments provided herein, it should be understood that disclosed systems, devices and methods Realize by another way.For example, device embodiment described above is only schematical, for example, the unit Divide, only a kind of division of logic function there can be other dividing mode when actually realizing, such as multiple units or component Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or The coupling each other discussed or direct-coupling or communication connection can be by some communication interfaces, between device or unit Connect coupling or communicate to connect, can be electrical, machinery or other forms.
The unit illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.
If the function is realized using in the form of SFU software functional unit and is used as independent production marketing or in use, can be with It is stored in a computer read/write memory medium.Understood based on such, technical scheme is substantially in other words The part contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter Calculation machine software product is stored in a storage medium, including some instructions are to cause a computer equipment (can be individual People's computer, server, or network equipment etc.) perform all or part of step of each of the invention embodiment methods described. And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any Those familiar with the art the invention discloses technical scope in, the change or replacement that can be readily occurred in, all should It is included within the scope of the present invention.Therefore, protection scope of the present invention should be defined by scope of the claims.

Claims (10)

1. a kind of electric two-wheel balance car system, it is characterised in that including the controller positioned at electric two-wheel balance car both sides, list Piece machine;
The single-chip microcomputer, after energization, has detected whether that power switch key is pressed, if power switch key is pressed, has then remembered The controller for recording this side is main frame, chooses and performs the function required for main frame, automatic shield slave function, and sends main frame letter Number and have been switched on signal to the controller of opposite side;
The controller Receiving Host signal of opposite side and have been switched on after signal, mark is chosen from as slave and performs slave institute The function of needing, automatic shield host function sends slave signal and has been switched on signal to main frame;
The main frame and the slave transmit mutually the exercise data of this side, with reality when the electric two-wheel balance car is moved Existing mutually coordinated control of the slave under motion state.
2. electric two-wheel balance car system as claimed in claim 1, it is characterised in that the main frame and the slave are using different Step receiving-transmitting transmitter UART, IC bus IIC or serial peripheral equipment interface SPI carry out data transmission.
3. electric two-wheel balance car system as claimed in claim 1, it is characterised in that after starting up's success is confirmed, institute State main frame and the mutual transmitting switch machine state of the slave, fault message, gyroscope angle, motor speed, motor target drives The actual driving dutycycle of dutycycle, motor.
4. electric two-wheel balance car system as claimed in claim 1, it is characterised in that any of the electric two-wheel balance car Side offers the power switch key for starting controller on shell.
5. electric two-wheel balance car system as claimed in claim 1, it is characterised in that the main frame and the slave read top Spiral shell instrument data, which are calculated, obtains M_Angle, and updates into the data for needing to send, and reads communication data and obtains offside angle of inclination S_Angle, using 0 angle as desired value, the speed mesh that PI computings obtain electric two-wheel balance car is carried out by value of feedback of M_Angle Scale value M_REF_Speed.
6. the electric two-wheel balance car system as described in claim 1 to 5 is any, it is characterised in that the main frame is used to calculate This side motor actual speed M_Speed and the slave are used to calculate this side motor actual speed S_Speed, the main frame and institute Slave is stated according to M_Speed and S_Speed, both sides speed difference Diff_speed is obtained, with both sides speed difference Diff_ Speed is that value of feedback carries out PI computings, the motor motivation value Adjust_REF_Speed for needing to adjust is obtained, by what is calculated M_REF_Speed+Adjust_REF_Speed is input in speed loop, obtains motor drive current reference value M_REF_PWM, Adjusted repeatedly with this, to control both sides motor speed deviation, make the straight trip of electric two-wheel balance car steady.
7. electric two-wheel balance car system as claimed in claim 1, it is characterised in that the main frame and slave setting turn Curved vehicle speed M_Turn_MAX_Speed=M km/h, if speed target value M_REF_Speed is more than M_Turn_MAX_ Speed, then control M_REF_Speed to be decremented to M_Turn_MAX_Speed in the way of every Ius equivalent is successively decreased, while calculating this Side motor actual speed M_Speed and offside motor actual speed S_Speed difference are Diff_speed, set turning motors Differential T_Ref_Speed=S km/h, PI computings are carried out by value of feedback of both sides speed difference Diff_speed and obtain needing to adjust Whole motor motivation value Adjust_REF_PWM, current motor drive current reference value and Adjust_REF_PWM are inputted Into motor vector controlled current loop, new motor motivation value M_PWM is obtained, is adjusted repeatedly with this, to realize both sides motor Speed is turned in differential T_Ref_Speed=S km/h and vehicle speed under the conditions of M km/h, it is ensured that the safety of turning Property.
8. electric two-wheel balance car system as claimed in claim 1, it is characterised in that the main frame and the slave are in this side When angle of inclination M_Angle and offside angle of inclination S_Angle difference are more than predetermined angle, reduce motor drive current reference Value M_REF_PWM.
9. electric two-wheel balance car system as claimed in claim 1, it is characterised in that the main frame and described new from machine testing Motor motivation value M_PWM and the actual driving dutycycle S_PWM of motor between difference whether be more than default motivation value, if newly Motor motivation value M_PWM and the rapid differences of the actual driving dutycycle S_PWM of motor more than default motivation value, the reduction M_ PWM。
10. a kind of electric two-wheel balance car control method based on electric two-wheel balance car system described in claim 1, its feature It is, including:
After the single-chip microcomputer is powered, detect whether that power switch key is pressed, if power switch key is pressed, then minute book side Controller be main frame, choose and perform selection power lights instructions, battery capacity indication, trouble light are indicated, left-hand rotation lamp control function, oneself Dynamic shielding slave function, and send host signal and have been switched on signal to the controller of opposite side;
The controller Receiving Host signal of opposite side and have been switched on after signal, mark is from as slave, and selection speed is indicated, hypervelocity Alarm, temperature it is too high indicate, right-hand rotation lamp control function, automatic shield host function, send slave signal and have been switched on signal to Main frame;
The main frame and the slave transmit mutually the exercise data of this side, with reality when the electric two-wheel balance car is moved Existing mutually coordinated control of the slave under motion state.
CN201710130706.3A 2017-03-06 2017-03-06 A kind of electric two-wheel balance car system and electric two-wheel balance car control method Pending CN107015561A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710130706.3A CN107015561A (en) 2017-03-06 2017-03-06 A kind of electric two-wheel balance car system and electric two-wheel balance car control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710130706.3A CN107015561A (en) 2017-03-06 2017-03-06 A kind of electric two-wheel balance car system and electric two-wheel balance car control method

Publications (1)

Publication Number Publication Date
CN107015561A true CN107015561A (en) 2017-08-04

Family

ID=59439728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710130706.3A Pending CN107015561A (en) 2017-03-06 2017-03-06 A kind of electric two-wheel balance car system and electric two-wheel balance car control method

Country Status (1)

Country Link
CN (1) CN107015561A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108501768A (en) * 2018-03-29 2018-09-07 南京航空航天大学 A kind of two-wheeled method for control speed based on Z axis gyroscope and difference in wheel
CN109436163A (en) * 2018-12-19 2019-03-08 浙江阿尔郎科技有限公司 Two-wheeled link balance vehicle and its control method
CN109799825A (en) * 2019-01-31 2019-05-24 电子科大科园股份有限公司 A kind of synchronization aisle method of grain-levelling machine device people
CN111055958A (en) * 2020-01-23 2020-04-24 米建军 Electric balance car control using method and electric balance car system
CN112114539A (en) * 2020-09-25 2020-12-22 成都易慧家科技有限公司 Control system and method for double-motor-driven sliding door and window
CN115320761A (en) * 2021-11-19 2022-11-11 钭俊龙 Multi-program two-wheeled electric balance car and control method
CN115320763A (en) * 2021-11-19 2022-11-11 钭俊龙 Two-wheeled electric balance vehicle easy to operate and control method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203268232U (en) * 2013-01-30 2013-11-06 杭州亿脑智能科技有限公司 Balance control device of intelligent balance car and intelligent balance car
CN103472832A (en) * 2013-09-16 2013-12-25 苏州工业园区职业技术学院 Full-digital servo controller of two-wheel micro-mouse based on dual processors
JP5776524B2 (en) * 2011-12-05 2015-09-09 トヨタ自動車株式会社 Four-wheel drive vehicle
CN104991477A (en) * 2015-07-24 2015-10-21 厦门理工学院 Manned balance vehicle control method and manned balance vehicle
CN105824292A (en) * 2016-05-23 2016-08-03 威海明达创新科技有限公司 Robot distributed controller and control method
CN205750377U (en) * 2016-03-18 2016-11-30 北京光年无限科技有限公司 A kind of multi-joint small scale robot electric-control system
CN106379458A (en) * 2016-10-24 2017-02-08 美国锐哲有限公司 Self-balance car and control system thereof

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5776524B2 (en) * 2011-12-05 2015-09-09 トヨタ自動車株式会社 Four-wheel drive vehicle
CN203268232U (en) * 2013-01-30 2013-11-06 杭州亿脑智能科技有限公司 Balance control device of intelligent balance car and intelligent balance car
CN103472832A (en) * 2013-09-16 2013-12-25 苏州工业园区职业技术学院 Full-digital servo controller of two-wheel micro-mouse based on dual processors
CN104991477A (en) * 2015-07-24 2015-10-21 厦门理工学院 Manned balance vehicle control method and manned balance vehicle
CN205750377U (en) * 2016-03-18 2016-11-30 北京光年无限科技有限公司 A kind of multi-joint small scale robot electric-control system
CN105824292A (en) * 2016-05-23 2016-08-03 威海明达创新科技有限公司 Robot distributed controller and control method
CN106379458A (en) * 2016-10-24 2017-02-08 美国锐哲有限公司 Self-balance car and control system thereof

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108501768A (en) * 2018-03-29 2018-09-07 南京航空航天大学 A kind of two-wheeled method for control speed based on Z axis gyroscope and difference in wheel
CN109436163A (en) * 2018-12-19 2019-03-08 浙江阿尔郎科技有限公司 Two-wheeled link balance vehicle and its control method
CN109436163B (en) * 2018-12-19 2024-04-16 浙江阿尔郎科技有限公司 Two-wheel linkage balance car and control method thereof
CN109799825A (en) * 2019-01-31 2019-05-24 电子科大科园股份有限公司 A kind of synchronization aisle method of grain-levelling machine device people
CN111055958A (en) * 2020-01-23 2020-04-24 米建军 Electric balance car control using method and electric balance car system
CN112114539A (en) * 2020-09-25 2020-12-22 成都易慧家科技有限公司 Control system and method for double-motor-driven sliding door and window
CN112114539B (en) * 2020-09-25 2023-11-28 成都易慧家科技有限公司 Control system and method for double-motor driven sliding door and window
CN115320761A (en) * 2021-11-19 2022-11-11 钭俊龙 Multi-program two-wheeled electric balance car and control method
CN115320763A (en) * 2021-11-19 2022-11-11 钭俊龙 Two-wheeled electric balance vehicle easy to operate and control method
CN115320761B (en) * 2021-11-19 2024-05-17 钭俊龙 Multi-program two-wheel electric balance car and control method
CN115320763B (en) * 2021-11-19 2024-06-07 钭俊龙 Easy-to-operate two-wheeled electric balance car and control method

Similar Documents

Publication Publication Date Title
CN107015561A (en) A kind of electric two-wheel balance car system and electric two-wheel balance car control method
EP2692606B1 (en) Vehicle controller
CN103818382B (en) Method for controlling powertrain system
CN103801973B (en) The optimal control method of servomotor based on servo saddle controller
CN112638695B (en) Torque control method, device and equipment of electric automobile and storage medium thereof
CN107181444A (en) Temperature monitoring device and method, message handling program and recording medium
JP2014079095A (en) Regenerative controller for vehicle
CN102428641B (en) Motor drive control device
CN106184519B (en) A kind of balance car method of controlling security and device
CN106537723A (en) Quick charging method, mobile terminal and adapter
CN108515842A (en) Dual-motor electric tractor PTO control systems
CN107943623A (en) A kind of storage system
CN107074114A (en) System for the electro-motor in pilotage battery-operated motor cycle etc.
CN105573112A (en) Diesel locomotive excitation controller dual-unit hot redundancy automatic switching system
CN106094789A (en) The dual chip redundancy of a kind of automobile steering-by-wire and fault-tolerant control system
CN107107948A (en) Steering for the automatic Pilot of motor vehicle
CN106383511B (en) The emulation test method of entire car controller, device and system
JP5538333B2 (en) Battery monitoring device
CN103149851B (en) Manipulation communication system
CN104054059A (en) Information processing device and information processing method
CN104991477B (en) A kind of manned balance car control method and a kind of manned balance car
CN115257401A (en) Distributed driving method and device for mobile robot
CN109510551A (en) The implementation method and device of essential safe type servo-system
CN204989827U (en) Manned balance car
CN103707886A (en) Control strategy for an electric machine in a vehicle

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170804

RJ01 Rejection of invention patent application after publication