This design uses a single-chip microcomputer as the main control component, presets the output current value through the keyboard and uses a liquid crystal module for real-time display. The entire system hardware consists of a microcontroller module, a voltage-current conversion module, a keyboard module, a display module, a DC regulated power supply module, and a voice prompt module. The system structure block diagram is shown in Figure 1.
A
Figure 1 Digitally controlled DC current source system
The microcontroller is the core of the whole system and is responsible for the operation of the whole system. In order to make the hardware circuit simple, the system performance stable and reliable, and to facilitate the coordination of functions such as voice broadcast, keyboard setting and real-time information display, after multiple schemes were demonstrated, the Lingyang 16-bit single-chip microcomputer SPCE061A was selected. The single-chip microcomputer is designed using modern electronic technology - system on a chip SOC (system on a chip) technology, and has integrated ADC, DAC, PLL, AGC, DTMF, LCD-DRIVER and other circuits (related to the IC model). It uses a reduced instruction set (RISC), and the instruction cycle is in units of CPU clocks. In addition, it also has DSP chip functions, built-in 16-bit hardware multipliers and adders, and is equipped with special instructions owned by DSP, which greatly accelerates the running speed of various algorithms. At the same time, the Lingyang 16-bit single-chip microcomputer application development tool can be used in the Windows environment. The tool supports standard C language and Lingyang single-chip microcomputer assembly language, integrating assembly, programming, simulation and other functions, greatly accelerating the software development process. Lingyang's single-chip microcomputer has the characteristics of high speed, low price, reliability, practicality, small size and low power consumption. It is more suitable to use this single-chip microcomputer as a controller. It is easy to realize A/D, D/A conversion, voice prompts, PID calculation and other functions under the premise of simple hardware circuit.
The main function of the display module is to display the set current output value and other human-computer interaction information. This part can use a seven-segment digital LED display to display information such as numbers, simple letters and decimal points, but because its display information is single and the human-computer interaction is not friendly, the character LCD display LCDSMC1602A module is used in the system. This module has the advantages of being light, thin, short, low-voltage, low-power, small size, no radiation hazard, flat right-angle display and stable image without flickering. It is convenient to use to display information such as letters, numbers, symbols, etc., and does not require the expansion of too many peripheral circuits. It can be directly controlled by the single-chip microcomputer for output display.
The voltage-current conversion module is composed of a precision op amp and a Darlington circuit composed of three transistors. The conversion circuit uses the flat output characteristics of the transistor and the deep negative feedback circuit to stabilize the output current. As shown in Figure 2, this V/I conversion circuit has a strong load capacity and a current output range of 0 to 3A. The output current Io obtains a feedback voltage Vf through the feedback resistor RF, Vf= V11-V12, which is added to the two input terminals of the operational amplifier through R5 and R6. Assume that the voltages at both ends of the op amp are V1 and V2, and Vi is output by the microcontroller DAC. Because the input current of the ideal op amp is approximately zero, and V1=V2, then V12[1-R6/(R2+R6)]+ViR6/(R2+R6)=V11R1(R1+R6). Since V12 = V11-Vf, then V11R2/(R2+R6)+(ViR6-VfR2)/(R2+R6)=V11R1/(R1+R5). Let R1=R2=10kΩ, R5=R6=1kΩ, then Vf=ViR6/R2=Vi/10. If feedback is not considered for the time being, Io=Vi/(10Rf).
Figure 2 V/I conversion circuit diagram
It can be seen that the calibration of the output current is determined by the output voltage Vi and Rf of the D/A conversion, which is a linear conversion. Rf is made of large-diameter constantan wire, and its temperature coefficient is very small (5×10-6/℃). The large wire diameter can minimize its temperature influence. The three triodes should use high-power tubes TIP122, and use heat sinks to ensure that the tubes work in the linear region.
There is another scheme for the composition of the voltage-current conversion module, which uses three operational amplifiers to form a current source with variable output current, as shown in Figure 3. The output current I=Vi/R1. In order to keep the voltage across R1 constant, the differential amplifier IC1b monitors the potential across R1 through the emitter follower IC1c. This potential is added to the inverting input of the comparator ICa through the 7th pin of IC1b and compared with Vref. The comparison result changes the output of the comparator until it is balanced, that is, Vr1=Vi. The capacitor in the circuit is used to compensate the frequency of ICa and reduce the delay of the control loop. As long as R1=R2=R3=R4=R5, the performance of this circuit is good. However, the load capacity of this circuit is not strong, and the loop delay compensation has a great influence on the stability of the circuit.
Figure 3 Three op amp V/I conversion circuit
The system keyboard module can be connected in an independent or row-column (matrix) manner. The function of this module is mainly to complete the setting of output current and other information. The DC regulated power supply module supplies power to the entire system; the voice module implements voice prompts, making the system design more humane and the system has a friendly working interface. The Lingyang microcontroller integrates ADC, DAC, PLL, AGC, DTMF and other modules. The voice function can be realized by software programming without any external circuit, which effectively utilizes system resources.
System operation and software process
During operation, the SPCE061A MCU converts the preset current value through D/A conversion, drives the V/I conversion circuit with the output voltage to realize the circuit output, and inputs the voltage value corresponding to the current value into the MCU system through the closed loop after A/D conversion, and then adjusts the current output through the PID algorithm. The whole system workflow is shown in Figure 4.
Figure 4 System workflow diagram
Figure 5 Main program flow chart
The A/D conversion part of the program is mainly used to convert the analog voltage signal sampled by the sampling resistor into a digital signal. The sampling signal is input by IoA6 and directly sent to the buffer P_ADC_MUX_Data. After the ADC automatic mode is enabled, a start signal will be generated. At this time, RDY=0, and the voltage analog quantity of DAC0 is compared with the external sampling analog quantity to find out the digital quantity of the external signal analog quantity as soon as possible. The result of A/D conversion is saved in SAR. When the 10-bit A/D conversion is completed, RDY=1. At this time, the 10-bit A/D conversion data can be obtained by reading the P_ADC_MUX_Data unit. The flowchart of its IRQ1 interrupt service program is shown in Figure 6.
Figure 6 Flowchart of IRQ1 interrupt service routine
The PID algorithm program is mainly used to correct the deviation between the actual output current value and the set value, adjust the next output value, make the output closer to the set value, and improve the accuracy. The specific control process is that the microcontroller reads the actual current Ik through the A/D chip, and then compares it with the set current Is to obtain the deviation value Ek=Is-Ik. The microcontroller calls the PID formula according to the size of Ek, calculates the increment Δik of this current regulation, and then calculates the output Iq of this current according to the output current Iq-1 after the previous D/A conversion.
The calculation formula of discrete incremental PID is:
ΔIk=Kp[(Ek-Ek-1)+K1Ek+KD(Ek-2Ek-1+Ek-2)]
=Kp(Ek-Ek-1)+K1'Ek +KD'(Ek-2Ek-1+Ek-2)
Where, K1'= Kp.K1, KD'= Kp×KD, Ek is the current error at this sampling moment, Ek-1 is the current error of the last sampling, and Ek-2 is the current error value of the next sampling.
In order to test the accuracy and reliability of the system operation, the set amount was tested and compared with the feedback amount. The error was within 0.01%, and the operation was stable, achieving the expected purpose and adding a unique audio playback design.
Previous article:How to Design Reliable Power Line Communications
Next article:Design of multi-channel switching power supply based on TOP247Y
Recommended ReadingLatest update time:2024-11-16 22:20
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Constraint and Delay Analysis
- EEWORLD University ---- IC front-end design
- Last 3 days: Apply for EC-01F-Kit, the official website of Essence, for free.
- Have you ever thought about the issue of program efficiency?
- Anyone who has used Eagle, please help me convert Eagle files into PADs files, thank you
- MSP430 learning PS2 keyboard control program
- Suddenly I found that CH579 is too powerful. I plan to make a product using CH579. Has anyone made a product using this chip?
- FPGA_100 Days_Real-time Clock Design
- Since HIT's MATLAB can be banned, IAR, keil mdk, and stm ide may also be banned. What should I do?
- The difference between DSP and other processors