10269 views|3 replies

1

Posts

0

Resources
The OP

DC Motor Control System [Copy link]

This post was last edited by IFY on 2020-8-13 09:59

summary

This design uses the STM32F407ZGT6 microcontroller as the control core, uses the BOOST boost circuit to generate the power required by the motor, uses the auxiliary power supply to power the microcontroller and other modules, uses the H- bridge to drive the motor, and uses precision resistors to perform high-end sampling of the output current of the boost module to achieve the design of a DC motor control detection system. This design provides a stable +15V power supply for the motor and a 5V stable power supply for other modules; it controls the motor movement by two methods: motor drive, encoder, and current feedback; the signal is conditioned and sampled by the internal AD of the microcontroller , which can detect the motor current and transmit it to the PC for display via the WIFI module .

After the final cascading and debugging, this system has realized some of the functions required by the topic and met the requirements of the topic.

Keywords: boost ; H- bridge driver; AD sampling

1. System Solution

1. Analysis and comparison of solutions

1 ) Power module solution selection

Solution 1: Using an integrated switching power supply chip

Integrated Boost power chips such as TL3579 and LM25118 only need to add external resistors and capacitors to achieve voltage boost. The solution is simple, but the heat dissipation of integrated chips is generally lower than that of separate components, so they are not suitable for occasions with relatively large current requirements.

Solution 2: Use Boost circuit.

It adopts the Boost switch structure, using resistors and capacitors, switch transistors ( MOS , BJT , etc.), PWM driver chips and PWM generation components. The structure is relatively complex, but due to the good heat dissipation, it is more suitable for applications that require 3A current.

To sum up, choose option 2.

2 ) H -bridge drive solution selection

Solution 1: Using H -bridge driver chip

The H -bridge driver chip L928N integrates two H - bridge circuits and also has PWM control and current acquisition, but requires the motor drive voltage to be 2.5V higher than the control logic voltage , and the power loss of this solution in the H -bridge circuit is too large.

Solution 2: MOS tube bridge

MOS tube bridge driving efficiency is the highest, and the structure is not very complicated, but if the timing is incorrect, it is easy to cause the bridge to be directly connected and burn the MOS tube. You need to pay attention to this when using it.

To sum up, choose option 2.

3 ) AD sampling module solution selection

Solution 1: Use ADS122C04 for sampling. ADS122C04 is a 24- bit precision analog-to-digital converter that uses integration, high precision, and small data acquisition error. Disadvantages: The circuit is complex to make and the cost is high.

Solution 2: Use the internal AD sampling of the microcontroller. The AD of STM32F4 is a 12 -bit successive approximation analog-to-digital converter, and the maximum conversion rate of ADC is 2.4MHz . It can meet the accuracy requirements in the question, does not require external circuits, has low cost, and simple circuits.

To sum up, choose option 2.

4 ) Current detection method selection

Solution 1: Use Hall sensor. The output characteristic is linear in the entire working area, the power consumption is small, the measurement frequency band is wide, and it is extremely convenient and reliable to use. Disadvantages: high cost, high technical content, and large space volume occupied by the circuit board of the drive system.

Solution 2: Use high-end sampling with resistors. The resistor itself has a very small inductance and excellent frequency response characteristics. In addition to being widely used in AC and DC circuits, it can also be used in medium and high frequency circuits. The volt-ampere characteristic is linear and the temperature characteristic is good, which meets the accuracy requirements of this experiment. It is simple to make and has an absolute price advantage.

To sum up, choose option 2.

2. System overall design

This design uses the buck module to power the STM32F407ZGT6 microcontroller and the current detection circuit, and the boost module to power the motor drive module. The microcontroller uses feedback to control the output of the boost circuit, and selects the motor control mode as the encoder speed feedback mode or the current feedback mode to control the movement of the object through the screen buttons. The WIFI module is used to send the data of the current detection module and the speed detection module to the PC , and the data is displayed on the screen. The overall block diagram of the system is shown in Figure 1 .

Figure 1 System structure diagram

2. Theoretical Analysis and Calculation

1. Theoretical analysis and calculation of power supply boost

Figure 2 Power supply boost theoretical analysis model diagram

The theoretical analysis model of power boost is shown in Figure 2. The boost circuit adopts the basic topology of Boost converter and adds software feedback to form a closed-loop control.

C1 , C2 , C3 , and C4 filter the power input and output to reduce the power ripple. R2 prevents the impact of the current on the circuit during charging. The resistance value is 10Ω . Too large a resistance value will affect the conversion efficiency. A MOSFET field effect tube with fast switching speed is selected. The inductance parameters are calculated as follows, and the duty cycle D is calculated as follows :

1

Inductance calculation:

2

2. Current sampling theory analysis and calculation

The sampling resistor should not be too large. First, the larger the resistance, the greater the current consumed in the sampling resistor, which reduces the efficiency of the power supply. Second, the larger the resistance, the higher the power consumption of the sampling resistor and the larger the temperature drift. The sampling resistor should also not be too small, because the smaller the resistance, the smaller the converted voltage, the smaller the input in the signal conditioning process, the larger the amplification factor required, and the more stringent the control requirements for input noise and bias, which increases the difficulty of system design.

