Design of high-precision automatic weighing system based on CS5532

Publisher:脑力舞者Latest update time:2012-01-10 Keywords:CS5532 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

At the packaging site of granular products such as tea, medicine, monosodium glutamate, and sugar, accurate and easy-to-operate weighing devices and fast and reliable feeding mechanisms are needed. The single-chip microcomputer control technology can be used to design an automatic weighing system to achieve real-time weighing and quantitative delivery of materials, thereby overcoming the shortcomings of traditional mechanical weighing equipment such as low precision, complex operation, and manual feeding, which plays a key role in improving the overall packaging efficiency of the product. This article introduces the design of an automatic weighing system based on Crystal's high-precision 24-bit serial A/D converter CS5532. The vibration transmission mechanism composed of an electromagnetic vibrator and a dot matrix liquid crystal display module can achieve the purpose of simple, easy-to-use and automatic quantitative delivery.

1 System Principle

The system principle block diagram is shown in Figure 1. The weighing sensor and A/D converter are responsible for collecting real-time data of material weight; the bidirectional thyristor and electromagnetic vibrator provide power for the movement and feeding of materials; the zero-crossing detection circuit is responsible for detecting the zero-crossing point of the AC power and providing a synchronization point for the triggering of the thyristor; the LCD display and buttons facilitate the user's operation and observation; the gate motor and gate are used to release the material in the material trough that reaches the set weight.

First, the operator sets the weighing value, feeding speed, etc., and starts the system. Then, the electromagnetic vibrator vibrates regularly under the control of the single-chip microcomputer, and sends the material from the feeding channel to the material trough. At the same time, the A/D converter continuously detects the output of the weighing sensor, converts it into a digital quantity, and transmits it to the single-chip microcomputer for processing. After digital filtering and scale conversion, on the one hand, the instantaneous weight of the object is displayed on the LCD module, and on the other hand, the weighing comparison judgment is performed, and the amplitude of the electromagnetic vibrator is controlled according to a certain algorithm. When the set value is reached, the feeding is stopped, and the signal of the infrared sensor is detected, and the gate is opened to release the material, thereby realizing automatic weighing.

2 System Hardware Design

2.1 Sensors and Data Acquisition

The sensor used in this system is a high-precision NBA series aluminum alloy single-point weighing sensor from Taiwan Mavin Company, which is a resistive strain sensor. According to the principle of the resistive strain sensor, four strain gauges form a full-bridge circuit. When a constant DC voltage is applied to the power supply end of the bridge, the voltage at the output end of the bridge will be proportional to the pressure on it, so the weight can be measured according to the output voltage.
The sensor has a range of 3 kg, a sensitivity of 2 mV/V, and an accuracy of 0.02% F. S. When powered by a 5 V power supply, the full-scale output is 10 mV and the minimum resolution is 2 μV. In order to collect such a weak signal, it is necessary to design a good signal conditioning circuit and put forward strict requirements for the A/D converter. Figure 2 shows the interface circuit between the weighing sensor and CS5532. The output signal of the sensor passes through the filtering circuit to eliminate the series mode, common mode interference and high-frequency interference signals in the signal before entering the A/D converter.

In order to meet the small signal measurement accuracy requirements, the A/D converter CS5532 used in this system is a high-precision 24-bit serial A/D converter from Crystal. It is a highly integrated △-∑ analog/digital converter. Due to the use of charge balance technology, its performance can reach 24 bits. This series of ADC is very suitable for measuring single/bipolar small signals in application fields such as weighing instruments, process control, science and medical treatment.

There is an extremely low-noise chopper-stabilized instrumentation amplifier inside the chip, and its gain can be selected as 2n (n=0~6), which expands the signal input range, allows the input of small signals, and improves the dynamic characteristics of the system. Its common-mode rejection ratio at 50 Hz is typically up to 120 dB, which is very beneficial for detecting weak differential voltage signals from high common-mode voltages. There is also a 4th-order △-∑ modulator inside, followed by a digital filter, which can provide 10 optional output word rates. There is also a three-wire serial interface compatible with SPI inside the ADC. In addition, the calibration system inside the CS5532 (including self-calibration and system calibration) can be used to set the zero point and gain slope of the ADC transfer function, thereby eliminating the offset and gain errors of the system channel.

2.2 Mechanical structure and working principle of electromagnetic vibrator

As shown in Figure 3, the mechanical structure of the electromagnetic vibrator mainly includes armature, electromagnet and coil, leaf spring, feed trough and base, etc. The reciprocating motion of the feed trough is achieved by the generation and disappearance of the pulse attraction F between the electromagnet and armature of the electromagnetic vibrator.

As shown in Figure 4, by adjusting the control angle α of the bidirectional thyristor by phase-shift triggering, that is, adjusting the triggering moments t1 and t2 of the bidirectional thyristor, the average power supply voltage in the exciting coil can be changed, thereby changing the size of the attraction F between the electromagnet and the armature, thereby adjusting the amplitude of the reciprocating motion of the feed trough.

2.3 Zero-crossing detection circuit

In order to realize the phase-shift trigger control, a zero-crossing detection circuit is designed. As shown in Figure 5, after the AC power is stepped down, it passes through the voltage comparator LM393, the isolation of the optocoupler TLP521, and the shaping of the inverter 74HCl4D, and then the pulse signals for the external interrupts O and 1 of the single-chip microcomputer are output at INTO and INT1 respectively. In this way, a pulse signal can be generated in the positive and negative half-cycles of each cycle of the AC power to cause the external interrupt of the single-chip microcomputer. After the single-chip microcomputer enters the interrupt, the count value of the timer is set in the service program according to the need of the control angle, and the timer is started immediately. After the timer count overflows the interrupt, a trigger pulse will be applied to the gate of the bidirectional thyristor in its interrupt service to trigger its conduction.

