Summary of the invention
Connect problems such as complicated, the low and poor reliability of accuracy for the commodity feeding device that solves automatic vending machine, the invention provides the apparatus and method that a kind of commodity that are used for automatic vending machine are carried, concrete technical scheme is as follows:
The device that a kind of commodity that are used for automatic vending machine are carried comprises controller 101, register 102, line driver 103, row driver 104 and motor array 105.The input end of register 102 connects the output terminal of controller 101, is used to receive and store the control routine that described controller 101 sends; The output terminal of register 102 is connected row drive wire and column drive wire in the motor array 105 respectively by line driver 103 and row driver 104; Motor array 105 by on the automatic vending machine in the in stockit is available road corresponding motor rearrange, use same row drive wire with the motor of delegation, the motor of same row uses same column drive wire; Described controller 101 is controlled by the running of each motor in register 102, line driver 103 and 104 pairs of motor arrays 105 of row driver.
The step of described controller 101 control motor operations comprises:
A) controller 101 goes out control routine according to the position calculation of driven motor;
B) register 102 receives described control routine;
C) behind register 102 controlled devices 101 gatings, latch the described control routine of output, make line driver (103) and row driver 104 enter duty, motor 201 entrys into service;
D) during controlled device 101 gatings, the output high-impedance state does not make line driver 103 and row driver 104 enter halted state to register 102, and motor 201 shuts down.
The computing method of described control routine are: be located in the motor array of 8 row, 16 row, motor to be driven is positioned at the capable C row of R;
The control routine of row is the R position that moves to right of ' 1 ' in ' 10000000 ', and the control routine of row is the C position that moves to right, ' 1 ' in ' 10,000,000 00000000 ';
Shift-out bit 0 polishing;
The control routine of row and the control routine of row are joined end to end, promptly can be spliced into the control routine of motor.
Be in series with current detector 106 in the driving circuit of motor; Described current detector 106 comprises inspection leakage resistance 301, reference voltage source and voltage comparator 302, and the magnitude of voltage at inspection leakage resistance 301 two ends and the magnitude of voltage of reference voltage source are exported to controller 101 through voltage comparator 302 after relatively; Whether the drive current that described current detector 106 is used for monitoring motor is normal, and the output signal of current detector 106 is the output signal of described voltage comparator 302.
This device also comprises the detecting device 107 of selling goods, it is located at the outlet of automatic vending machine, whether be used to detect commodity is transferred out, and testing result output fed back to controller 101, controller 101 can select whether to use the output result of detecting device 107 of selling goods when selling, promptly whether enable the function of selling goods and detecting.
Described motor 201 is provided with the cam 205 coaxial with motor 201 rotors, on this cam 205, is connected with the microswitch 206 in the driving circuit that is connected on motor 201; When motor 201 drive cams 205 rotate a circle, cam 205 can be touched microswitch 206, make drive current have no progeny in extremely of short duration and recover normal producing one, controller 101 is by adding up all numbers to know that motor 201 rotates to the quantity of current interruptions signal.
The method that a kind of commodity of using said apparatus are carried may further comprise the steps:
When a) carrying commodity, motor at first rotated for 1 week;
Whether b) if the function that detects of selling goods is not activated, this flow process finishes, be sent otherwise the detecting device of selling goods (107) detects commodity;
C) if be sent, then commodity are carried successfully, and this flow process finishes, otherwise motor carries out the additional rotation first time;
D) after the additional rotation first time, if commodity are sent, then commodity are carried successfully, and this flow process finishes, otherwise carries out the additional rotation second time;
E) for the second time after the additional rotation, if commodity are sent, then commodity are carried successfully, and this flow process finishes, otherwise think that commodity sell the end of commodity conveying flow process off.
Controller 101 pre-sets according to the user's, control motor additional rotation, and each rotation is less than 1 week or equaled for 1 week.
In the motor rotation process, controller 101 is by the drive current of current detector 106 monitoring motor, if electric current is too low or too high, controller 101 just stops motor operation, and finish commodity and carry flow process, and prompting low current or high current fault.If the motor continuous running has surpassed the stipulated time, controller 101 is forced the motor stall, finish commodity and carry flow process, and prompt timeout operational failure.
Beneficial effect of the present invention comprises:
1. because the embodiment of the invention adopts array pattern control motor, the motor of same row or column uses the drive wire of same row or column, makes the mode of connection simplify greatly, has improved the quantity of controllable motor;
2. because the embodiment of the invention is equipped with the detecting sensor of selling goods, when the commodity of carrying are stuck, at most can also additional rotation twice, improve automatic vending machine and carried the commodity success ratio;
3. because the embodiment of the invention is equipped with current detector, can discern the low current fault and the high current fault that take place in the motor operation, help in time automatic vending machine being safeguarded;
4. the loss on sale that microswitch inefficacy causes because the embodiment of the invention to monitoring, can discern the overtime operational failure that takes place in the motor operation duration of runs of motor, is avoided.
Embodiment
The invention will be further described below in conjunction with the drawings and specific embodiments, but not as a limitation of the invention.
The device that the embodiment of the invention provides a kind of commodity that are used for automatic vending machine to carry referring to shown in Figure 1, comprising: controller 101, register 102, line driver 103, row driver 104, motor array 105.Controller 101 is single-chip microcomputers, is used to control miscellaneous equipment and finishes the commodity conveying; Register 102 adopts shift register, and input end adopts the mode that seals in and go out to receive the control routine of the driving motor of controller 101 generations, and output terminal is connected on the input end of line driver 103 and row driver 104; Line driver 103 and row driver 104 all adopt the darlington array chip of high-voltage large current to be used for driving motor, and its output pin is connected respectively on the row drive wire and column drive wire of motor array 105; Motor array 105 by on the automatic vending machine in the in stockit is available road corresponding motor rearrange, the motor of same row or column uses same row or column drive wire, controller 101 just can drive motor on certain particular location according to following steps like this: at first, go out control routine and send to register 102 according to the position calculation of driven motor; When register 102 controlled devices 101 gatings, latch this control routine of output, make driver enter duty, the motor entry into service; When register 102 not during controlled device 101 gatings, latch the output high-impedance state, make driver enter halted state, motor shuts down.
Be controlled to be example with 128 motor that use 24 bit shift register chips that 8 row * 16 row are arranged below, introduce 24 output valves, i.e. control routines how the ranks position of motor being converted to shift register.In the motor array, it is ' 10,000,000 10,000,000 00000000 ' that motor on the 1st row the 1st column position converts shift register value to, wherein the output of the 1st row drive wire of first ' 1 ' expression is effective, and the 1st column drive wire output of second ' 1 ' expression effectively; It then is ' 10,000,000 01,000,000 00000000 ' that motor on the 1st row the 2nd column position converts shift register value to, represents that the output of the 1st row drive wire and the 2nd column drive wire is effective.When programming, controller 101 is by the control routine of following formula calculating motor: establish motor and be positioned at the capable C row of R, then the control routine of Hanging is ' 10000000 ' the R position that moves to right, the control routine of row is ' 10,000,000 00000000 ' the C position that moves to right, shift-out bit 0 polishing, then they are joined end to end, promptly can be spliced into 24 Electric Machine Control code.
Fig. 2 has provided the mechanical electric connection diagram of the embodiment of the invention.Motor 201 links to each other with spiral shelf 204 in the goods road 203 by speed reduction unit 202, sends out by driving the commodity that its rotation handle is placed in the shelf 204.With the coaxial cam 205 of motor 201 on, microswitch 206 in the driving circuit that is connected on motor 201 is installed, when motor 201 drive cams 205 rotate a circle, cam 205 can be touched microswitch 206, make drive current have no progeny in extremely of short duration and recover normal producing one, controller 101 is by adding up all numbers that just can know motor 201 rotations to the quantity of current interruptions signal.
Whether the detecting device 107 of selling goods is located at the exit in goods road 203, be used for detecting commodity and be transferred out, and testing result output is fed back to controller 101, and this device can adopt phototriode to constitute when concrete the application.When commodity can shut out the light during by outlet, the output terminal of goods detecting device 107 on sale produces a signal transition.Controller 101 can know by detecting this signal transition whether commodity are sent.
Motor unloaded during with load electric current different, for example when concrete application, can be used as open circuit when drive current is lower than 40mA, and can be used as electromotor overload when being higher than 320mA, the both belongs to the abnormal work state.By current detector 106 of series connection in motor circuit, can monitor this two kinds of malfunctions.Fig. 3 electrical schematic diagram that to be the embodiment of the invention detect the drive current of motor, wherein current detector 106 comprises inspection leakage resistance 301, reference voltage source (not shown on the figure) and voltage comparator 302, and line driver 103 and row driver 104 can be simplified single electric motor and be considered as large power triode.Inspection leakage resistance 301 is precision resistances of a fixed resistance value, is used for current signal is converted to voltage signal, sends into two-way voltage comparator 302.Voltage comparator 302 uses the two-way operational amplifier to constitute, and is respectively high current comparator and low current comparer, and their reference voltage all obtains by reference voltage source, can adopt stabilivolt or resistor voltage divider circuit to realize in concrete the application.Input signal respectively with the two-way reference voltage relatively after, voltage comparator 302 output high-low levels, and feed back to controller 101.When unusual rising of the drive current of motor or reduction, the high current comparator in the voltage comparator 302 or the output level of low current comparer will change, and controller 101 can be judged concrete current failure type by reading corresponding output signal.
The embodiment of the invention has also proposed the method that a kind of commodity that are used for automatic vending machine are carried, and referring to Fig. 4, starts from step 401, ends at step 412:
Step 402: when carrying commodity, motor at first rotated for 1 week;
Step 403: if the function that detects of selling goods is not activated, directly arrive step 412, this flow process finishes, otherwise forwards step 404 to, and whether the detecting device 107 of selling goods detects commodity and be sent;
Step 404: if be sent, then commodity are carried successfully, forward step 409 to, and this flow process finishes, otherwise enters step 405;
Step 405: controller 101 reads and sets in advance, and is 1 week of rotation or 1 week of less than to determine when the motor additional rotation one time:
Step 406: motor carries out additional rotation;
Step 407: time-delay is waited for a period of time, and makes commodity have time enough to drop;
Step 408: after the additional rotation, if commodity are sent, just enter step 409, this flow process finishes, otherwise enters step 410:
Step 409: commodity are carried successfully, enter step 412, and commodity carry flow process to finish;
Step 410: if motor additional rotation twice, just enter step 411, otherwise return step 406, carry out the additional rotation second time;
Step 411: commodity are sold off, and network operator's fill-ins of prompting automatic vending machine, commodity carry flow process to finish, and enter step 412.
In above-mentioned flow process, the meaning of step 405 is and can all numbers of the additional rotation of motor be provided with flexibly according to the different qualities of concrete commodity.In actual applications, owing to be subjected to the influence of factors such as sold goods size, weight and packing, commodity accidental situation that is stuck in shelf when carrying is had nothing in common with each other.For example some commodity is stuck in the end in goods road easily, at this moment shelf only need small angle of additional rotation again, as 1/6 week, just can send out commodity, if but at this moment the additional rotation of motor was fixed as for 1 week, when additional rotation, not only can send out jammed commodity so, also may also send out second commodity on these shelf, bring loss for the network operator of automatic vending machine.Again for example for the other commodity, do not put continuously owing to artificial carelessness easily when on shelf, putting, cause the position vacancy, so when the shelf rotation may can not sent commodity during 1 week, also needing 1 week of additional rotation, obviously is what practical significance useless iff rotating for 1/6 week at this moment again.Therefore, by the function that step 405 provides, the network operator can fully weigh advantages and disadvantages at the different characteristics of sold goods, and all numbers of motor additional rotation are set neatly, to protect client and the interests of self to greatest extent.
Fig. 5 has provided the method flow diagram that the embodiment of the invention is controlled and monitored motor operation, starts from step 501, ends at step 513:
Step 502: controller 101 calculates control routine according to the particular location of motor;
Step 503: controller 101 sends to register 102 to control routine:
Step 504: register 102 is latched the output control routine by gating, makes driver enter duty, and motor rotates;
Step 505: current sensor 106 detects the drive current of motor;
Step 506:, just enter step 507, otherwise enter step 511 if the drive current fault does not take place in the output of current detector 106 prompting;
Step 507: judge the duration of runs of 101 pairs of motor of controller,, just enter step 510, otherwise motor is normal working time, enters step 508 if continuous service has surpassed 1 all needed maximum times of normal rotation;
Step 508: controller 101 is judged all numbers of motor rotation by detecting microswitch 206, if do not turn over for 1 week as yet, then returns step 505, continues the operating condition of monitoring motor, otherwise enters step 509;
Step 509: controller 101 prompting motor operations are normal, enter step 512;
Step 510: the overrun fault of controller 101 prompting motor enters step 512;
Step 511: the drive current fault of controller 101 prompting motor enters step 512;
Step 512: stop strobe register 102, make it to export high-impedance state, driver enters halted state, and the motor stall enters step 513, and this flow process finishes.
Above embodiment is a more preferably embodiment of the present invention, and common variation that those skilled in the art carries out in the technical solution of the present invention scope and replacement all should be included in protection scope of the present invention.