Comprehensive Test Instrument for Electronic Ballasts Based on MSP430F133
2026-04-06 05:57:42··#1
Introduction Electronic energy-saving lamps are products that have entered thousands of households. Improving their quality is of great significance for promoting energy conservation in modern construction, and for manufacturing enterprises, it is an essential way to enhance product competitiveness. The main principle of energy saving in electronic energy-saving lamps is to replace the propagating inductive ballast with an electronic ballast. The most important thing to improve the quality of electronic energy-saving lamps is to ensure the quality of the electronic ballast. Our school was commissioned by enterprises to develop this comprehensive testing instrument for analysis in the production process and to test the performance of electronic ballasts. [b]1 Main Test Items of Electronic Ballasts[/b] The principle of electronic ballasts can be simplified as shown in Figure 1. The main indicators affecting the performance of electronic ballasts are: the preheating lamp voltage, preheating filament current and preheating time during the start-up stage, and the lamp voltage, lamp current, filament current, oscillation frequency, input current, input power and power factor after stabilization. For this purpose, sensors must be placed to collect data such as lamp voltage, filament current, cathode circuit and oscillation frequency at the output end, and power, current and power factor at the input end. Then, the collected data are analyzed and calculated to obtain the various performance indicators of the electronic ballast. 2. Overall Design Concept of the Tester Figure 2 shows the overall block diagram of the tester. This tester consists of two parts: a computer and an embedded tester. The embedded tester collects and analyzes various data, then uploads them to the computer via RS232 serial port, where the test results are displayed and saved. The embedded tester uses the MSP430F133 as its core. The MSP430F133 is a low-power 16-bit mixed-signal microcontroller manufactured by TI, with a maximum processing power of 8 MIPS. It has 8KB of Flash memory and 256 bytes of RAM, two 16-bit counters and one watchdog timer, one serial communication interface, and a 12-bit ADC module with a maximum conversion speed of 200 ksps. The MSP430F133 microcontroller is very suitable for the design requirements of this tester, offering excellent cost-effectiveness. For example, its rich internal peripheral resources greatly simplify the hardware design of this tester. The oscillation frequency of electronic ballasts is generally around 40kHz. During startup, the lamp voltage (peak-to-peak) typically exceeds 1000V, while after stabilization, the lamp voltage (RMS) is less than 100V. It is characterized by high frequency, high voltage, and large fluctuations. Therefore, the design of the signal acquisition circuit is the key and challenging aspect of this tester design. [b]3 Design of Main Functional Modules[/b] 3.1 Hardware Design for Lamp Voltage and Operating Frequency Signal Acquisition The lamp voltage (RMS) test range of the tester is 0-500V. To be compatible with the signal conversion and ADC circuit, the lamp voltage signal must be attenuated to 0-2.5V, i.e., a 200:1 voltage division attenuation. Through in-depth research and examples of the distributed inductance and capacitance characteristics of various resistive devices, it was found that the 3386 single-turn glass enamel potentiometer has extremely small distributed inductance and capacitance. Using it to construct a 4MΩ:20KΩ (voltage division ratio of 200:1) voltage divider sampling circuit, the nonlinearity and distortion of the obtained voltage division signal are both less than 1%, fully meeting the accuracy requirements of the testing instrument. The frequency and amplitude of the lamp voltage signal output by the electronic ballast are extremely unstable, changing significantly with the heating of the lamp and components. Typically, the frequency and voltage signal envelope are modulated by the power grid's frequency signal. Using conventional peak or average value detection circuits to test the effective value of the lamp voltage will result in significant errors. Therefore, the AD637 dedicated integrated circuit for true RMS measurement is used to convert the chaotic lamp voltage signal into the corresponding effective DC voltage, which is then sent to the ADC converter inside the MSP430F133. The frequency measurement circuit in the tester sends the attenuated sampled lamp voltage signal to a comparator with hysteresis characteristics composed of LM393, which shapes the AC signal into a pulse signal, and then sends it to the counter input pin of MSP430F133. The frequency measurement is realized by the internal counter of MSP430F133. The specific implementation circuit is shown in Figure 3. 3.2 Hardware Design for Filament Current and Lamp Current Acquisition The selection of current sensor is limited by many factors. The filament current reaches several hundred mA during the preheating stage, but is only tens of mA during normal operation; the filament resistance has various specifications, ranging from a few Ω to tens of Ω; the waveform is chaotic, with a frequency of about 40KHz. Both the frequency and amplitude are modulated by the power grid frequency signal. Therefore, the current sampling circuit uses conventional sampling resistor sampling or coil induction sampling design, which has problems such as narrow bandwidth, nonlinearity and severe distortion, affecting the working state of the electronic ballast, and cannot meet the requirements of the tester. Therefore, a closed-loop Hall current sensor was selected as the current sensor for the tester. The magnetic flux in the core of the closed-loop Hall current sensor is almost zero, so the insertion loss is very small and has almost no impact on the circuit under test. It can measure currents of various waveforms from DC to 100kHz. In addition, it is physically isolated from the object being measured. The working principle of the closed-loop Hall current sensor is shown in Figure 4. If a magnetic field passes through the Hall element, a voltage output is generated. This voltage is amplified and converted into a current output to the compensation coil. The compensation coil generates a magnetic field opposite to the direction of the measured current. Through dynamic feedback, the magnetic flux in the core becomes 0. At this time, I1×N1=I2×N2, that is, I1=I2(N2/I1)=(Uo/Rs)(N2/I1). In the formula, I1 is the measured current, N1 is the number of turns of its corresponding primary winding; I2 is the current in the compensation coil, N2 is the number of turns in the compensation coil; Uo is the voltage drop generated by I2 flowing through the sampling resistor Rs. From the above formula, it can be seen that when the magnetic field is balanced, the measured current can be calculated by measuring Uo. After testing, the closed-loop Hall current sensor fully meets the requirements of the current sampling of the tester, ensuring the high accuracy of the current measurement of the tester. The effective value conversion circuit is shown in Figure 5, which is the same as the voltage channel. 3.3 Design of Current, Power, and Power Factor Acquisition Module The PF9805 intelligent power meter produced by Yuanfang Company is used to measure the input current, input power, and power factor. The PF9805 power meter has an RS232 interface. The purpose of this tester is to use its interface to read input current and other data in a timely manner. Since the MSP430F133 only has one serial communication interface, but needs to communicate with both the PF9805 power meter and the PC, a serial communication switching circuit as shown in Figure 6 was designed after careful analysis of the working timing, achieving serial port expansion at a very low cost. [b]4 Software Design[/b] 4.1 Lower-Level Software Design The software design of this tester needs to sequentially acquire corresponding voltage, current, and frequency data according to the working timing of the electronic ballast, analyze and process the acquired data to obtain various test results, and finally upload the test results to the computer. Figure 7 shows the program flow in the MSP430F133. From a communication perspective, the microcontroller is the host, and communication with the PC and the PF9805 power tester can only be initiated by it to avoid serial port conflicts. Before the lamp is lit, the lamp voltage continuously increases; after lighting, the lamp voltage drops rapidly. Based on this characteristic, the program continuously monitors the lamp voltage. When an inflection point occurs and the voltage drops to 20% of the maximum voltage (adjustable), the preheating is considered complete and the lamp is lit. Preheating lamp voltage: After the ballast is powered on, the lamp voltage is continuously monitored and the maximum value is recorded until the preheating stage ends. This maximum value is the preheating lamp voltage. Preheating filament current: After the ballast is powered on, the filament current is continuously monitored and the maximum value is recorded until the preheating stage ends. This maximum value is the preheating filament current. Preheating time: The timer starts from when the ballast is powered on and stops at the end of the preheating stage; the recorded time is the preheating time. After warm-up, a 10-second delay (adjustable) is allowed to indicate stability. Various stability indicators are then tested. It's important to note that voltage, current, and frequency are all functions of the 50Hz power frequency. Therefore, all tests are averaged over periods of 20ms to minimize errors caused by power frequency signal modulation. 4.2 Host Computer Software Design The computer software is written in Delphi 7 and primarily performs three functions: communication with the tester, parameter setting, and test data display and saving. Communication with the tester involves three defined commands: requesting parameter loading, loading parameters, and returning test results. The baud rate is agreed to be 19200bps. The computer acts as a slave, normally in receiving mode, only sending setting parameters to the tester upon receiving a parameter loading request. The communication software flowchart is shown in Figure 8. **5. Summary** This tester cleverly utilizes a glass glaze potentiometer to construct a voltage divider sampling circuit; it employs a novel closed-loop Hall current sensor sampling circuit and the AD637 high-performance true RMS converter chip to transform voltage and current signals rich in harmonics. The MSP430F133, a novel 16-bit low-power mixed-signal microcontroller, is selected as the main processor, maximizing the use of its on-chip ADC, UART, Flash, and Timer resources. From the actual completed product design, it features high accuracy, low cost, and ease of use, fully meeting the requirements for performance analysis and monitoring of electronic ballasts during production. With the introduction of calibration and compensation processes in the software, this tester can also be used for analysis and testing in electronic ballast research and development. Editor: He Shiping