Design of digital control constant current source system based on single chip microcomputer

Publisher:HeavenlyMelodyLatest update time:2016-03-17 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
A constant current source is a power supply device that can provide a constant current. With the development of science and technology, its use is becoming more and more extensive. It is widely used in the fields of nuclear logging, LED lighting, superconductivity, and modern communications. The ideal constant current source output is constant, but the actual output of the constant current source circuit will fluctuate due to factors such as the temperature performance of the load, the ripple size of the power supply, the control method of the adjustment, the stability of the microcontroller and related control circuits. In order to minimize the impact of these factors, this paper adopts stable and reliable circuits and closed-loop feedback control methods to improve the stability and controllability of the constant current source output.

1 Composition of constant current source system

The PIC microcontroller is used as the core control device in this paper. The block diagram of the constant current source system is shown in Figure 1, which is mainly composed of a microcontroller circuit module, an ADC circuit module, a DAC circuit module, a constant current source control drive and a current sampling circuit module. The system realizes simple human-computer communication through an LCD display and an independent keyboard; the LCD display displays the current value and some corresponding functions, and the keypad is used to realize the manual control of the constant current source output. The PIC microcontroller uses a general-purpose microcontroller model PIC 24HJ64GP504, which has complete functions, high performance and low cost. It is the preferred core control chip for small control systems. The system uses a microcontroller to convert the current control value and the set value into the output of the DAC through conversion, and the output is controlled by the constant current source drive circuit. After the output current is collected and amplified, it is sent to the ADC and fed back to the microcontroller control system. The output of the constant current source current is adjusted by compensation calculation in the microcontroller, thereby achieving the purpose of improving the output accuracy and stability.

a.jpg

2 Main circuit design of constant current source system

2.1 Constant current source circuit design

The principle structure diagram of the constant current source circuit is shown in Figure 2. The control of the constant current source current is mainly achieved by controlling the gate voltage of the power MOSFET tube. The single-chip microcomputer sends the digital value of the set or adjusted value to the DAC through the SPI bus to convert it into an analog signal, and then sends it to the constant current source control after the op amp follower and R4 and R3 voltage division, thereby realizing the regulation of the constant current source current. While controlling the constant current source current, the control system samples the current size back through the sampling resistor R5, and sends it to the ADC chip after amplification by the amplifier, thereby realizing the real-time monitoring of the output current by the single-chip microcomputer. When the monitored current is different from the set value, the output current will be adjusted through this closed-loop feedback link. When the load size is changed, the current output is basically not affected under this regulation. As shown in Figure 2, since the current and power of the constant current source are both large, if the same power supply is used as the main control circuit, it will affect the stability of the entire system. Therefore, an independent power supply is used. The power supply uses a 24 V power supply with a loop end, which makes the power supply of the control circuit and the constant current source independent of each other and does not affect each other.

b.jpg

2.2 PIC microcontroller and peripheral circuits

The PIC single-chip control system is the control core of the entire constant current source, which is mainly composed of a single-chip microcomputer, a crystal oscillator, a programming and debugging interface, and a filter capacitor. The minimum system circuit is shown in Figure 3. The MCU uses the PIC24HJ64GP504 single-chip microcomputer of PIC Company. This single-chip microcomputer is a low-power, high-performance 16-bit microcontroller with 64 k in-system programmable Flash memory, a crystal oscillator frequency of up to 40 MHz, 8 k bytes of RAM, 44 pins, and 5 16-bit timers/counters. At the same time, it has the advantages of low power consumption, small size, and mature technology.

c.jpg

2.3 ADC acquisition circuit design

The ADC acquisition input circuit is shown in Figure 4. In order to meet the sampling accuracy requirements, we choose the 12-bit ADC converter TLV2541 chip; this ADC is a high-performance, 12-bit, low-power, COMS serial ADC with single-channel input and output interface SPI bus. There are three control lines: chip select (CS), serial clock (SCLK) and serial data output line (SDO). These three lines are directly connected to the SPI peripheral port of the PIC microcontroller. The ADC reference uses REF3225 to provide a 2.5 V reference voltage, which has the characteristics of low drift and high precision. This series of reference chips is particularly suitable for data acquisition. When reading data, TLV2541 needs to ensure strict timing requirements and give enough conversion time.

d.jpg

2.4 DAC Control Circuit Design

The DAC control output circuit is shown in Figure 5. The DAC uses TI's TLV5618. DACS, SDO, and SCK are connected to the SPI interface of the microcontroller. The microcontroller sends data to the DAC through the SPI protocol port and performs adjustment control. The output of the DAC is amplified by the op amp and sent to the constant current source circuit to adjust the current of the constant current source. TLV5618 is a 12-bit DAC. The current step size of each bit of the DAC can reach 1/4096A, which is far lower than the required accuracy. TLV5618 needs to be connected to an external reference voltage. REF3212 is selected in this article to provide a reference voltage of 1.25 V for the DAC. Its output voltage range is twice the reference voltage multiplied by the programming value.

e.jpg

3 System Software Design

The software program flow chart of the control system is shown in Figure 6. After the system is powered on, the main program first completes the system initialization, including the setting of the working status of ADC, DAC, interrupt, timer/counter, etc., assigning initial values ​​to system variables, displaying the last set value, etc. Then scan the keyboard, obtain the key value, and determine whether the function key is pressed. Once pressed, the corresponding function module will be executed; otherwise, the corresponding output digital quantity is calculated according to the set value, correction and other parameters, and sent to DAC to realize closed-loop feedback control.

