The Application of PLC Control in Chinese Medicine Intelligent Dispensing System

The working process of the Chinese medicine intelligent dispensing system is: first, the prescriptions issued on the terminal computer are transmitted to the pharmacy dispensing main control computer through the hospital's internal LAN, and then the main control computer forms a dispensing instruction on the basis of querying the drug database and issues the dispensing The machine completes the dispensing process. At the same time, the main control computer displays the patient information on the liquid crystal display of the dispensing machine terminal, and drives the printer to output the comprehensive information of the prescription. Delivered to patients.

The control system of the traditional Chinese medicine intelligent dispensing system can be divided into an electromechanical control system and a host computer software control system. Its structural block diagram is shown in Figure 1.


1 Electromechanical control system

The electromechanical control system is a hierarchical distributed structure, which adopts the technology of upper computer + lower computer + integrated circuit board for comprehensive control. The block diagram of its circuit system structure is shown in Figure 2. The specific introduction is as follows:


(1) The upper computer uses a PC and is responsible for the management of the control level and the monitoring and dispatching level. The reason why the upper computer does not use the industrial control computer is because the system has higher requirements for the interface, database processing, and network contact. The main purpose of the upper computer The function is to transmit the binary coded information input by the human-machine interface to the lower computer through the RS-232 serial port, and monitor the working status of the lower computer in real time, complete the prescription printing and LCD display. In addition, it is connected with the drug management information system. Information interaction is carried out through the local area network of the hospital and implemented by using TCP / IP protocol.

(2) The lower computer is responsible for device-level control. Its function is to receive and decode the binary dispensing information sent by the upper computer, then select the required medicine based on the dispensing information, drive the corresponding integrated circuit board to control the medicine, and drive the robot to position it. Medicines are packaged into bags and delivered to patients together with printing prescriptions. One of the reasons why the lower computer uses PLC and does not choose a relatively low-cost single-chip microcomputer is to meet the high-speed operation requirements of traditional Chinese medicine dispensing machines. X-axis guide rails and Y-axis guide rails All are driven by servo motors, and the control ability of the single chip microcomputer to the servo motor is relatively poor, and it is difficult to achieve accurate control; the second reason is that the reliability of the traditional Chinese medicine intelligent dispensing system is very high, and the stability of the single chip microcomputer is compared with that of the PLC. It is worse and is susceptible to external electromagnetic interference.

(3) The control of the DC motor for dispensing medicine is completed by an integrated circuit board with the ACEX1KACEX1K chip of ALTERA as the core. The chip integrates the control written in VHDL language in the Max + plus II development system, counting and timing functions. The function of the circuit board is to receive the commands and the mass of medicines from the PLC, control the number of revolutions of the motor, and complete the prescribed weight of the medicine under the accuracy of 0.07g / revolution. Because this system uses up to 420 medicine DC motors Therefore, an integrated circuit board that can reduce the number of I / O points and PLC wiring is used. All the dispensing motors of this system are controlled by 28 integrated circuit boards separately, and the dispensing part controlled by each integrated circuit board is relatively independent. In this way, inspection and maintenance are not Limited by location, with high reliability and cost performance.

1.1 PLC control

1.1.1 PLC configuration

The PLC configuration of this system adopts C200HEC200HE PLC of OMRON company, and on the basis of it, a 16-point relay-type switch output module C200H-OC225, a 32-point transistor-type switch output module C200H-OD215, two 16-point switches are expanded. The input module C200H-ID212 and a four-axis position control module C200HE-NC413. The functions of each module are:

(1) The two input modules are used to receive the position feedback or action fault feedback of various contactors in the dispensing machine, and there are no special requirements for their configuration;

(2) The two output modules issue instructions to operate the dispensing machine. The relay-type switching output module has a large driving current but cannot be frequently operated, so it is used to control all solenoid valves and various DC motors and stepper motors; transistor type The switch output module is just the opposite, and its output is TTL level, which has the advantage of being able to interface with other integrated circuits. It is used to drive the integrated circuit to complete the medicine dispensing operation.

(3) The four-axis position control module is used to control two servo motors and three stepper motors that are independent of the four axes (X 、 Y 、 Z 、 U). Two servo motors are respectively configured on the X 、 Y axis. And the three stepper motors are all staggered due to the working time, and they are all arranged on the U axis. In addition, there are three left and right limit switches and three origin proximity switches on the X 、 Y axis, and one origin proximity switch on the Z axis. A total of 7 proximity switches are connected to C200HENC413. The module takes commands from the PLC memory with a response time of no more than 10ms, establishes a mapping relationship with the PLC memory data under a high-frequency pulse of 500kp / s, and completes positioning the servo motor by modifying the memory data The function of the position of the stepping motor and the feedback of the position of the servo motor and the stepping motor through the memory data.

