Disclosure of Invention
In view of the defects of the prior art, the invention aims to provide a limiting protection device and a limiting protection method for an X-ray machine, so as to solve the problem that the existing limiting protection CPU has a large occupancy rate.
In order to achieve the purpose, the invention adopts the following technical scheme:
a limiting protection device of an X-ray machine comprises a control module, a limiting protection module and a motor driving module;
the control module outputs corresponding limit trigger signals during normal work and limit protection; the limiting protection module judges whether to enable the motor according to the limiting trigger signal and controls the control module to output a control signal to the limiting protection module;
when a control signal is input, the limiting protection module converts the control signal into a driving pulse, and the motor driving module controls a corresponding motor to work according to the driving pulse; when no control signal is input, the limiting protection module controls the motor driving module to stop the corresponding motor.
In the X-ray machine limiting protection device, at least 1 motor is arranged, a limiting protection module at least comprises 1 protection unit, and a motor driving module at least comprises 1 driving unit; 1 protection unit controls 1 drive unit to drive 1 motor.
In the X-ray machine limit protection device, the control module comprises a CPU, a dial switch, a square wave generator and a limit identification unit;
the CPU judges whether to output an automatic control signal or not and whether to control the work of the generator or not according to the feedback signal of the limit protection module;
the dial switch is conducted in a manual mode, and a manual control signal output by the square wave generator is transmitted to the limiting protection module;
and the limit recognition unit outputs a corresponding limit trigger signal during normal work and limit protection.
In the X-ray machine limiting protection device, the protection unit comprises a 4-control optocoupler, a first resistor, a second resistor and a third resistor;
the 1 st pin of the 4-control optocoupler is connected with a power supply end; the 2 nd pin of the 4-control optocoupler is connected with the CPU of the control module through a first resistor and is also connected with one end of a dial switch of the control module through a second resistor; the 3 rd pin of the 4-control optocoupler is connected with one end of the limit identification unit, and the 4 th pin of the 4-control optocoupler is connected with the 5 th pin of the limit identification unit; the 6 th pin, the 11 th pin and the 13 th pin of the 4-control optocoupler are all grounded; the 7 th pin, the 8 th pin, the 9 th pin and the 10 th pin of the 4-control optocoupler are all suspended; the 12 th pin of the 4-control optocoupler is connected with the 15 th pin of the 4-control optocoupler, and the 14 th pin of the 4-control optocoupler is connected with the CPU; the 16 th pin of the 4-control optocoupler is connected with the input end of a corresponding driving unit in the motor driving module and is also connected with a power supply end through a third resistor.
In the X-ray machine limiting protection device, the protection unit further comprises a fourth resistor;
one end of the fourth resistor is connected with a No. 2 pin of the 4-control optocoupler, and the other end of the fourth resistor is connected with one end of the first resistor and one end of the second resistor.
In the X-ray machine limiting protection device, the protection unit further comprises a light emitting diode;
the positive pole of the light emitting diode is connected with the 4 th pin of the 4-control optocoupler, and the negative pole of the light emitting diode is connected with the 5 th pin of the 4-control optocoupler.
In the X-ray machine limiting protection device, the protection unit further comprises a fifth resistor;
one end of the fifth resistor is connected with a 6 th pin of the 4-control optocoupler, and the other end of the fifth resistor is grounded.
In the X-ray machine limiting protection device, the protection unit further comprises a sixth resistor;
one end of the sixth resistor is connected with the 14 th pin of the 4-control optocoupler, and the other end of the sixth resistor is connected with the CPU.
A limit protection method adopting the X-ray machine limit protection device comprises the following steps:
step A, a control module outputs a corresponding limit trigger signal during normal work and limit protection, and the control module outputs a corresponding limit trigger signal during normal work and limit protection;
b, the limit protection module judges whether to enable the motor according to the limit trigger signal and controls the control module to output a control signal to the limit protection module;
step C, when a control signal is input, the limiting protection module converts the control signal into a driving pulse, and the motor driving module controls a corresponding motor to work according to the driving pulse; when no control signal is input, the limiting protection module controls the motor driving module to stop the corresponding motor.
Compared with the prior art, the X-ray machine limiting protection device and the method thereof provided by the invention have the advantages that the control module outputs the corresponding limiting trigger signal during normal work and limiting protection; the limiting protection module judges whether to enable the motor according to the limiting trigger signal and controls the control module to output a control signal to the limiting protection module; when a control signal is input, the limiting protection module converts the control signal into a driving pulse, and the motor driving module controls a corresponding motor to work according to the driving pulse; when no control signal is input, the limiting protection module controls the motor driving module to stop the corresponding motor. The motor is closed by controlling the motor driving module to stop through the limit protection module, so that the occupancy rate of a CPU (central processing unit) can be reduced, the motor can be quickly closed, and the real-time performance of system response is improved; the problem of the current stop control signal after needing CPU response and close the motor and lead to CPU occupation rate great is solved.
Detailed Description
The invention provides a limiting protection device and a limiting protection method for an X-ray machine. Compared with the traditional CPU response mode, the method not only can reduce the occupancy rate of the CPU, but also can increase the real-time performance of system response; the circuit is simple to realize, stable in performance and good in real-time performance, and meets the requirements of clinical use. In order to make the objects, technical solutions and advantages of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, the limiting protection device for an X-ray machine provided by the invention is connected with at least 1 motor, and comprises a control module 10, a limiting protection module 20 and a motor driving module 30. The control module 10 outputs a corresponding limit trigger signal during normal work and limit protection; the limiting protection module judges whether to enable the motor according to the limiting trigger signal and controls the control module to output a control signal to the limiting protection module. When a control signal is input, the limiting protection module converts the control signal into a driving pulse, and the motor driving module controls the corresponding motor to work according to the driving pulse. When no control signal is input, the limiting protection module controls the motor driving module to stop the corresponding motor.
The method specifically comprises the following steps: when the control module 10 normally works, the control module outputs a high-level limit trigger signal; when the limit protection module detects a high level, the motor is judged to be enabled, and the control module is controlled to output an automatic control signal MA0 or a manual control signal MA 1; the limiting protection module converts the automatic control signal MA0 or the manual control signal MA1 into driving pulses with corresponding waveforms, and the motor driving module controls the corresponding motor to work according to the driving pulses.
During limit protection, the control module 10 outputs a low-level limit trigger signal; when the limit protection module detects a low level, the limit protection module judges that the motor does not need to be enabled, and controls the control module to stop outputting the automatic control signal MA0 or the manual control signal MA 1; and the limiting protection module directly outputs the continuous high-level driving pulse STATE _ OUT if no control signal is input, and the motor driving module generates a stop signal according to the high-level driving pulse STATE _ OUT to control the corresponding motor to stop working.
The process is continued in the working process of the X-ray machine movement system until the X-ray machine movement system stops working.
In this embodiment, the control module 10 includes a CPU 110, a dial switch 120, a square wave generator 130, and a limit recognition unit 140. The CPU 110 is connected with the square wave generator 130 and the limit protection module 20, one end of the dial switch 120 is connected with the limit protection module 20, and the other end of the dial switch 120 is connected with the output end of the square wave generator 130.
The limit recognition unit 140 uses a limit switch, determines whether the device is working normally or is protected in a limit mode according to the on-off state of the limit switch, and outputs a corresponding limit trigger signal. When the circuit works normally, the limit switch is conducted to output a high-level limit trigger signal SW. And during the limit protection, the limit switch cuts off the limit trigger signal SW of the output low level.
Wherein, the disconnection of the limit switch can be realized by a manual mode or an automatic mode. The control module 10 outputs the automatic control signal MA0 generated by the automatic mode and the manual control signal MA1 generated by the manual mode, respectively. The circuit of the limit switch (for example, one end of the limit switch outputs the limit trigger signal SW, the other end of the limit switch is connected to the power supply terminal VCC through the pull-up resistor, the control terminal of the limit switch is connected to the CPU 110 and the external key) is the prior art.
In the manual mode, a user manually presses a key to turn off the limit switch, and a low-level limit trigger signal SW is generated to limit. When the button is pressed, the dial switch 120 is turned on, and the manual control signal MA1 output by the square wave generator 130 is transmitted to the limit protection module 20.
In the automatic mode, when the CPU 110 detects that the fault needs limiting according to the feedback signal of the limiting protection module, the limiting switch is controlled to be turned off, and the low-level limiting trigger signal SW and the automatic control signal MA0 are output to the limiting protection module 20.
In the ac motor mode, the waveform of the automatic control signal MA 0/manual control signal MA1 is high or low level, and the motor driving module is equivalent to a frequency converter. In the dc motor mode, the automatic control signal MA 0/manual control signal MA1 are PWM waveforms, and the motor driving module corresponds to a motor driver.
In specific implementation, based on that the number of the motors is at least 1, the limiting protection module 20 at least includes 1 protection unit, and correspondingly, the motor driving module 30 at least includes 1 driving unit. 1 protection unit controls 1 drive unit to drive 1 motor. The input signals of each protection unit are the same and comprise a limit trigger signal SW, an automatic control signal MA0 and a manual control signal MA 1. Each protection unit outputs a driving pulse STATE _ OUT (converted by an automatic control signal MA0 or a manual control signal MA 1) to a corresponding driving unit, and each driving unit generates a driving signal according to the driving pulse STATE _ OUT to control the corresponding motor to work. The circuit structures of the protection units and the driving units are the same. The driving unit is prior art and will not be described in detail here.
Here, taking 1 protection unit as an example, the circuit structure of the protection unit is shown in fig. 2, and the protection unit includes 4 control optocouplers (i.e., 4 pairs of light emitting diodes and phototransistors, model TLP521-4 inside) U1, a first resistor R1, a second resistor R2 and a third resistor R3; the 1 st pin of the 4-control optocoupler U1 is connected with a power supply end VCC; the 2 nd pin of the 4-control optocoupler U1 is connected with the CPU 110 of the control module 10 through a first resistor R1 and is also connected with one end of a dial switch 120 of the control module 10 through a second resistor R2; the 3 rd pin of the 4-control optocoupler U1 is connected with one end of the limit switch (input limit trigger signal SW), and the 4 th pin of the 4-control optocoupler U1 is connected with the 5 th pin thereof; the 6 th pin, the 11 th pin and the 13 th pin of the 4-control optocoupler are all grounded; the 7 th pin, the 8 th pin, the 9 th pin and the 10 th pin of the 4-control optocoupler U1 are all suspended; the 12 th pin of the 4-control optocoupler U1 is connected with the 15 th pin thereof, and the 14 th pin of the 4-control optocoupler U1 is connected with the CPU; the 16 th pin of the 4-control optocoupler U1 is connected to the input end of the corresponding driving unit in the motor driving module 30, and is further connected to the power supply terminal VCC through a third resistor R3. The resistance values of the first resistor R1 and the second resistor R2 are 120R omega.
With continued reference to fig. 1 and fig. 2, the working principle of the limiting protection device is as follows:
when the photoelectric switch normally works, the limit switch is switched on to output a high-level limit trigger signal SW, the 3 rd pin, the 4 th pin, the 5 th pin and the 6 th pin of the 4-control optocoupler U1 are switched on, and the two middle light-emitting diodes emit light to enable the corresponding phototriodes to be switched on. The 14 th pin of the 4-control optocoupler U1 outputs a low-level feedback signal CPU _ bak to the CPU, so that the CPU recognizes that the CPU is in a normal working state at present, and outputs an automatic control signal MA0 or controls the square wave generator 130 to work and output a manual control signal MA 1. Meanwhile, the 15 th pin of the 4-control optocoupler U1 is grounded, and the automatic control signal MA0 or the manual control signal MA1 controls the light-emitting diode at the top to be turned on and off, so that the corresponding on-off of the top phototriode is realized, and a driving pulse STATE _ OUT with the same waveform as that of the automatic control signal MA0 or the manual control signal MA1 is generated at the 16 th pin. The driving unit generates a driving signal according to the driving pulse STATE _ OUT to control the corresponding motor to work (such as whether to rotate, the rotating speed, whether to rotate or not, and the like).
During limiting protection, the limiting switch is disconnected to output a low-level limiting trigger signal SW, so that the 3 rd pin, the 4 th pin, the 5 th pin and the 6 th pin of the 4-control optocoupler U1 are all grounded, and the two middle light-emitting diodes do not emit light to enable the corresponding phototriodes to be cut off. The 14 th pin of the 4-control optocoupler U1 is suspended, and no feedback signal CPU _ bak is sent to the CPU; the CPU recognizes that it is currently in the limit protection state, stops the output of the automatic control signal MA0, or controls the controller wave generator 130 to stop the operation to stop the output of the manual control signal MA 1. Meanwhile, the 15 th pin of the 4-control optocoupler U1 is suspended, and the 16 th pin pulls up to output a driving pulse STATE _ OUT with a continuous high level. The driving unit generates a stop signal according to the high-level driving pulse STATE _ OUT to control the corresponding motor to stop working.
And when the normal work is recovered from the limit protection, executing the normal work flow.
In a further embodiment, in order to avoid burning out the light emitting diode by the automatic control signal MA0 and the manual control signal MA1, the protection unit further includes a fourth resistor R4, one end of the fourth resistor R4 is connected to the 2 nd pin of the 4-control optical coupler U1, and the other end of the fourth resistor R4 is connected to one end of the first resistor R1 and one end of the second resistor R2. The fourth resistor R4 is combined with the first resistor R1 and the second resistor R2 respectively for current limiting.
In a further embodiment, in order to facilitate a user to know what state the user is currently in, the protection unit further includes a light emitting diode L1, an anode of the light emitting diode L1 is connected to the 4 th pin of the 4-control optocoupler U1, and a cathode of the light emitting diode L1 is connected to the 5 th pin of the 4-control optocoupler U1. When the LED lamp normally works, the high-level limiting trigger signal SW enables the No. 3 pin, the No. 4 pin, the No. 5 pin and the No. 6 pin of the 4-control optocoupler U1 to be conducted to form a circuit to the ground, and the LED L1 emits light. During limiting protection, the low-level limiting trigger signal SW enables the 3 rd pin, the 4 th pin, the 5 th pin and the 6 th pin of the 4-control optocoupler U1 to be grounded, and the light-emitting diode L1 does not emit light.
In a further embodiment, in order to avoid burning out the light emitting diode L1 due to excessive current, the protection unit further includes a fifth resistor R5 with a resistance of 5K Ω, one end of the fifth resistor R5 is connected to the 6 th pin of the 4-control optocoupler U1, and the other end of the fifth resistor R5 is grounded.
In a further embodiment, in order to avoid excessive CPU burning of the current of the feedback signal CPU _ bak, the protection unit further includes a sixth resistor R6 with a resistance value of 10K Ω, one end of the sixth resistor R6 is connected to the 14 th pin of the 4-control optocoupler U1, and the other end of the sixth resistor R6 is connected to the CPU.
Based on the above-mentioned X-ray machine limit protection device, the present invention further provides a limit protection method of the limit protection device, please refer to fig. 3, the limit protection method includes:
s100, outputting a corresponding limit trigger signal by a control module during normal work and limit protection, and outputting a corresponding limit trigger signal by the control module during normal work and limit protection;
s200, the limiting protection module judges whether to enable the motor according to the limiting trigger signal and controls the control module to output a control signal to the limiting protection module;
s300, when a control signal is input, the limiting protection module converts the control signal into a driving pulse, and the motor driving module controls a corresponding motor to work according to the driving pulse; when no control signal is input, the limiting protection module controls the motor driving module to stop the corresponding motor.
In summary, according to the X-ray machine limit protection apparatus and method of the present invention, during limit protection, the 4-control optical coupler directly outputs the high-level driving pulse STATE _ OUT to stop the motor, and the 4-control optical coupler notifies the CPU of the current STATE, and stops outputting the automatic control signal MA0 or the manual control signal MA 1. The prior art requires the CPU to stop the output of the automatic control signal MA0 or the manual control signal MA1 in response to the limit trigger signal SW to interrupt the driving signal, thereby stopping the motor. The CPU response needs to occupy certain resources and time, the motor cannot be directly stopped immediately, the motor still runs for a short time, and the phenomenon of flushing out of the track can occur. Compared with the prior art, the motor-driven exercise device has the advantages of high response speed, high stability and very simple circuit structure, saves the system cost, can completely meet the clinical application requirements on the exercise function, and has positive effect and important significance in improving the stability of medical appliance products.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.