The method that is used for the anti-landslide of golf-ball-bag vehicle
Technical field
The invention belongs to the control technology field, relate to a kind of method that is used for the anti-landslide of golf-ball-bag vehicle.
Background technology
Golf-ball-bag vehicle is used for delivering the golf bag and the article of playing ball, and the golf-ball-bag vehicle controller is one of important composition of golf-ball-bag vehicle, is used for the motion control to whole golf-ball-bag vehicle, is related to the performance of whole golf-ball-bag vehicle.Traditional hand propelled golf-ball-bag vehicle does not comprise the controller part, uses very inconvenient.Novel golf-ball-bag vehicle comprises controller, by storage battery electric power is provided, and what have also has been equipped with remote controller, can realize that remote control is advanced, remote control is retreated, manually advances, function such as manual retraction, snub, electric weight indication, fault alarm.When golf-ball-bag vehicle stops on the slope of certain slope; If the operator does not adopt manual mechanical locking; The problem on golf-ball-bag vehicle landslide may take place, cause the player to take sb's mind off sth, golf-ball-bag vehicle might topple during the landslide; And cause the damage of golf-ball-bag vehicle or article, when serious even can hurt the player.
Traditional anti-landslide method is the brake of short circuit motor terminal or armstrong's patent, but this method and be not suitable for polytype motor possibly need artificial control and poor reliability, when the gradient is big, and the situation that possibly still can come down.
Need overcome following problem in the design process of the anti-landslide of golf-ball-bag vehicle: 1, overcome the influence of different gradient to anti-landslide effect; When 2, overcoming wheel and be in different road surface, to the influence of anti-landslide effect; 3, overcome and apply non-artificial or during artificial action power, the influence of anti-landslide effect.
Summary of the invention
The present invention is directed to the deficiency of prior art, a kind of method that is used for the anti-landslide of golf-ball-bag vehicle is provided.
The concrete steps of the inventive method are:
Step (1) is to the controller initialization of the anti-landslide of golf-ball-bag vehicle, and the initialization object comprises single-chip microcomputer clock frequency, input and output, built-in variable, register, timer and the interruption in the controller.
Step (2) is set left motor average speed S
lInitial value and right motor average speed S
rInitial value be " 0 ", S
lAnd S
rThe average speed of left motor and right motor in the difference express time t; Set left motor drive direction D
lInitial value and the initial value D of right motor drive direction
rBe " 0 ", D
lAnd D
rThe direction of left motor and right motor in the difference express time t is for D
lAnd D
r, direction of advance is labeled as " 1 ", and direction of retreat is labeled as " 1 ", stops bearing mark and is " 0 ".
Step (3) judges that anti-landslide controller is at time t
0Whether receive orders.If receive orders, then judge the command type that anti-landslide controller is received; If do not receive orders, then cut off the left motor of golf-ball-bag vehicle and the power supply of right motor, then execution in step (4).
Described command type is ceased and desisted order and is ceased and desisted order and form by non-;
Described non-ceasing and desisting order comprises advance command, backward command, diversion order and stops diversion order; If anti-landslide controller is received non-ceasing and desisting order, then carry out corresponding Electric Machine Control according to non-ceasing and desisting order, if receiving, anti-landslide controller ceases and desist order, then cut off the left motor of golf-ball-bag vehicle and the power supply of right motor, then execution in step (4).
Step (4) is with S
l, S
r, D
l, D
rZero clearing starts the input capture and the interruption of anti-landslide controller, to golf-ball-bag vehicle left side motor primary importance hall signal L
1With right motor primary importance hall signal R
1Carry out input capture, acquisition mode all is that catch at the edge; Start timer T
c, set timer T
cInterrupt interval is t.
Step (5) is as left motor primary importance hall signal L
1When producing edge signal, according to left motor primary importance hall signal L
1, left motor second place hall signal L
2, L
1And L
2Between phase difference θ
lUpgrade left motor drive direction D
lBe " 1 " or " 1 "; As right motor primary importance hall signal R
1When producing edge signal, according to right motor primary importance hall signal R
1, right motor second place hall signal R
2, R
1And R
2Between phase difference θ
rUpgrade right motor drive direction D
rFor " 1 " or " 1 ", upgrade S simultaneously
lAnd S
r
Step (6) is when interrupting t arrival at interval, if D
lBe " 1 ", then control left motor and retreat, adjust left motor output torque, output torque adjustment amount and S
lProportional relation; If D
lBe " 1 ", then control left motor and advance, adjust left motor output torque, output torque adjustment amount and S
lProportional relation; If D
lBe " 0 " that then left Electric Machine Control direction is constant, do not adjust left motor output torque.
If D
rBe " 1 ", then control right motor and retreat, adjust right motor output torque, output torque adjustment amount and S
rProportional relation; If D
rBe " 1 ", then control right motor and advance, adjust right motor output torque, output torque adjustment amount and S
rProportional relation; If D
rBe " 0 " that then right Electric Machine Control direction is constant, do not adjust right motor output torque; Jump to step (3) then.
The golf-ball-bag vehicle controller of employing this method can be avoided the generation of this problem; Golf-ball-bag vehicle stays in sloping last time; Anti-landslide function starts automatically, though two wheels be in different directions the gradient, apply non-artificial or situation such as artificial action power when taking place, still possess very high reliability and stability; Avoid manual operation, improved the hommization and the fail safe of golf-ball-bag vehicle.
The advantage that the inventive method had is:
(1) is suitable for polytype motor;
(2) the bigger gradient is stood good;
(3) adaptive ability is strong, can overcome the influence of pavement behavior to anti-landslide algorithm;
(4) the anti-reaction speed that comes down is fast.
Embodiment
The method concrete steps that are used for the anti-landslide of golf-ball-bag vehicle are:
Step (1) is to the controller initialization of the anti-landslide of golf-ball-bag vehicle, and the initialization object comprises single-chip microcomputer clock frequency, input and output, built-in variable, register, timer and the interruption in the controller; Controller adopts the MC9S08AC16 of Freescale company, and the CPU running frequency is 32MHz, and the bus running frequency is 16MHz.
Step (2) is set left motor average speed S
lInitial value and right motor average speed S
rInitial value be " 0 ", S
lAnd S
rThe average speed of left motor and right motor in the difference express time t; Set left motor drive direction D
lInitial value and the initial value D of right motor drive direction
rBe " 0 ", D
lAnd D
rThe direction of left motor and right motor in the difference express time t is for D
lAnd D
r, direction of advance is labeled as " 1 ", and direction of retreat is labeled as " 1 ", stops bearing mark and is " 0 "; T satisfies 0s<t<1s, and t is directly connected to the stabilization time on the anti-landslide of system, desirable 0.05s.
Step (3) judges that anti-landslide controller is at time t
0Whether receive orders.(t
0Satisfy 0s<t
0<30s, t
0Be directly connected to the start-up time on the anti-landslide of system, desirable 3s; If) receive orders, then judge the command type that anti-landslide controller is received; If do not receive orders, then cut off the left motor of golf-ball-bag vehicle and the power supply of right motor, then execution in step (4).
Command type is ceased and desisted order and is ceased and desisted order and form by non-;
Non-ceasing and desisting order comprises advance command, backward command, diversion order and stops diversion order; If anti-landslide controller is received non-ceasing and desisting order, then carry out corresponding Electric Machine Control according to non-ceasing and desisting order, if receiving, anti-landslide controller ceases and desist order, then cut off the left motor of golf-ball-bag vehicle and the power supply of right motor, then execution in step (4).
Step (4) is with S
l, S
r, D
l, D
rZero clearing starts the input capture and the interruption of anti-landslide controller, to golf-ball-bag vehicle left side motor primary importance hall signal L
1With right motor primary importance hall signal R
1Carry out input capture, acquisition mode all is that catch at the edge; Start timer T
c, set timer T
cInterrupt interval is t.
Step (5) is worked as L
1When producing edge signal, according to left motor primary importance hall signal L
1, left motor second place hall signal L
2, L
1And L
2Between phase difference θ
lUpgrade left motor drive direction D
lBe " 1 " or " 1 "; Work as R
1When producing edge signal, according to right motor primary importance hall signal R
1, right motor second place hall signal R
2, R
1And R
2Between phase difference θ
rUpgrade right motor drive direction D
rFor " 1 " or " 1 ", upgrade S simultaneously
lAnd S
rθ
lAnd θ
rRelevant with the installation site of Hall element, satisfy 0 °<θ
l<180 °, 0 °<θ
r<180 °, desirable 90 °.
Step (6) is when interrupting t arrival at interval, if D
lBe " 1 ", then control left motor and retreat, adjust left motor output torque, output torque adjustment amount and S
lProportional relation; If D
lBe " 1 ", then control left motor and advance, adjust left motor output torque, output torque adjustment amount and S
lProportional relation; If D
lBe " 0 " that then left Electric Machine Control direction is constant, do not adjust left motor output torque.
If D
rBe " 1 ", then control right motor and retreat, adjust right motor output torque, output torque adjustment amount and S
rProportional relation; If D
rBe " 1 ", then control right motor and advance, adjust right motor output torque, output torque adjustment amount and S
rProportional relation; If D
rBe " 0 " that then right Electric Machine Control direction is constant, do not adjust right motor output torque; Jump to step (3) then.