The maximum sampling current of this design is about 3A , so it is more appropriate to select milliohm-level resistors. Here, a 10mΩ precision resistor is selected. The voltage range of the sampled conversion is 0~30mV . The system samples the internal ADC of the microcontroller , and the sampling voltage range is 0~3.3V . At this time, the required amplification factor calculated is about 100 times.

The amplifier circuit uses TI 's precision instrument amplifier INA128 , and the amplification factor G is controlled by adjusting Rg . The formula is as follows:

Calculation shows that: Rg=511Ω , which means the signal can be amplified 100 times, and then the signal that is not within the useful signal bandwidth is filtered out through a low-pass filter and sent to the ADC inside the microcontroller for sampling.

3. Hardware Circuit Design

1. BOOST boost circuit design

Since the power supply of this system is +12V , and the motor needs a +15V power supply, in order to meet the power supply requirements, a +15V power supply needs to be generated through a DC-DC boost circuit . This design selects the Boost circuit to achieve the voltage, current, efficiency, and ripple indicators of the question. After the 12V power supply enters the module, it is filtered by C1 and C2 , passes through the Boost circuit, and then passes through C3 and C4 to obtain a +15V output. The switching of the field effect tube is controlled by the PWM output of the microcontroller, and the output drive current of the microcontroller cannot meet the requirements of the field effect tube. Therefore, this design uses the IR2110 chip to design the field effect tube drive circuit, and the drive output is connected to the LO and HO in the Boost circuit .

Figure 3 Boost circuit

2. Auxiliary power supply circuit design

The auxiliary power supply circuit is shown in Figure 4. This design requires +5V and -5V power supplies for the signal conditioning module, and 3.3V power supply for the microcontroller. The +5V and -5V power supplies are generated using the step-down circuit solution and negative power generation solution of TI 's switching power supply chip TPS54340 . In addition, the 3.3V power supply of the microcontroller is generated using the linear regulator AMS1117-3.3V .

Figure 4 Auxiliary negative power supply circuit

3. Current sampling circuit design

The current sampling circuit adopts the solution of precision resistor sampling, and the circuit is shown in Figure 5. The precision resistor R1 is 10mΩ , and the converted voltage after sampling is about 30mV . Therefore, this design needs to amplify the sampled voltage. Using TI 's instrument amplifier INA128 , set the amplification to 100 times, you can get a voltage of about 3V . Since the bandwidth of current sampling is 1kHz , it is necessary to filter the amplified signal. Using OP07 op amp, building a Sallen-Key structure, and a second-order low-pass filter with a cutoff frequency of 5kHz , it can achieve that the effective signal will not be attenuated within the 1kHz bandwidth, and the noise can be fully filtered out.

Figure 5 Current sampling circuit

4. Motor drive circuit design

The motor control circuit uses an H- bridge drive. This design uses two half-bridge circuits to form an H- bridge circuit. The half-bridge circuit is composed of a driver chip IR2104 and two MOS tubes. Among them, the IR2104 half-bridge driver chip can drive two N- channel MOSFETs at the high end and low end , can provide a large gate drive current, and has hardware dead zone, hardware anti-same arm conduction and other functions. Figure 5 is a structural diagram of the half-bridge circuit.

Figure 5 Motor drive half-bridge circuit

4. Software Programming

According to the requirements of the topic, the STM32 microcontroller is used as the main control and the motor current and motor speed related information are measured. The main program flow chart is shown in Figure 6 .

Figure 6 Main program flow chart

The main program flow chart is shown in Figure 6. The program first performs initialization configuration, including IO port initialization, motor initialization, and PWM initialization, and then selects functions according to the requirements of the topic. When the motor current test is selected, AD samples the sampling resistor, and then converts it into a current value and transmits it to the computer via WiFi ; when the motor speed is selected, the rotor position is read to obtain the given position, and then the interrupt service program is entered to perform relevant conditions on the motor. During the whole process, the speed and distance are measured, and the instantaneous measurement results are transmitted to the PC via WiFi .

Figure 7 Interrupt service routine

V. Conclusion

This design completes a current feedback DC motor control system and the corresponding test device. The boost circuit and auxiliary power supply modules are used to realize system power supply, and the motor drive circuit and current detection circuit are designed to control the motor movement in two ways. The system motor current and speed, and the corresponding detection data are displayed and transmitted to the PC .

Some functions required by the topic have been realized, meeting the requirements of the topic.

image.png (50.42 KB, downloads: 0)

image.png
This post is from Electronics Design Contest

Latest reply

My boost part is similar to the questioner's. I'm curious about the boost calculation of the boost part?   Details Published on 2023-9-8 09:04

2w

Posts

328

Resources
2

What I am more concerned about is that after the 12V power supply enters the module, it is filtered by C1 and C2, passes through the Boost circuit, and then filtered by C3 and C4 to obtain a +15V output.

This post is from Electronics Design Contest

2

Posts

0

Resources
3

Very valuable for reference

This post is from Electronics Design Contest

2

Posts

0

Resources
4

My boost part is similar to the questioner's. I'm curious about the boost calculation of the boost part?

This post is from Electronics Design Contest

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list