Servo motor negative feedback control method and system based on development board, and storage medium
By using servo motor technology and development board for negative feedback control in the magneto-inductance system, the high energy consumption and speed bottleneck caused by stepper motors is solved, and the efficient power acquisition of the magneto-inductor and the low-power operation of the system are achieved.
Patent Information
- Application Number
- CN202411893198.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-05-02
AI Technical Summary
In existing magneto-inductance systems, the inherent characteristics of stepper motors lead to high energy consumption and obvious speed bottlenecks, making it difficult to make breakthroughs in the balance of energy conversion efficiency and system power consumption.
The servo motor technology is used in combination with the development board for negative feedback control, and the trans-resistance circuit is built through the op amp, the servo motor power switch circuit and the PWM wave boost circuit are built to achieve rapid and accurate positioning of the magnet and low-power standby.
The precise control of the single-time adjustment time of the magnet is realized, and the actual measured power of the motor rotation is low, which improves the power generation efficiency of the magnetoelectric inductor and the system's power utilization efficiency.
Smart Images

Figure CN119921626A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of motor control in a magnetoelectric induction system, and in particular relates to a servo motor negative feedback control method, system and storage medium based on a development board. Background Art
[0002] In the development process of magnetoelectric induction system for energy harvesting, many technical solutions have emerged, and many teams have tried to overcome the problem of balancing energy conversion efficiency and system power consumption. Some existing designs use stepper motors as key components for adjusting magnetic fields in magnetoelectric induction systems, and are matched with universal motor driver boards, aiming to accurately adjust the relative position of the magnetic field by controlling the step rotation of the stepper motor, thereby optimizing the power generation efficiency of the magnetoelectric inductor. However, practical applications have exposed serious drawbacks, because such solutions do not consider the overall energy consumption of the system. The inherent characteristics of stepper motors determine that the direction of the winding current needs to be frequently switched during operation to achieve step movement. Each switch is accompanied by a large amount of instantaneous consumption of electric energy. In addition, the energy consumption of the motor start and stop process increases sharply, as well as the static and dynamic energy consumption of the driver board itself, resulting in the system collecting electric energy that is often far lower than its own power consumption. In most cases, it cannot even maintain its own basic circuit operation, let alone provide stable power supply for external loads. After a short period of operation, the equipment stops working due to power exhaustion, and has no practical value in actual scenarios such as remote unattended environmental monitoring and medical implantable micro-sensors.
[0003] Subsequent improvements have attempted to streamline the process, remove some complex control circuits, and directly drive the stepper motor, but the core dilemma has not been resolved. The motor speed bottleneck is prominent, the adjustment of the magnet position is slow, and it takes a long time to rotate a certain angle. It is difficult to cope with the rapid changes in environmental vibration energy and it is difficult to capture the fleeting power generation opportunities. At the same time, the rotation power remains high, causing serious overheating risks in the limited heat dissipation space of small devices, accelerating the aging of electronic components and parameter drift. For example, when applied to miniature smoke alarms, high temperatures cause the sensor false alarm rate to soar, seriously interfering with the normal function of the equipment, greatly limiting the miniaturization and stabilization of the equipment, and running counter to the current trend of compact and efficient design of electronic products.
[0004] A comprehensive analysis of the existing technical difficulties shows that the root causes are concentrated in two key aspects. The first is the wrong motor selection. The physical structure and working principle of the stepper motor itself are inherently not suitable for the magnetoelectric induction system that is sensitive to precision and energy consumption. Its fixed step angle makes it impossible to make fine and continuous adjustments to the magnet position. The magnetoelectric sensor cannot resonate accurately most of the time, and the power generation efficiency is at a low level for a long time. The huge mechanical structure derives a high moment of inertia, and the energy consumption of each action accumulates like a snowball, resulting in serious waste of electricity.
[0005] Furthermore, the control strategy is seriously lagging behind, and the traditional solution lacks an intelligent dynamic control mechanism. During the operation of the entire system, the motor and the peripheral circuits maintain a constant high energy consumption mode regardless of the power generation state of the magnetic inductor, just like a car idling without turning off the engine. There is no concept of energy utilization, and it is impossible to flexibly allocate resources based on the actual power generation efficiency. Ultimately, the system's net power output is meager and it is difficult to support the complex and changing actual application needs. Summary of the invention
[0006] In view of the above defects or improvement needs of the existing technology, we adhere to the concept of breakthrough innovation and reshape the technology landscape in all aspects. Starting from the hardware foundation, the present invention carefully selects the adapter motor and introduces the servo motor technology. With its high-precision position feedback, extremely small control angle deviation and strong instantaneous torque output capability, it ensures the fast and accurate positioning of the magnet. At the software level, we rely on high-performance microcontrollers to build an intelligent hub, innovatively integrate ultra-low power standby logic, realize intelligent sleep when the system is idle, and the circuit energy consumption is close to zero.
[0007] As a first aspect of the present invention, the present invention provides a servo motor negative feedback control method based on a development board, comprising:
[0008] S1. Use the op amp to build a transimpedance circuit to convert the current value output by the magnetoelectric inductor into a voltage value, and the development board samples the voltage converted by the magnetoelectric inductor;
[0009] S2. Use the transistor circuit to build a servo motor power switch circuit. The development board port pin outputs the IO level and uses the servo motor to drive the magnet:
[0010] When the pin output is high level, the transistor is turned on, the negative pole of the motor is grounded, a power supply loop is formed, and the servo motor works normally;
[0011] When the pin output is low level, the transistor is cut off, the negative pole of the motor is disconnected, and the servo motor stops running;
[0012] S3. Use transistors to build a PWM wave boost circuit. The development board outputs PWM waves to control the rotation of the servo motor. The width of the PWM wave varies depending on the rotation angle.
[0013] S4. Determine the output voltage of the magnet at the current position α0 compared to the output voltage at α0-10° and α0+10°. When the output voltage at the current position α0 is the largest, it is considered that the magnetoelectric sensor has reached the maximum output voltage value, the development board enters the low power mode, and the magnet stops rotating; otherwise, the servo motor controls the magnet to rotate to a new position until it is at the position with the maximum output voltage.
[0014] Furthermore, the method for sampling the voltage converted by the magnetoelectric inductor in step S1 is the ADC sampling function of the development board; the ADC sampling clock is 1MHz, the sampling time is 16 clock cycles, the sampling voltage range is 0-3.3V, and the sampling period is not less than 1KHz.
[0015] Furthermore, the operational amplifier in step S1 builds a transimpedance circuit, whose power supply voltage is 5V and resistance is 3k ohms, and amplifies the current of 1mA to 3V.
[0016] Furthermore, the method for constructing a PWM wave boost circuit with the transistor described in S3 is as follows: the power supply voltage of the development board is 3.3V, the signal is led to the gate of the transistor, a 10k resistor and a 5V power supply are connected in series to the source of the transistor, and the level of the PWM wave is increased to 5V.
[0017] Furthermore, as described in S3, the width of the PWM wave is different according to the different rotation angles, and the specific corresponding relationship is: -90° corresponds to 0.5ms, 0° corresponds to 1.5ms, and 90° corresponds to 2.5ms.
[0018] Furthermore, the trigger signal source of the PWM wave in S3 is the timer B of the development board, and its clock source adopts SMCLK, and the frequency is set to 1 MHz.
[0019] Furthermore, the parameter pulse base TB0CCR0 of the PWM wave in S3 is 20000-1, and the pulse width TB0CCR1 is 17500-19500, which controls the servo motor to rotate between -90° and 90°.
[0020] Furthermore, in the low power consumption mode described in S4, the development board only retains the ADC sampling function.
[0021] As a second aspect of the present invention, a servo motor negative feedback control system based on a development board is also provided, comprising:
[0022] The transimpedance amplifier unit is used to build a transimpedance circuit through an operational amplifier to convert the current value output by the magnetoelectric inductor into a voltage value. The development board samples the voltage converted by the magnetoelectric inductor.
[0023] The servo motor power switch unit is used to build a servo motor power switch circuit using a triode circuit. The port pins of the development board output IO levels and use a servo motor to drive the magnet:
[0024] When the pin output is high level, the transistor is turned on, the negative pole of the motor is grounded, a power supply loop is formed, and the servo motor works normally;
[0025] When the pin output is low level, the transistor is cut off, the negative pole of the motor is disconnected, and the servo motor stops running;
[0026] PWM wave boost unit, used to build PWM wave boost circuit with triode. The development board outputs PWM wave to control the rotation of servo motor. The width of PWM wave varies according to the rotation angle.
[0027] The logic judgment unit is used to judge the output voltage of the magnet at the current position α0 compared with that at α0-10° and α0+10°. When the output voltage at the current position α0 is the largest, it is considered that the magnetoelectric inductor has reached the maximum output voltage value, the development board enters the low power mode, and the magnet stops rotating; otherwise, the servo motor controls the magnet to rotate to a new position until it is at the position with the maximum output voltage.
[0028] As a third aspect of the present invention, it also relates to a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement a negative feedback control method for a servo motor based on a development board.
[0029] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0030] 1. The negative feedback control method of the servo motor based on the development board of the present invention closely combines the servo motor and the magnet through an integrated design, realizes the precise control of the single adjustment time of the magnet within 0.3ms, and the measured power of the motor rotation is as low as 0.19W (power supply voltage 5V), achieving rapid adjustment under low power. In this way, the magnetoelectric inductor can quickly tend to the resonant state, thereby more efficiently obtaining the maximum power output, greatly improving the efficiency of the magnet position adjustment, and providing a strong guarantee for the magnetoelectric induction system in terms of power collection.
[0031] 2. The negative feedback control method of the servo motor based on the development board of the present invention, by flexibly switching the function of the mode of the development board, automatically enters the low power consumption mode (LPM3.5) when the magnet does not need to rotate and the system is in standby mode, retaining only the ADC sampling function, and the power consumption of the development board is reduced to 0.3mW. At the same time, with the well-designed servo motor switch circuit, the output of the 5V power supply to the servo motor is cut off at the standby time, so that the servo motor is in standby mode with almost zero energy consumption, which effectively enhances the power efficiency of the system, prolongs the battery life of the equipment, and helps the magnetoelectric induction system better adapt to the application scenarios with low energy consumption and high performance requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 A schematic diagram of a method flow chart of a preferred embodiment of the present invention;
[0033] Figure 2 A schematic diagram of the control link hardware of a preferred embodiment of the present invention;
[0034] Figure 3A software flow chart of the voltage comparison logic of a preferred embodiment of the present invention;
[0035] In all the drawings, the same figure marks represent the same technical features, specifically: 1-development board MSP430FR2311; 2-pin P1.7; 3-PWM wave output pin P2.0; 4-current reading pin P1.3; 5-voltage feedback pin P1.5; 6-transistor FDV305N; 7-transistor IPA90R1K2C3; 8-signal line. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0037] Example 1
[0038] Please refer to Figure 1 as well as Figure 2 In order to achieve the above purpose, this embodiment 1 proposes a servo motor negative feedback control method based on a development board, including:
[0039] Step 1. Use an op amp to build a transimpedance circuit to convert the current value output by the magnetoelectric inductor into a voltage value, and use the MSP430 development board to sample the voltage converted by the magnetoelectric inductor;
[0040] Step 2. Use the transistor circuit to build the servo motor power switch circuit, the MSP430 development board port pin output IO level, and use the SG92R servo motor to drive the magnet:
[0041] When the pin output is high level, the transistor is turned on, the negative pole of the motor is grounded, a power supply loop is formed, and the servo motor works normally;
[0042] When the pin output is low level, the transistor is cut off, the negative pole of the motor is disconnected, and the servo motor stops running;
[0043] Step 3. Use transistors to build a PWM wave boost circuit. The MSP430 development board outputs PWM waves to control the rotation of the SG92R servo motor. The width of the PWM wave varies depending on the rotation angle.
[0044] Step 4. Determine the output voltage of the magnet at the current position α0 compared to the output voltage at α0-10° and α0+10°. When the output voltage at the current position α0 is the largest, it is considered that the magnetoelectric inductor has reached the maximum output voltage value, the MSP430 development board enters low power mode, and the magnet stops rotating; otherwise, the SG92R servo motor controls the magnet to rotate to a new position until it is at the position with the maximum output voltage.
[0045] Specifically, the above method can use SG92R servo motor to drive the magnet. For example, the radius of the magnet can be selected as 5mm, the weight can be 29.98g, the torque required for rotation is 3.74*10-7kg*m2, and the required torque is 0.159kg*cm. According to the above requirements, a servo motor of model SG92R is used. The motor has a power supply voltage of 4.8V, a maximum torque of 2.5kg*cm, and a speed of 0.1s / 60°, which meets the design requirements.
[0046] The analog circuit is mainly composed of the following parts: transimpedance amplifier circuit, servo motor power switch circuit, and PWM wave boost circuit.
[0047] By using an op amp to build a transimpedance circuit, the current value output by the magnetoelectric inductor is converted into a voltage value for sampling by the MCU. The op amp model that can be used in the circuit is OPA227UA, the op amp supply voltage is 5V, and the resistance is 3k ohms. It can amplify 1mA current to 3V.
[0048] When actually building the circuit, the shortest path principle was adopted to reduce interference and loss during signal transmission. At the same time, in order to ensure the stability of the op amp, a decoupling capacitor was added near its power pin to effectively filter out power supply noise, making the voltage signal output by the op amp purer.
[0049] In other preferred implementations, other alternative models have been studied and tested in depth. For example, the TLV277x series op amps have extremely low input bias current and offset voltage, and can maintain high-precision conversion over a wider temperature range. In terms of circuit design, in order to further improve the stability and anti-interference ability of the conversion, the peripheral circuits of the op amp have been optimized. An LC filter circuit is added to the power input to effectively filter out the influence of power ripple on the operation of the op amp; at the signal input, a differential input method is adopted, and a common-mode choke is added to significantly reduce the interference of common-mode noise.
[0050] Use the transistor circuit to build the servo motor power switch circuit. The MSP430FR2311 development board port pin P1.7 outputs a 3.3V IO level and connects to the gate of the FDV305N. The motor SR92D is at the drain of the transistor. When the P1.7 output is high, the transistor is turned on, the negative pole of the motor is grounded, and a power supply loop is formed. The servo motor works normally. When the P1.7 output is low, the transistor is turned off, the negative pole of the motor is disconnected, and the servo motor has only a small amount of I dss The current is 1μA, which can be ignored.
[0051] In some other preferred embodiments, the transistor also evaluates models such as BSS138. BSS138 has lower on-resistance and faster switching speed, which can reduce energy loss and delay time during the motor power switching process. In the circuit layout, electromagnetic compatibility (EMC) is fully considered. The motor power line is isolated from the control signal line, the motor is connected with a shielded line, and a varistor and a transient suppression diode are connected in parallel at both ends of the motor, which effectively suppresses the interference of the electromagnetic pulse generated at the moment of motor start and stop on the control circuit.
[0052] In addition, in some embodiments, in order to monitor the working status of the motor power supply in real time, a current detection resistor and a voltage monitoring point are integrated in the power switch circuit. The MSP430 development board regularly collects these data through the ADC channel. Once a power supply abnormality is detected, such as overcurrent, undervoltage, etc., corresponding protection measures are immediately taken, such as cutting off the power supply, issuing an alarm signal, etc., to ensure the safe and stable operation of the entire system.
[0053] The PWM wave boost circuit is built with transistor IPA90R1K2C3, which is used to increase the PWM level output by MSP430FR2311 from 3.3.V to 5V. The P2.0 pin of the development board outputs PWM waves, which is limited by the power supply voltage of the development board. The level is only 3.3V, so the signal is led to the gate of IPA90R1K2C3. A 10k resistor and a 5V power supply are connected in series to the source of the transistor to increase the level of the PWM wave to 5V.
[0054] At the same time, in order to further optimize the quality of the PWM wave, an LC filtering network composed of inductors and capacitors is added to the circuit to effectively filter out the high-frequency noise in the PWM wave, making the output PWM wave smoother, reducing the electromagnetic interference to the servo motor, and improving the stability and reliability of the motor operation.
[0055] In other preferred embodiments, in order to achieve more flexible control of PWM waves, the MSP430 development board introduces a programmable logic device (CPLD). CPLD can dynamically adjust the frequency, duty cycle and other parameters of the PWM wave in real time according to the operating status and control requirements of the system, and can implement more complex PWM modulation strategies, such as space vector PWM (SVPWM) modulation, to improve the operating efficiency and control accuracy of the motor.
[0056] By constructing the above circuit, the control link of the magnetoelectric sensor system is completed, and the functions of signal sampling, judgment and control are completed.
[0057] Please refer to Figure 2 The voltage comparison logic implementation process and method of this embodiment 1 are as follows:
[0058] The MSP430FR2311 development board is used as the core to build the control circuit. The program mainly realizes functions such as ADC sampling, development board power consumption mode switching, servo motor power switch control IO level output, PWM wave output and logic judgment.
[0059] The program uses the ADC sampling function of the development board to sample the voltage converted by the magnetoelectric inductor. The ADC sampling clock is 1MHz, the sampling time is 16 clock cycles, the sampling voltage range is 0~3.3V, and the accuracy is 10bits (6.64*10-3V). In the main program, the ADC sampling function is executed once per cycle, and the sampling period is not less than 1KHz.
[0060] To reduce power consumption, the MSP430FR2311 automatically enters low power mode (LPM3.5) when the magnet does not rotate, and only retains the ADC sampling function. The power consumption of the development board in low power mode is about 0.8mW. When the magnet needs to rotate, the program controls the development board to enter normal mode (LPM1).
[0061] In order to reduce power consumption, the MSP430FR2311 outputs a low level to the servo motor circuit from pin P1.7 when the magnet does not rotate, controlling the transistor FDV305N to turn off, thereby cutting off the power supply to the servo motor. When the magnet needs to rotate, pin P1.7 outputs a high level, the transistor is turned on, and the servo motor is powered normally.
[0062] The development board outputs PWM waves to control the rotation of the servo motor. The PWM level is 5V and the frequency is 50Hz. The width of the PWM wave varies according to the rotation angle. The typical corresponding relationship is: -90° corresponds to 0.5ms, 0° corresponds to 1.5ms, and 90° corresponds to 2.5ms. The development board uses timer B as the signal source to trigger the PWM wave. The clock source uses SMCLK (1MHz) and the output pin is P2.0. The output mode is set to rising mode in the program, the parameter pulse base TB0CCR0 is 20000-1, and the pulse width TB0CCR1 is 17500~19500. The servo motor can be controlled to rotate between -90° and 90°.
[0063] The logic judgment mainly judges the relationship between the voltage output by the magnetoelectric inductor at the current position and the output voltage at the previous position. Each time the magnet rotates in a step angle of 10°, when the program judges that the output voltage at the current position α0 of the magnet is greater than the output voltage at (α0-10°) and (α0+10°), it is considered that the magnetoelectric inductor has reached the maximum output voltage value at this time, and the development board enters LPM3.5 mode.
[0064] Example 2
[0065] This embodiment 2 proposes a servo motor negative feedback control system based on a development board, including:
[0066] The transimpedance amplifier unit is used to build a transimpedance circuit through an operational amplifier to convert the current value output by the magnetoelectric inductor into a voltage value, and the MSP430 development board samples the voltage converted by the magnetoelectric inductor;
[0067] Servo motor power switch unit, used to build servo motor power switch circuit using triode circuit, MSP430 development board port pin output IO level, using SG92R servo motor drive magnet:
[0068] When the pin output is high level, the transistor is turned on, the negative pole of the motor is grounded, a power supply loop is formed, and the servo motor works normally;
[0069] When the pin output is low level, the transistor is cut off, the negative pole of the motor is disconnected, and the servo motor stops running;
[0070] During the circuit construction process, the heat dissipation of the transistor is fully considered in other preferred implementations, especially when the servo motor is frequently started and stopped, the transistor may generate more heat. Therefore, a small heat sink is added near the installation location of the transistor to ensure that its operating temperature is within a safe range to avoid degradation or even damage to the transistor due to overheating. At the same time, in order to prevent the instantaneous spike voltage generated by the transistor during the switching process from damaging other circuit components, a transient suppression diode is connected in parallel between the collector and emitter of the transistor, which effectively absorbs the spike voltage and protects the safe and stable operation of the entire circuit.
[0071] PWM wave boost unit is used to build a PWM wave boost circuit using a triode. The MSP430 development board outputs PWM waves to control the rotation of the SG92R servo motor. The width of the PWM wave varies according to the rotation angle.
[0072] In other preferred embodiments, in the PWM wave boost circuit constructed by the transistor, the driving circuit of the transistor is optimized. A high-speed MOSFET driver chip, such as TC4420, is used to enhance the driving capability of the transistor, ensuring that the transistor can respond to the PWM signal quickly and accurately, improving the steepness of the rising and falling edges of the PWM wave, and reducing the switching loss. At the same time, the LC filter network in the boost circuit is finely adjusted. According to the operating frequency characteristics of the motor and the requirements for the smoothness of the PWM wave, the parameter values of the inductor and capacitor are accurately determined through experiments and simulation methods, so that the output PWM wave has a lower harmonic content while meeting the motor drive requirements, further reducing the electromagnetic interference to the motor and other electronic components.
[0073] The logic judgment unit is used to judge the output voltage of the magnet at the current position α0 compared with the output voltage at α0-10° and α0+10°. When the output voltage at the current position α0 is the largest, it is considered that the magnetoelectric inductor has reached the maximum output voltage value, the development board enters the low power mode, and the magnet stops rotating; otherwise, the SG92R servo motor controls the magnet to rotate to a new position until it is at the position with the maximum output voltage.
[0074] When performing voltage comparison logic judgment, in order to improve the accuracy and real-time performance of the judgment, in some other preferred embodiments, a high-speed comparator is used to process the voltage signal. The high-speed comparator can complete the voltage comparison operation in a very short time and feed back the result to the MSP430 development board. At the same time, in order to avoid misjudgment caused by factors such as environmental noise, the voltage signal is first passed through a low-pass filter before being input into the comparator to filter out high-frequency noise interference. In terms of magnet rotation control, when the SG92R servo motor is required to drive the magnet to rotate, it is not only controlled according to the preset PWM wave width and rotation angle relationship, but also dynamically adjusted in combination with the real-time output voltage change rate of the magnetoelectric inductor. If it is found that the output voltage change rate of the magnetoelectric inductor is fast, it means that the magnet is close to the optimal position, then the width of the PWM wave is appropriately reduced, and the rotation speed of the motor is reduced to more accurately locate the maximum output voltage position and reduce the occurrence of overshoot.
[0075] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of any of the above-mentioned servo motor negative feedback control methods based on a development board can be implemented.
[0076] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0077] For an introduction to the computer-readable storage medium provided in this application, please refer to the above method embodiment, and this application will not go into details here.
[0078] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A servo motor negative feedback control method based on a development board, characterized in that: include: S1. Use the op amp to build a transimpedance circuit to convert the current value output by the magnetoelectric inductor into a voltage value, and the development board samples the voltage converted by the magnetoelectric inductor; S2. Use the transistor circuit to build a servo motor power switch circuit. The development board port pin outputs the IO level and uses the servo motor to drive the magnet: When the pin output is high level, the transistor is turned on, the negative pole of the motor is grounded, a power supply loop is formed, and the servo motor works normally; When the pin output is low level, the transistor is cut off, the negative pole of the motor is disconnected, and the servo motor stops running; S3. Use transistors to build a PWM wave boost circuit. The development board outputs PWM waves to control the rotation of the servo motor. The width of the PWM wave varies depending on the rotation angle. S4. Determine the output voltage of the magnet at the current position α0 compared to the output voltage at α0-10° and α0+10°. When the output voltage at the current position α0 is the largest, it is considered that the magnetoelectric sensor has reached the maximum output voltage value, the development board enters the low power mode, and the magnet stops rotating; otherwise, the servo motor controls the magnet to rotate to a new position until it is at the position with the maximum output voltage.
2. According to the servo motor negative feedback control method based on the development board of claim 1, it is characterized in that: The method for sampling the voltage converted by the magnetoelectric inductor in step S1 is the ADC sampling function of the development board; the ADC sampling clock is 1MHz, the sampling time is 16 clock cycles, the sampling voltage range is 0-3.3V, and the sampling period is not less than 1KHz.
3. According to the servo motor negative feedback control method based on the development board of claim 2, it is characterized in that: The operational amplifier in step S1 builds a transimpedance circuit with a supply voltage of 5V and a resistance of 3k ohms, which amplifies a current of 1mA to 3V.
4. According to the servo motor negative feedback control method based on the development board of claim 1, it is characterized in that: The method of building a PWM wave boost circuit with a transistor described in S3 is: the power supply voltage of the development board is 3.3V, the signal is led to the gate of the transistor, a 10k resistor and a 5V power supply are connected in series to the source of the transistor to increase the level of the PWM wave to 5V.
5. According to the servo motor negative feedback control method based on the development board of claim 4, it is characterized in that: As described in S3, the width of the PWM wave is different according to the rotation angle, and the specific corresponding relationship is: -90° corresponds to 0.5ms, 0° corresponds to 1.5ms, and 90° corresponds to 2.5ms.
6. According to the servo motor negative feedback control method based on the development board of claim 5, it is characterized in that: The trigger signal source of the PWM wave in S3 is the timer B of the development board, and its clock source uses SMCLK, and the frequency is set to 1MHz.
7. A servo motor negative feedback control method based on a development board according to claim 6, characterized in that: The parameter pulse base TB0CCR0 of the PWM wave in S3 is 20000-1, and the pulse width TB0CCR1 is 17500-19500, which controls the servo motor to rotate between -90° and 90°.
8. The servo motor negative feedback control method based on the development board according to claim 1, characterized in that: In the low power mode described in S4, the development board only retains the ADC sampling function.
9. A servo motor negative feedback control system based on a development board, characterized in that: include: The transimpedance amplifier unit is used to build a transimpedance circuit through an operational amplifier to convert the current value output by the magnetoelectric inductor into a voltage value. The development board samples the voltage converted by the magnetoelectric inductor. The servo motor power switch unit is used to build a servo motor power switch circuit using a triode circuit. The port pins of the development board output IO levels and use a servo motor to drive the magnet: When the pin output is high level, the transistor is turned on, the negative pole of the motor is grounded, a power supply loop is formed, and the servo motor works normally; When the pin output is low level, the transistor is cut off, the negative pole of the motor is disconnected, and the servo motor stops running; PWM wave boost unit, used to build PWM wave boost circuit with triode. The development board outputs PWM wave to control the rotation of servo motor. The width of PWM wave varies according to the rotation angle. The logic judgment unit is used to judge the output voltage of the magnet at the current position α0 compared with that at α0-10° and α0+10°. When the output voltage at the current position α0 is the largest, it is considered that the magnetoelectric inductor has reached the maximum output voltage value, the development board enters the low power mode, and the magnet stops rotating; otherwise, the servo motor controls the magnet to rotate to a new position until it is at the position with the maximum output voltage.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed by the processor to implement the servo motor negative feedback control method based on the development board as described in claims 1-8.