f.jpg

4 Circuit Test Results and Analysis

Instruments used in the test: digital multimeter, 5 V and 24 V DC power supplies. In order to compare the error between the measured value and the true value, we selected 10 values ​​between 0 A and 1 A for comparison, recorded the measured data and analyzed the error.

When the load is 10 Ω and the output current step is 10 mA, the comparison of the output current preset value, display value and test value is shown in Table 1.

g.jpg

The values ​​shown in Table 1 are the data collected by ADC after filtering, and the measured values ​​are the readings displayed by the multimeter. From the results in the table, it can be seen that the data after filtering is basically close to the current setting value, while there is a certain error between the multimeter measurement value and the program measurement value. This is mainly due to the error in the system measurement itself and the large ripple of the 24 V power supply used, which affects the multimeter reading. The program filters the ADC collected data to make its data more stable, but no matter which measurement value, its error with the setting value is within the required accuracy.

h.jpg
 

In order to better illustrate the performance of the constant current source system, the current values ​​of different loads with the same set value are tested in this paper, and the test data are shown in Table 2. The test results show that although the constant current source has a small error when the load changes, it can basically ensure that its current value remains constant.

5 Conclusion

This paper uses PIC24HJ64GP504 microcontroller as the core control device, and uses DAC, ADC, operational amplifier and high-power MOSFET tube to form a negative feedback system to complete the measurement and control of the current of the entire constant current source system. This closed-loop feedback control method enables the constant current source current to be quickly and timely adjusted, enhancing the controllability and stability of the system; at the same time, it is also convenient to set the constant current source current value in the range of 0 A to 1 A through the keyboard. Even if the load changes greatly, the system can adjust the output current in time to make the current constant. In addition, the system has a simple circuit, low cost, high reliability, and has a broad market prospect and application value.

Reference address:Design of digital control constant current source system based on single chip microcomputer

Previous article:System Design and Type Test of Single Chip Microcomputer Digital Timer
Next article:Design of DC motor servo system based on PWM module and CWG module

Recommended ReadingLatest update time:2024-11-16 14:49

Analysis of SNR Problems Caused by Jitter in High-Speed ​​ADCs
It is normal to expect performance to match the datasheet signal-to-noise ratio (SNR) values ​​when using a high-speed analog-to-digital converter (ADC). When testing the SNR of an ADC, you might connect a low-jitter clock device to the converter's clock input pins and apply a reasonably low-noise input signal. If y
[Analog Electronics]
Analysis of SNR Problems Caused by Jitter in High-Speed ​​ADCs
Optimizing PCB Layout for High-Speed ​​ADC Design
High-speed design is often overlooked or quite important. System board layout has become a major component of the design itself, so we must understand the mechanisms that affect the performance of high-speed signal link designs. Even though we are engineers, we are likely to “create” more trouble than we can ha
[Power Management]
Optimizing PCB Layout for High-Speed ​​ADC Design
S3C2440 ADC Detailed Explanation
The S3C2440 has eight channels of 10-bit ADC with a maximum conversion rate of 500KSPS at a 2.5MHz A/D converter clock. The A/D converter supports on-chip sample-and-hold functions and power-down mode operation.   Four of the eight channels are suitable for touch screen detection of resistive screens, and the other fo
[Microcontroller]
S3C2440 ADC Detailed Explanation
Proteus C51 simulation learning board 10——DAC
 Now that we have learned about ADC, there must be a device that can restore the signal, that is, convert the digital signal into an analog signal DAC (Digital-Analog Converter), whose idea is completely opposite to that of ADC. The 89C51 microcontroller does not have an internal integrated DAC, so a DAC conversion
[Microcontroller]
Proteus C51 simulation learning board 10——DAC
51 MCU DAC0832
      Schematic diagram:                 code show as below: //Program function: D/A conversion, D12 changes from off to on, the buzzer sounds once, then from on to off, the buzzer sounds once, and so on //Header file #include #include                        //Delay a mechanical cycle function header fil
[Microcontroller]
Behavioral Simulation of Pipeline ADC
Analog-to-digital converter (A/D converter) is a basic circuit widely used in various electronic systems. Its performance ultimately affects the performance of the designed system. A high-resolution, fast conversion speed, and superior performance analog-to-digital converter has always been the most challenging design
[Power Management]
Behavioral Simulation of Pipeline ADC
Detailed explanation of the conceptual differences between ADC accuracy and resolution
When talking to system designers who use analog-to-digital converters (ADCs), one of the questions I hear most often is: “Is your 16-bit ADC also 16 bits of accuracy?” The answer to this question depends on a basic understanding of the concepts of resolution and accuracy. Despite being two completely different con
[Power Management]
Detailed explanation of the conceptual differences between ADC accuracy and resolution
Design of multi-channel ADC system based on DSP and CPLD technology
Introduction --- With the application and development of modern electronic technology, the content of digital signal processing is becoming increasingly complex, and ADC is an inevitable process to achieve conversion from analog to digital. In response to this situation, a multi-channel ADC system design method is pr
[Analog Electronics]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号