In existing technology, vein automatic infusion controller by Great Wall, Xi'an non-standard equipment factory and The People's Hospital's invention, this vein automatic infusion controller adopts the infrared electro change-over circuit that liquid droping speed is detected, when not having dropping liquid to drip, the infrared electro receiving tube is directly accepted the infrared light that infrared transmitting tube sends, the signal of telecommunication that produces by photoelectric switching circuit is the constant relatively value of intensity, when dropping liquid drips, because dropping liquid is absorbed infrared light or reflects, the infrared signal that makes infrared receiving tube can not receive infrared signal or receive a little less than, make the corresponding signal of telecommunication produce one detectable (zero level) pulse.In this technology, when dropping liquid drips, adopt the rising edge of microprocessor CPU paired pulses to detect, when detecting rising edge of a pulse, intervalometer begins to clock, when dropping liquid drips next time, detect the rising edge of next pulse, the CPU timing stops, and by calculating the interval of two pulses, detects the speed that drips speed.Then, send instruction by microcomputer and drive the servomotor rotation, the control clamping device to servo circuit.Though this technology has realized the control to transfusion drip speed theoretically, practicality is not enough, has following technical shortcoming: 1, can not overcome " bimodal " phenomenon (the present invention will be explained in detail " bimodal " phenomenon in an embodiment).Because of a dropping liquid correspondence bimodal has two rising edges, make the generation maloperation of clocking of microprocessor CPU, influence detects the accuracy of dripping speed, and has not both described this bimodal phenomenon in existing technology, does not also take to overcome any method and the measure of this bimodal phenomenon.2, in existing technology, when detecting the actual speed of dripping with predefined speed when variant, microcomputer is exported one and is corrected pulse between every, servo circuit will be according to this pulse, switch on to servomotor, drive its and rotate, thereby make the actual number that drips approach preset value one by one by the adjustment of pulse one by one, reach with preset value identical till.But, owing to can only once adjust between per two, after adjusting once to there be certain stabilization time, and when adjusting by the clamping device of adjusting flexible pipe, the adjustment interval is non-linear with the relation of controlled speed, when the precision that requires to control is higher (step-length adjusted of each clamping device hour), drip speed and dripping under the bigger situation of fast difference of setting in advance in initial reality, the time that needs are long just can be adjusted to desired speed, and this has bigger limitation in clinical practice.3, the induction coil of servomotor and microprocessor also can produce the burr interference near zero level, are to make CPU produce the another reason of flase drop survey, maloperation.
Purpose of the present invention is intended to overcome above-mentioned the deficiencies in the prior art, proposes a kind ofly can effectively eliminate bimodal and burr and disturb, and improves and detects an accuracy of dripping speed, shortens the automatic control system for intravenous drip of the time of adjusting to the right place.
Realize the technical scheme of above-mentioned purpose: a kind of automatic control system for intravenous drip, comprise photoemission, receive converter amplifier circuit, microprocessor, motor and drive circuit and flexible pipe clamp mechanism, it is characterized in that: at photoemission, receive between converter amplifier circuit and the microprocessor and be provided with the comparison shaping circuit, relatively the output of shaping circuit connects an external interrupt of microprocessor, microprocessor is provided with the interruption subroutine of first pulse signal that receives only each dropping liquid and is provided with according to detecting to drip speed and set and drips the nonlinear regression adjustment algorithm that fast gap size is determined micro-step motor adjustment step number, the pulse output of microprocessor connects the micro-step motor drive circuit, the output control flexible pipe clamp mechanism of micro-step motor.
Interruption subroutine comprises the steps:
Whether a, cycle detection external interrupt have pulse signal, if then execution in step b is arranged;
B, close external interrupt, pick up counting, set time-delay;
C, if the time-delay arrive, then open external interrupt;
Whether d, cycle detection external interrupt have pulse signal, if then execution in step e is arranged;
E, timing finish, and calculate to drip speed.
The nonlinear regression adjustment algorithm that the definite micro-step motor that is provided with in the microprocessor is adjusted step number comprises the steps:
A, detection liquid droping speed;
Whether b, comparison detected value equate with setting value, then return step a cycle detection liquid droping speed as if equating, otherwise execution in step c;
C, poor according to detected value and setting value are calculated the adjustment step number of micro-step motor forward or reverse;
D, according to the value of calculation of step c, microprocessor sends continuously to the micro-step motor drive circuit and makes the micro-step motor forward or reverse adjust the corresponding umber of pulse of step number, changes step a then;
Adopt technique scheme, and in conjunction with the following embodiment that will describe in detail, particularly to the in-depth analysis of dropping liquid " bimodal " phenomenon, the technological progress that the present invention gives prominence to is: 1, found " bimodal " phenomenon, and interruption subroutine is set dexterously in microprocessor, shield the interference of bimodal and other burr with a kind of method of software, microprocessor receives only first pulse signal of each dropping liquid, shield other interfering signal, treat after the disturbing pulse of bimodal or burr, opens interrupters prepares to receive the pulse of next dropping liquid signal again, has guaranteed an accuracy that speed detects.2, adopt comparison circuit,, effectively remove near the burr of zero level and disturb by reasonable setting comparative level.Become pulse signal through the signal after the shaping, eliminated the interferential maloperation of microprocessor Yin Maoci.3, because the nonlinear regression adjustment algorithm that micro-step motor is adjusted step number is set in microprocessor, can be according to the difference size of detected value and setting value, determine that flexibly microprocessor sends the umber of pulse that forward or reverse is adjusted step number to micro-step motor, multiple pulse when difference is big, difference hour is sent out pulse less, overcome servomotor and dripped speed and dripping under the bigger situation of fast difference of setting in advance in initial reality, the time that needs are long just can be adjusted to and set the shortcoming of dripping speed, both guarantee precision, shortened the time of adjusting to the right place again.Show that through actual detected the present invention can adjust to the right place within 1 minute, make vein dropping liquid automatic control system reliable operation, easy to use, precision is higher.
Below in conjunction with accompanying drawing, the present invention is further illustrated by embodiment:
Embodiment: in conjunction with Fig. 1~Fig. 4, a kind of automatic control system for intravenous drip, comprise the infrared electro emission, receive converter amplifier circuit, microprocessor CPU, motor E and drive circuit and flexible pipe clamp mechanism, microprocessor CPU is connected to input keyboard KEY and display lcd.
The infrared light radiating circuit: by two infrared light emitting diode series connection D1, D2, Zener diode D3, adjustable resistance R1 forms.Adjustable resistance R1 adjusts the glow current size, and Zener diode makes under the situation that voltage Vo changes can keep stable glow current.Infrared is transmitted in another infrared receiving diode in horizontal slot by a horizontal slot, and the horizontal slot of transmitting terminal and the horizontal slot of receiving terminal are at grade.
Receive converter amplifier circuit: form by two infrared receiving diode D4, D5 series connection, resistance R 2, R3, R7 and homophase operational amplifier U1, infrared diode D4, D5 that pull-up resistor R7 connects in working power Vcc reception change-over circuit and the signal amplification circuit receive the light that emitting diode D1, D2 send, and convert optical signal to the signal of telecommunication.When drop drips, because most infrared lights are refracted, can not arrive reception diode D4, D5, make to produce a light pulse that light pulse becomes electric impulse signal Vo1 after this circuit conversion is amplified at receiving terminal.Otherwise, when dripless is dripped, diode D4, D5 conducting, Vo1 keeps low level.
Compare shaping circuit: be provided with the comparison shaping circuit between photoemission, reception converter amplifier circuit and microprocessor, on the one hand, because microprocessor can only be handled switching signal (0 and 1), the electric impulse signal after requirement will be amplified converts switching signal to; On the other hand, disturb because the induction coil of the scrambling of dropping liquid and servomotor and microprocessor can produce burr near zero level, the interference of burr is provided with the comparison shaping circuit near the zero level in order to have eliminated.Relatively shaping circuit is made up of an operational amplifier U2 and peripheral resistance R 4, R5, R6, by adjusting the standard of comparison voltage that R5, R6 adjust the end of oppisite phase input, pulse signal is imported by in-phase end, obtains by the switching signal Vo2 after the shaping at outfan.
" bimodal " phenomenon: when infrared light did not exceed dropping liquid, light directly enters receiving tube by narrow slit, and (Fig. 5 a), the photosignal amplitude was a constant; When dropping liquid drips when just entering crack,, and, make the infrared receiving tube that is placed in the slit not receive light (Fig. 5 b), and produce a zero level pulse just because refraction has changed the direction of Infrared because transparent dropping liquid to the absorption of infrared light seldom; But, in liquid decline process, direction that Infrared is propagated and liquid surface tangential direction are from changing to less than 90 degree greater than 90 degree, when the direction of Infrared and drop Surface Vertical, overwhelming majority light does not change direction, pass drop and arrive receiving tube (Fig. 5 c), the photosignal amplitude reaches constant again; When crack just will have been left in its upper surface of dropping liquid continuation decline, direction took place on the dropping liquid surface again and changes in the propagation of light, can not arrive receiving tube (Fig. 5 d), produces another zero level pulse signal.Therefore, corresponding dropping liquid, the photosignal that the actual reception pipe receives be two near pulse bimodal (shown in Figure 6), bimodal have two rising edges, causes timing uncertainty true.
The meter recording device of first pulse signal that receives only each dropping liquid must be set, and available hardware or software are realized.For saving cost, present embodiment adopts the method for microprocessor software shielding to realize.
The microprocessor setting receives only the interruption subroutine of first pulse signal of each dropping liquid: above-mentioned in order to eliminate " bimodal " phenomenon, microprocessor CPU is provided with the interruption subroutine (Fig. 3) of first pulse signal that receives only each dropping liquid: an external interrupt (INT0) that will compare the switching signal Vo2 input microprocessor after the shaping, because the existence and the various interferential existence of bimodal phenomenon, a dropping liquid may be to there being more than one pulse, but these pulse generations are at (diameter that approximates a dropping liquid divided by dropping liquid from the speed of " horse Fei Shi " pipe top freely falling body during to infrared observation window) within a few tens of milliseconds, and the interval between two dropping liquids can not be lower than 300 milliseconds (corresponding per minute is more than 180).Like this, when microprocessor receives a pulse signal by an external interrupt, enter interruption subroutine, pick up counting, and close interruption immediately, and make follow-up pulse can not produce interruption, delay time after 100 milliseconds, promptly wait for after the disturbing pulse of bimodal or burr, opens interrupters again prepares to receive the pulse of next dropping liquid signal, receive next pulse after, intervalometer stops to clock, and interval is got inverse and promptly drawn a speed.
In order both to guarantee precision, adjust a speed during postscript and put in place, the present invention is provided with the nonlinear regression adjustment algorithm of micro-step motor being adjusted step number in microprocessor, and this algorithm comprises the steps:
A, detection liquid droping speed;
Whether b, comparison detected value equate with setting value, if equal then backspace step a cycle detection liquid droping speed, otherwise execution in step c;
C, poor according to detected value and setting value are calculated the adjustment step number of micro-step motor forward or reverse;
D, according to the value of calculation of step c, microprocessor sends continuously to the micro-step motor drive circuit and makes the micro-step motor forward or reverse adjust the corresponding umber of pulse of step number, changes step a then;
In Fig. 4, the step number of each micro-step motor adjustment is divided into: 1, non-linear adjustment step numbers such as 4,16,32, when the speed of dripping that detection obtains is dripped speed when differing big with setting, microprocessor sends more umber of pulse continuously, makes the corresponding step number of miniature micro-step motor forward or reverse, when the speed of dripping that detection obtains is dripped speed and differed hour with setting, microprocessor sends less umber of pulse, makes the corresponding step number of miniature micro-step motor E forward or reverse.
Also can set other non-linear adjustment step number for as required.
The output control hose clip B grip both hose A of micro-step motor E.
The microprocessor that the present invention adopts can be selected the central processing unit of ATMEL 89 serial Flash single-chip microcomputer 89C51 as whole instrument for use.Because control signal is more, and microprocessor there is no need to connect external data, program storage, four P1, P2, P3, P4 mouths all are operated in the I/O mode, and when CPU did not work, CPU was in the power saving working method simultaneously, and was waken up by interrupt signal.
Display lcd is taked HJD802 ocra font ocr display module, 16*2 characters show.Include display buffer, inner display command, by P00~P07 of CPU, microprocessor will content displayed and order successor LCD display circuit.And have backlight, when any button was pressed, backlight began bright 10 seconds, so that use evening.
Keyboard KEY: following button is set on the keyboard KEY that is connected with microprocessor CPU: (1) START/PAUSE: allow machine start working/halt (2) MODE: model selection, the parameter that selection will be transferred (3) UP: parameter raises (4) DOWN: parameter downward modulation (5) RESET: (6) OPEN resets: open (7) CLOSE: close P10~P17 that these switches connect microprocessor CPU respectively.Microprocessor takes hunt mode to check the state of switch when work, and removes corresponding handling procedure according to detected state commentaries on classics.
The micro-step motor drive circuit takes special IC LS7407 to drive, and motor E selects micro-step motor for use, according to the type of drive of AB-BC-CD-DA.
In addition, present embodiment also is provided with working condition detection alarm device, and abnormal conditions are arranged as find instiling, as infusion channel stop up, adjustments do not put in place, dropping liquid is finished etc., passes through light, acoustic alarm immediately.