1.1.2 Servo motor control circuit

In this system, two SMARTSTEP A servo systems of OMRON company are configured to complete the positioning operation on the X 、 Y axis. The specific control circuit is shown in FIG. 3. It includes a four-axis position control module C200HE-NC413 、 universal control cable R88A -CPU002S 、 Servo Drive R7D-AP04H 、 Servo Motor R7M-A40030-BS1 (for a keyed straight cylindrical motor with brake). In the figure, CN1 represents the servo drive, and CN2 represents the coaxial resolution with the servo motor is 2000 Pulse / revolution optical incremental encoder connector, it can complete the closed-loop control with position feedback and speed feedback from the drive to the servo motor. In the servo motor, M represents the motor itself, E represents the encoder, B represents the power Brake. Since the fixed pulse represents a fixed distance, when the servo motor receives several pulse commands from the control system, it can complete the predetermined positioning. In this system, the resolution of the motor is set to 5000 pulses / rev (0.072 degrees / Step), the ratio of the coaxial reducer connected to the servo motor is 3: 1, and the speed of the guide rail is 60mm / rev. Therefore, the speed of the servo motor is 20mm / 5000 pulses. The control principle of the 。servo motor control circuit is: the position control unit obtains various control signals from the device, and roughly calculates and maps to the four-axis position control module NC413 NC413 according to the distance between different medicine tanks and 20mm / 5000 pulse data. The pulse data in the; then output a high-speed pulse to the servo driver through the universal control cable, which drives the servo motor, so that it can automatically fine-tune the data according to error feedback, and finally achieve the purpose of accurate positioning.

1.1.3 Stepper motor control circuit The connection between the stepper motor driver and C200HE-NC413 is similar to the connection between the servo motor driver and C200HE-NC413 in Figure 3, and the connection between the stepper motor driver and the stepper motor is as follows As shown in Figure 4. The stepper motor in this system that controls the swing of the manipulator uses STONE's 86BYG250B, and the driver uses STONE's hybrid stepper motor driver SH20806CSH20806C; the two stepper motors that control the feeding and pushing of the bag use SANYO's 103H548103H548, the driver uses STEP's four-phase hybrid stepper motor subdivision driver ST4HB03XST4HB03X. The control type of the stepper motor is open loop control without position feedback function.The control method is based on the determination of the starting point and end point of the movement. The displacement or angle change is converted into the number of pulses with a resolution of 200 pulses / revolution (0.18 degrees / step), written into the memory location mapped in NC413NC413, so as to control the stepper motor to complete the positioning.


1.2 System working steps

There are various motors, limit sensors, positioning sensors and solenoid valves connected to the vacuum air pump in the system, which can complete the functions of emptying the medicine bag, opening the empty medicine bag and packaging, and transporting the medicine bag. The working sequence is shown in Figure 5.


1.3 PLC program realization

Use OMRON's programming software CX-Programmer to complete the ladder diagram, the program includes the following six modules:

(1) Initialization module, whose function is to initialize the memory unit of the PLC and perform the zeroing operation of the electrical part, the purpose is to prepare for the operation of the dispensing system to prevent irreparable damage to the system caused by misuse;

(2) Receiving module, its function is to receive the binary coded information (including the type of medicine, quantity, number of stickers, etc.) entered in the interface of the host computer, and store it in a pre-defined memory unit;

(3) The sending module, whose function is to convert the type of medicine, quantity, etc. into the position and rotation number of the DC motor for dispensing according to the methods defined in the database and servo motor structure, and send it to the integrated circuit board to complete the dispensing operation;

(4) Feedback module, its function is to receive the feedback signal from the DC motor of the integrated circuit board to stop the rotation (that is, the action of the medicine under the specified weight is completed);

(5) The control module, whose function is to drive the robot to complete the tasks of emptying the medicine bag, opening the empty medicine bag, positioning and collecting medicine after confirming that the medicine dispensing process is completed, and driving the medicine bag sealing device to trigger the DC motor to drive the belt to rotate , Send out medicines; (6) fault handling module, its function is to receive the proximity or fault signals from sensors everywhere, and stop the dispensing of the system at any time for fault handling.

In addition, the time connection is established in the sending module and the control module, so that in the process of multi-paste dispensing, the action of dispensing the next patch, emptying the pouch and the sealing action of the previous patch, the transmission action are performed in parallel, shortening Dispensing time.

2 PC software control system