2.4 LCD display module

This system uses ACM-12232G as the LCD display module and two SED1520 chips as display drivers. The SED1520 display driver is a dot-matrix LCD driver that can be directly connected to an 8-bit microcontroller and is easy to use. The SED1520 has a built-in 2,560-bit display RAM, 16 row drive ports and 61 column drive ports, and the drive duty cycle can be 1/16 or 1/32. The display RAM has a total of 32 rows, divided into 4 pages, with 8 rows per page.

3 System Software Design

3.1 Main program flow

When the system is started by pressing a button, it enters the running state. The system starts vibrating feeding, A/D sampling, digital filtering, scale conversion, and comparison and judgment. When the material reaches the set value SV, the system enters the pause state. At this time, it waits for the release signal (such as the infrared sensor switch signal). After releasing the material, the system automatically enters the running state and continues to feed. When there is insufficient material in the material trough and the system timing is up, it enters the manual state. At this time, it is necessary to manually press the button to release the insufficient material. When the system is in the stopped state, the changed parameters need to be saved regularly. The LCD refreshes the current status and various parameters in real time.

3.2 CS5532 analog/digital conversion program

CS5532 has a 20 ms delay when starting up, so it needs to be initialized 20 ms after it starts up. CS5532 does not have a power-on reset function. First, you need to manually send an initialization sequence through the ADC serial port, that is, 15 SYNCl (0xFF) command bytes and 1 SYNCO (0xFE) command byte, so that the ADC serial port enters the command mode; then reset the system by setting the RS bit of the configuration register. After the system is reset, you need to configure the voltage reference mode VRS bit, initialize the channel setting register (CSR), and set whether to perform calibration. After completing the above work, you can perform conversion. The CS5532 initialization process is shown in Figure 7.

CS5532 has two modes: single conversion and continuous conversion. This system uses continuous mode for A/D conversion. Once the continuous conversion command is sent, when the conversion is completed SDO=0, it is the same as single conversion, and 40 SCLKs are required to clear the flag and read the result. However, when the first 8 SCLKs are 0, the converter will continue to perform conversion on the selected channel with the same CSR in this conversion mode without sending the conversion command again. At the same time, the conversion results in this mode do not need to be read, and the unread conversion results will be replaced by new conversion results. To exit this mode, just make the first 8 SCLKs 1 and read the last conversion result.

As mentioned earlier, CS5532 has a variety of output word rates and amplification gains to choose from. Different combinations of word rates and gains will result in differences in its RMS noise, noise-free resolution, and internal digital filter characteristics. The appropriate combination should be selected according to the actual situation. In this system, CS5532 performs A/D conversion on channel 1. Select the continuous conversion mode, set the gain to 32, and set the FRS bit in the configuration register to 1, so that the word rate and the corresponding filter characteristics are multiplied by the coefficient 5/6. Select the word rate of 50Hz to help remove power frequency interference.

3.3 LCD display program

The driving of the LCD module is actually the read/write operation of its control chip SED1520. SED1520 is readable and writable, but only write commands are used in this system, so the R/W pin is directly grounded. SEDl520 has 13 instructions, including reset, duty cycle setting, display on/off required for initialization, and commonly used setting column address, setting page address, writing data, etc. The program flow of LCD display is shown in Figure 8. 4


Anti-interference design

In order to ensure the accuracy of A/D sampling, the anti-interference design of the system needs to pay attention to the circuit design of the A/D sampling module and the electromagnetic compatibility design. In terms of circuit design, in addition to designing a good signal conditioning circuit, it is also necessary to pay attention to the stability of the reference voltage of CS5532 and the power supply voltage of the weighing sensor. The stability of the voltage directly affects the accuracy of the A/D measurement value. This system uses a separate set of 5 V power supply to supply CS5532 and the weighing sensor. At the same time, the reference voltage of CS5532 is provided by the LM336-2.5 output to provide a stable 2.5 V; and the communication between CS5532 and the microcontroller is isolated by an optical coupler to further eliminate the influence of the microcontroller system on the sampling module.

In terms of electromagnetic compatibility, during the operation of the system, considering that the electromagnetic field generated by the electromagnetic vibrator coil will affect the A/D sampling, a shield should be added to the A/D sampling module for magnetic field shielding. Magnetic field shielding refers to suppressing the interference caused by magnetic field coupling between noise sources and sensitive equipment. Magnetic field shielding is to enclose the magnetic field lines in the shielding body, thereby preventing the internal magnetic field from spreading outward or the external magnetic field from interfering.


Conclusion

The high-precision 24-bit A/D conversion chip CS5532 can realize the acquisition and conversion of weak signals from sensors, improving the accuracy of the system; the single-chip microcomputer is used to control the conduction of the bidirectional thyristor, thereby controlling the vibration of the electromagnetic vibrator and realizing the automatic transportation of materials; the liquid crystal display is used as the display interface to achieve a good human-machine operation interface. This system realizes the functions of quantitative weighing and automatic feeding, with a simple hardware structure, easy operation and strong versatility. It is applied to actual products, improves work efficiency, reflects good technical effects, and has good application prospects.

The main program flow is shown in Figure 6. When the system is powered on and the microcontroller, peripheral chips, and various parameters are initialized, the main loop is entered. In the main loop, timer 1 regularly scans the keyboard. When a key is pressed, a flag is generated, and the key value calculation is entered and the corresponding processing is performed.

Keywords:CS5532 Reference address:Design of high-precision automatic weighing system based on CS5532

Previous article:TPMS system design based on NPXI intelligent sensor
Next article:Improving the resolution of LPC2138 analog-to-digital converter using gradient averaging

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号