The host computer software control system includes a drug information database and a human-machine dialogue interface. The former mainly stores hospital drug information, including name, quantity, price, drug properties, and expiration date, etc .; the latter establishes a connection with the database and enables querying and prescribing. Drug management, prescription management, printing, LCD display and other functions. The flow chart is shown in Figure 6.


2.1 Industrial Control Configuration Software FIX32

FIX32 is a large window-based application software developed by IntelluTIon of the United States, including dynamic display, alarm, trend, control strategy, control network communication and other components. In this system, FIX32 is used to write a dynamic simulation display program for the main interface and system operation 。

(1) The main interface is the connection bridge between the upper computer and the lower computer. Its function is to establish contact with the interface written by VB and activate the dispensing control interface and drug management interface.

(2) The way to realize the dynamic simulation display of the system operation is to first draw a simulation picture of the entire dispensing system in the DRAW mode of FIX32, including the display of static objects and various actions, set the limit and fault feedback alarm; then in FIX32 Configure the I / O points, and establish each medicine tank, each action I / O type and its address in the lower-level PLC in the database. In this way, when the program in the PLC starts to run, the simulation in the corresponding address The quantity or the switching value will change. This change can be displayed to the dynamic simulation interface at the same time as the dispensing system operates, so that the dynamic simulation can be synchronized. One of its functions can be taken from the dynamic simulation screen when the dispensing system is closed. Observe the operation of the system in real time. The second is to get a prompt when the system has a feedback failure, and quickly complete the adjustment of the failure.

2.2 Interface editing software VB

This part of the software includes two modules for taking medicine and adding medicine, both of which have permission control functions. The user needs to enter a password to ensure the security of the system. The VB interface frame diagram is shown in Figure 7.


The main task of the medicine retrieval module is to get in touch with the ACCESS database, pass the required medicine name, quantity, and number of stickers to the lower computer through FIX32 to complete the medicine retrieval operation. Among them, the name of the medicine in the database is pinyin query, quantity The number of stickers can be modified many times. At the same time, VB also needs to output patient and prescription information to the LCD screen and complete the prescription printing.

In the medicine retrieval module, the optimization algorithm of the medicine retrieval task is designed. Its purpose is to complete the shortest time dispensing process under the condition that the doctor prescribes the medicine in any order. Because the robot moves at a constant speed under the control of the X and Y axis servo motors The speed is 1m / s, so the shortest time is the shortest walking route. This problem is equivalent to the typical traveling salesman (TSP) problem. In this system, 420 medicine cans are divided into front and back sides with 14 rows of equal spacing, each One side is divided into 7 lines on the left and right sides, 15 in each line. In addition, the Y-axis coordinate of each unit of the medicine tank position is the same as the X-axis coordinate of the three units, and the robot's access to the front and back sides of the medicine is controlled by the swing of the stepper motor. After a simple calculation, it can be determined that the actual number of nodes in the system should be 66. The new tabu genetic algorithm is used to program in VB. This algorithm sets the tabu step and relaxation step for multi-node systems. The relaxation effect is introduced, which is similar to the traditional genetic algorithm. Ratio, reducing the feasible solution space and increasing the convergence speed.

The dosing module is dedicated to the drug administrator. The main task is to modify all the information of the drugs stored in the database from the interface.

There are many innovations in the control method of the traditional Chinese medicine intelligent dispensing system for quantitative allocation of bulk Chinese medicine. It has a good human-machine interface and can complete the dispensing of the prescribed prescription in a short enough time. The system has been approved by the Shanghai Science and Technology Commission. Expert appraisal has reached the domestic leading level and the international advanced level. The operation is in good condition, and the reliability and safety have been verified.

The Description of 3G Antenna

The 3G Antenna is a multiband Covert Omni Antenna that allows the use of multiple frequency bands with a single antenna. This high performance omni antenna works over the 2G, 3G, and 2.4 GHz WiFi frequency bands of 698 to 960 and 1710 to 2170 MHz. For use on 3G, GSM, GPRS, UMTS, CDMA, and TDMA services. 3G antenna is suitable for indoor and outdoor use and can be installed easily.

 It is compatible with all major carriers.


Advantages of Yetnorson Antennas

1. Rich experience and proven technique

2. Reasonable price

3. Wider frequency range  

4. OEM/ODM available

5. Professional service

6. ISO 9001 certified

7. One year guarantee

8. Fast delivery time

9. Independent R & D

10. Strong Capacity


3G Antenna

3G Antenna,Directional 3G Antenna,3G Indoor Antenna,3G Patch Antenna,Directional 3G Antenna,3G Indoor Antenna Wholesale from China

Shenzhen Yetnorson Technology Co., Ltd. , http://www.yetnorson.com

Posted on