Magnetic rotating speed circuit with feedback
By designing a magnetic speed circuit with feedback, and utilizing a Hall effect sensor and a microcontroller for speed calculation and deviation feedback, the problem of traditional sensors being susceptible to interference is solved, enabling real-time and precise speed adjustment and meeting the requirements of high-precision and high-reliability speed control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- SHANGHAI HEGONG SCI INSTR CO LTD
- Filing Date
- 2025-05-30
- Publication Date
- 2026-05-19
AI Technical Summary
In existing speed measurement circuits, designs based on traditional sensors are susceptible to environmental interference and difficult to achieve real-time precise adjustment, failing to meet the modern industrial demand for high-precision and high-reliability speed control.
A magnetic rotation speed circuit with feedback is designed, including a magnetic induction circuit, a signal conditioning circuit, a microcontroller circuit, a feedback control circuit, and a drive circuit. The change in the magnetic field of the magnetic coil is sensed by a Hall effect sensor, generating an induction signal and conditioning it. The microcontroller calculates the rotation speed and compares the deviation. The feedback control circuit generates a drive control signal to adjust the rotation speed of the magnetic rotor.
It achieves real-time and precise speed adjustment, meeting the modern industrial demand for high-precision and high-reliability speed control.
Smart Images

Figure CN224263229U_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of circuit technology, and in particular to a magnetic rotation speed circuit with feedback. Background Technology
[0002] In fields such as industrial automation and motor drive control, accurate measurement and control of rotational speed are crucial for ensuring the efficient and stable operation of equipment. Existing speed measurement circuits based on traditional sensors suffer from numerous design problems. For example, circuits based on photoelectric sensors are susceptible to interference from ambient light intensity and dust, leading to unstable measurement signals; circuits based on contact sensors experience wear due to mechanical contact, affecting measurement accuracy and sensor lifespan, and increasing system maintenance costs.
[0003] Although magnetic speed feedback technology is gradually emerging, the related circuit designs often lack an effective feedback mechanism, making it difficult to achieve real-time and precise speed adjustment and failing to meet the modern industrial demand for high-precision and high-reliability speed control. Utility Model Content
[0004] The purpose of this application is to provide a magnetic rotation speed circuit with feedback to solve or alleviate the problems existing in the prior art.
[0005] To achieve the above objectives, this application provides the following technical solution:
[0006] A magnetic rotation speed circuit with feedback includes: a magnetic induction circuit, a signal conditioning circuit, a microcontroller circuit, a feedback control circuit, and a drive circuit. The magnetic induction circuit is connected to the signal conditioning circuit and is used to sense changes in the magnetic field of the magnetic coil to generate an induction signal and transmit it to the signal conditioning circuit. The signal conditioning circuit is connected to the microcontroller circuit and is used to condition the induction signal to generate a pulse signal and transmit it to the microcontroller circuit. The microcontroller circuit is connected to the feedback control circuit and is used to compare the square wave pulse signal with a preset speed threshold to check whether there is a deviation between the speed of the magnetic rotor and the preset speed. If there is a deviation, a speed deviation feedback signal is generated and transmitted to the feedback control circuit. The feedback control circuit is connected to the drive circuit and is used to generate a drive control signal based on the speed deviation feedback signal and transmit it to the drive circuit to generate a speed control signal to adjust the magnetic field of the magnetic coil and adjust the speed of the magnetic rotor accordingly.
[0007] Preferably, the number of magnetic coils is four, and a magnetic induction circuit is fixed between every four magnetic coils.
[0008] Preferably, the magnetic induction circuit includes a Hall effect sensor fixed between four magnetic coils. The Hall effect sensor is equipped with at least a first pin (1), a second pin (2), and a third pin (3). The first pin (1) is connected to the power supply (VCC), the second pin (2) is connected to ground (GND), and the third pin (3) is connected to the input interface (PA1) of the signal conditioning circuit, so as to convert the magnetic field change of the sensed magnetic coil into an electrical signal and use it as a sense signal.
[0009] Preferably, the signal conditioning circuit is integrated on the microcontroller circuit and is equipped with at least an input interface and an output interface. The input interface is connected to the magnetic induction circuit to receive the induction signal, and is used to amplify, filter, and shape the induction signal to generate a pulse signal, which is then output to the microcontroller circuit through the output interface.
[0010] Preferably, the microcontroller circuit is configured with at least a signal receiving end and a signal output end. The signal receiving end is connected to the signal conditioning circuit to receive pulse signals, count the frequency of the pulse signals, calculate the real-time rotational speed of the magnetic rotor based on the counting results, compare the calculated rotational speed with a preset rotational speed threshold to generate a pulse signal, and output it to the feedback control circuit through the signal output end.
[0011] Preferably, the feedback control circuit is integrated into the microcontroller circuit, and it is equipped with at least a signal receiving end and a signal output end. The signal receiving end is connected to the microcontroller circuit to receive the speed deviation feedback signal to generate a drive control signal and output it to the drive circuit through the signal output end.
[0012] Preferably, the drive circuit includes a stepper motor driver, which is configured with a signal receiving end and a signal output end. The signal receiving end is connected to the signal output end of the feedback control circuit and is used to receive the drive control signal output by the feedback control circuit to generate a speed control signal. The signal output end is connected to the magnetic coil to adjust the magnetic field of the magnetic coil and thereby adjust the speed of the magnetic rotor.
[0013] Preferably, the stepper motor driver is further configured with logic input pins and phase control pins, which are connected to the GPIO pins of the microcontroller circuit to generate speed control signals with adjustable magnitude and direction according to the drive control signal.
[0014] Preferably, the stepper motor driver includes a first bridge circuit and a second bridge circuit. The first bridge circuit is connected to a first magnetic coil to generate a first speed control signal with adjustable magnitude and direction according to a drive control signal under the control of a microcontroller circuit. The second bridge circuit is connected to a second magnetic coil to generate a second speed control signal with adjustable magnitude and direction according to a drive control signal.
[0015] Preferably, the first bridge circuit has a first output pin and a second output pin, which are respectively connected to one end of the first magnetic coil to adjust the magnetic field change of the first magnetic coil through a first speed control signal. The second bridge circuit has a third output pin and a fourth output pin, which are respectively connected to one end of the second magnetic coil to adjust the magnetic field change of the first magnetic coil through a second speed control signal.
[0016] This application adds a circuit design to implement the feedback mechanism, enabling real-time and precise adjustment of the rotational speed, thus meeting the modern industrial demand for high-precision and high-reliability speed control. Attached Figure Description
[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. Wherein:
[0018] Figure 1 This is a schematic diagram of the magnetic rotation speed circuit with feedback in this application.
[0019] Figure 2 This is a structural schematic diagram of the magnetic coil layout in this application.
[0020] Figure 3 This is a schematic diagram of the microcontroller circuit of this application.
[0021] Figure 4 This is a schematic diagram of the drive circuit of this application.
[0022] Figure 5 This is a schematic diagram of the magnetic induction circuit of this application. Detailed Implementation
[0023] The present application will now be described in detail with reference to the accompanying drawings and embodiments. Various examples are provided by way of explanation and not by way of limitation. In fact, those skilled in the art will recognize that modifications and variations can be made to the present application without departing from the scope or spirit thereof. For example, a feature shown or described as part of one embodiment may be used in another embodiment to produce yet another embodiment. Therefore, it is desirable that the present application encompass such modifications and variations that fall within the scope of the appended claims and their equivalents.
[0024] In the description of this application, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," and "bottom," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and do not require that this application be constructed and operated in a specific orientation, and therefore should not be construed as limiting this application. The terms "connected," "linked," and "set up" used in this application should be interpreted broadly. For example, they can refer to a fixed connection or a detachable connection; they can refer to a direct connection or an indirect connection through intermediate components. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0025] like Figures 1-5 As shown in the figure, this application provides a magnetic rotation speed circuit with feedback, including: a magnetic induction circuit, a signal conditioning circuit, a microcontroller circuit, and a feedback control circuit. The magnetic induction circuit is connected to the signal conditioning circuit and is used to sense changes in the magnetic field of the magnetic coil to generate an induction signal and transmit it to the signal conditioning circuit. The signal conditioning circuit is connected to the microcontroller circuit and is used to condition the induction signal to generate a pulse signal and transmit it to the microcontroller circuit. The microcontroller circuit is connected to the feedback control circuit and is used to compare the square wave pulse signal with a preset rotation speed threshold to check whether there is a deviation between the rotation speed of the magnetic rotor and the preset rotation speed. If there is a deviation, a rotation speed deviation feedback signal is generated and transmitted to the feedback control circuit. The feedback control circuit is connected to the drive circuit and is used to generate a drive control signal based on the rotation speed deviation feedback signal and transmit it to the drive circuit to generate a rotation speed control signal to adjust the magnetic field of the magnetic coil and adjust the rotation speed of the magnetic rotor accordingly.
[0026] Preferably, the number of magnetic coils is four, and a magnetic induction circuit is fixed between every four magnetic coils.
[0027] Preferably, the magnetic induction circuit includes a Hall effect sensor fixed between four magnetic coils. The Hall effect sensor is equipped with at least a first pin (1), a second pin (2), and a third pin (3). The first pin (1) is connected to the power supply (VCC), the second pin (2) is connected to ground (GND), and the third pin (3) is connected to the input interface (PA1) of the signal conditioning circuit, so as to convert the magnetic field change of the sensed magnetic coil into an electrical signal and use it as a sense signal.
[0028] Specifically, the model of the Hall effect sensor is, for example, SS49E.
[0029] The relationships between the magnetic coil, rotor, and Hall effect sensor are explained below:
[0030] I. Spatial Layout Relationship
[0031] Arrangement of magnetic coils
[0032] Quantity and Connections: The system contains 4 magnetic coils (referred to as coil 1 to coil 4), each coil has 2 pins, for a total of 8 pins (as shown in the figure, labeled as 1 / 2 / 3 / 4 / 5 / 6 / 7 / 8).
[0033] Layout: The four coils are symmetrically distributed diagonally (e.g., arranged in a rectangle or circle, with two diagonally opposite groups). The pins of each group of coils are connected diagonally to the H-bridge output of the stepper motor driver L6219 (e.g., OUT1A / OUT1B connects to one group of diagonal coils, and OUT2A / OUT2B connects to another group of diagonal coils).
[0034] An alternating magnetic field is formed by a diagonal layout, which drives the magnetic rotor to rotate.
[0035] Position of the magnetic rotor
[0036] Installation area: The magnetic rotor is located in the central area of the four magnetic coils, maintaining a certain air gap distance (non-contact) from the coils.
[0037] Magnetic rotors are typically permanent magnets or rotating parts made of magnetic materials, with magnetic poles distributed on their outer periphery (such as alternating N / S poles).
[0038] When the rotor rotates, its magnetic poles need to periodically pass near the magnetic coil, causing regular changes in the magnetic field strength around the coil.
[0039] II. Magnetic field coupling relationship
[0040] The magnetic field effect of a magnetic coil
[0041] When the stepper motor driver L6219 energizes the magnetic coil, the coil generates a magnetic field.
[0042] The synergistic effect of diagonal coils:
[0043] When two coils on the same diagonal (such as OUT1A / OUT1B connected to H Bridge 1) are energized, they form a pair of magnetic poles (such as N pole and S pole), and another pair of diagonal coils (OUT2A / OUT2B connected to H Bridge 2) form another pair of magnetic poles.
[0044] The four sets of coils can generate a rotating magnetic field by switching the current direction of H-bridge 1 and H-bridge 2 (controlled by PHASE1 / PHASE2), which drives the magnetic rotor to rotate in the direction of the magnetic field.
[0045] Response of magnetic rotor
[0046] The magnetic rotor is driven by electromagnetic force in a rotating magnetic field, and its rotational speed is positively correlated with the coil current frequency and the magnetic field strength.
[0047] Magnetic pole interaction: The magnetic poles of the rotor and the magnetic field of the coil attract or repel each other, driving the rotor to rotate continuously (for example, if the magnetic field of the coil rotates clockwise, the magnetic poles of the rotor will rotate in the direction of the magnetic field).
[0048] III. Location and Detection Logic of Hall Sensors
[0049] Hall sensor installation
[0050] Fixed position: The Hall sensor (SS49E) is fixed between any two adjacent magnetic coils (such as the midpoint of two adjacent sides of a rectangular layout).
[0051] The distance between the sensor and the magnetic rotor needs to be optimized to ensure that the change in magnetic field when the rotor's magnetic poles pass by can be sensitively detected, while avoiding mechanical contact.
[0052] Detection of magnetic field changes
[0053] When the magnetic rotor rotates, its magnetic poles (such as N / S poles) alternately pass in front of the Hall sensor, causing the magnetic field strength at the sensor location to change periodically (such as from strong N pole → weak → strong S pole → weak).
[0054] The Hall sensor converts changes in magnetic field strength into weak electrical signals (voltage fluctuations), which are then processed by the signal conditioning circuit to generate square wave pulses for the microcontroller to calculate the rotational speed.
[0055] Preferably, the signal conditioning circuit is integrated on the microcontroller circuit and is equipped with at least an input interface and an output interface. The input interface is connected to the magnetic induction circuit to receive the induction signal, and is used to amplify, filter, and shape the induction signal to generate a pulse signal, which is then output to the microcontroller circuit through the output interface.
[0056] Preferably, the microcontroller circuit is configured with at least a signal receiving end and a signal output end. The signal receiving end is connected to the signal conditioning circuit to receive pulse signals, count the frequency of the pulse signals, calculate the real-time rotational speed of the magnetic rotor based on the counting results, compare the calculated rotational speed with a preset rotational speed threshold to generate a pulse signal, and output it to the feedback control circuit through the signal output end.
[0057] Preferably, the feedback control circuit is integrated into the microcontroller circuit, and it is equipped with at least a signal receiving end and a signal output end. The signal receiving end is connected to the microcontroller circuit to receive the speed deviation feedback signal to generate a drive control signal and output it to the drive circuit through the signal output end.
[0058] Preferably, the drive circuit includes a stepper motor driver, which is configured with a signal receiving end and a signal output end. The signal receiving end is connected to the signal output end of the feedback control circuit and is used to receive the drive control signal output by the feedback control circuit to generate a speed control signal. The signal output end is connected to the magnetic coil to adjust the magnetic field of the magnetic coil and thereby adjust the speed of the magnetic rotor.
[0059] Preferably, the stepper motor driver is further configured with logic input pins and phase control pins, which are connected to the GPIO pins of the microcontroller circuit to generate speed control signals with adjustable magnitude and direction according to the drive control signal.
[0060] Specifically, the stepper motor driver model is, for example, L6219, and the microcontroller circuit is, for example, a single-chip microcomputer, model, for example, STM32F103CBT6.
[0061] Specifically, the logic input pins are, for example, DIO1, DII1 and DIO2, DII2. The phase control pins are, for example, phase1 (DPH1) and phase2 (DPH2). Correspondingly, there are also signal output terminals in the feedback control circuit. For matching purposes, they are labeled as DIO1, DII1 and DIO2, DII2, DPH1, DPH2.
[0062] Preferably, the stepper motor driver includes a first bridge circuit and a second bridge circuit. The first bridge circuit is connected to a first magnetic coil to generate a first speed control signal with adjustable magnitude and direction according to a drive control signal under the control of a microcontroller circuit. The second bridge circuit is connected to a second magnetic coil to generate a second speed control signal with adjustable magnitude and direction according to a drive control signal.
[0063] Preferably, the first bridge circuit has a first output pin and a second output pin, which are respectively connected to one end of the first magnetic coil to adjust the magnetic field change of the first magnetic coil through a first speed control signal. The second bridge circuit has a third output pin and a fourth output pin, which are respectively connected to one end of the second magnetic coil to adjust the magnetic field change of the first magnetic coil through a second speed control signal.
[0064] The first and second output pins are, for example, OUT1A (pin 23) and OUT1B (pin 22) respectively, and the third and fourth output pins are, for example, OUT2A (pin 19) and OUT2B (pin 18) respectively.
[0065] Preferably, the specific implementation principle of the stepper motor driver (taking L6219 as an example) is explained in detail below:
[0066] 1. Pin configuration and connection relationship
[0067] Logic input pins:
[0068] IO1 and DII1 are used to control the output current mode of the second bridge circuit (H-bridge 2) and are connected to the GPIO pins of the STM32F103CBT6 microcontroller.
[0069] DIO2 and DII2 are used to control the output current mode of the first bridge circuit (H-bridge 1) and are connected to the GPIO pins of the STM32F103CBT6 microcontroller.
[0070] By changing the level combination of these four pins (such as high and low levels), the current output mode of H-bridge 1 and H-bridge 2 (such as full-step and half-step drive) can be controlled, thereby adjusting the current magnitude.
[0071] Phase control pins: All are connected to the GPIO pins of the STM32F103CBT6 microcontroller, and the magnetic field direction is switched by the high and low levels.
[0072] PHASE1 (pin 6): Controls the current direction of the first bridge circuit (H-bridge 1). A high level corresponds to the current direction of OUT1A→OUT1B, and a low level corresponds to OUT1B→OUT1A.
[0073] PHASE2 (pin 17): Controls the current direction of the second bridge circuit (H-bridge 2). Its function is the same as PHASE1. High level corresponds to OUT2A→OUT2B, and low level corresponds to OUT2B→OUT2A.
[0074] The output pin is connected to the magnetic coil:
[0075] First bridge circuit (H-bridge 1):
[0076] OUT1A (pin 23) and OUT1B (pin 22): These are connected to the two ends of the first magnetic coil (motor winding A) respectively, and the output current drives the coil to generate a magnetic field.
[0077] Second bridge circuit (H-bridge 2):
[0078] OUT2A (pin 19) and OUT2B (pin 18): These are connected to the two ends of the second magnetic coil (motor winding B) respectively, and the output current drives the coil to generate a magnetic field.
[0079] 2. Working mechanism of bridge circuit
[0080] The first bridge circuit (H-bridge 1): The current flowing through the first magnetic coil is adjusted according to the logic level output by the microcontroller through the DIO2 and DII2 pins; the current direction is controlled by the level of the PHASE1 pin (DPH1), thereby changing the magnetic field polarity (N / S pole) of the first magnetic coil.
[0081] Output the first speed control signal: containing current magnitude and direction information, which directly acts on the first magnetic coil to adjust its magnetic field strength and direction.
[0082] Second bridge circuit (H-bridge 2):
[0083] Symmetrical to H-bridge 1, it receives microcontroller signals through the DIO1, DII1 and PHASE2 pins (DPH2) to adjust the magnitude and direction of the current in the second magnetic coil.
[0084] Output the second speed control signal: containing current magnitude and direction information, which directly acts on the second magnetic coil to adjust its magnetic field strength and direction.
[0085] 3. Specific implementation of speed control
[0086] Current adjustment (speed control basics):
[0087] By using the level combinations (such as 00, 01, 10, 11) of the DIO1, DII1, DIO2, and DII2 pins, the switching states of H-bridge 1 and H-bridge 2 can be controlled to achieve different current output modes.
[0088] for example:
[0089] Full-step drive mode: maximum current, fastest magnetic rotor speed;
[0090] Half-step drive mode: The current switches step by step to achieve more precise speed control.
[0091] Current direction switching (steering control):
[0092] By switching the level of the PHASE1 and PHASE2 pins (DPH2), the current direction of H-bridge 1 and H-bridge 2 is switched, the magnetic field polarity of the magnetic coil is changed, and the direction of the electromagnetic force on the magnetic rotor is reversed, thus achieving forward or reverse rotation.
[0093] Coordinated control (closed-loop regulation):
[0094] When the microcontroller detects a deviation between the actual rotational speed and the preset value, it sends a drive control signal to the L6219 via the GPIO pin:
[0095] Low rotation speed: Increase the current output mode of DIO1 / DII1 / DII2 / DII2 pins (e.g., switch from half-step to full-step) to increase the magnetic field strength and drive the magnetic rotor to accelerate.
[0096] If the rotational speed is too high: reduce the current output or switch the current direction, reduce the magnetic field strength or brake to slow down the magnetic rotor.
[0097] Through the real-time coordinated adjustment of H-bridge 1 and H-bridge 2, a closed-loop control circuit is formed, which consists of "detecting deviation → adjusting current → changing magnetic field → correcting speed".
[0098] The pinout of the STM32F103C8T6 microcontroller (pins 1-48) is as follows:
[0099] Power-related pins
[0100] 1. VBAT (pin 1): Backup power supply pin. When the main power supply VDD fails, it supplies power to the RTC and backup registers to maintain data and timing functions.
[0101] 2. VDD_1 (pin 24), VDD_2 (pin 36), VDD_3 (pin 48): Digital power supply pins, providing a 3.3V operating voltage for the internal digital circuits.
[0102] 3. VSS_1 (pin 23), VSS_2 (pin 35), VSS_3 (pin 47): Digital ground pins, providing a potential reference for digital circuits.
[0103] 4. VDDA (pin 8): Analog power supply pin, used to power analog circuits such as ADC.
[0104] 5. VSSA (pin 9): Analog ground pin, providing a potential reference for analog circuits.
[0105] Clock and reset pins
[0106] 6. PC14 OSC32_IN (pin 3): 32.768kHz low-speed crystal oscillator input pin, providing a timing clock for the RTC, and can be used as a GPIO pin.
[0107] 7. PC15 OSC32_OUT (4 pins): 32.768kHz low-speed crystal oscillator output pin, which can be used as a GPIO pin.
[0108] 8. PD0 OSC_IN (pin 5): System crystal input pin, which works with PD1 to provide the main clock signal and determine the chip's operating frequency.
[0109] 9. PD1 OSC_OUT (pin 6): System crystal oscillator output pin.
[0110] 10. NRST (pin 7): Reset pin, active low. Pulling it low resets the internal registers and program counter.
[0111] General Purpose Input / Output (GPIO) Pins
[0112] 11. PA0 WKUP (pin 10): General purpose GPIO pin, configured as a wake-up pin to wake up the chip from low power mode.
[0113] 12. PA1 (pin 11, marked HALL): Connects to the magnetic induction circuit, receives the conditioned pulse signal to calculate the rotor speed.
[0114] 13. PA2 (pin 12, marked TS): Extended GPIO pin.
[0115] 14. PA3 (pin 13, marked DO): Extended GPIO pin.
[0116] 15. PA4 (pin 14, labeled BENG1A): Extended GPIO pin.
[0117] 16. PA5 (pin 15, marked BENG1B): Extended GPIO pin.
[0118] 17. PA6 (pin 16, marked BENG2A): Extended GPIO pin.
[0119] 18. PA7 (pin 17, labeled BENG2B): Extended GPIO pin.
[0120] 19. PB0 (pin 18, marked STIRA): Extended GPIO pin.
[0121] 20. PB1 (pin 19, marked STIRB): Extended GPIO pin.
[0122] 21. PB2 (pin 20, marked INT): Interrupt input GPIO pin, receives external interrupt signals to trigger the interrupt handler.
[0123] 22. PB10 (pin 21): GPIO pin, used for input and output signals, multiplexed as a communication interface pin such as SPI.
[0124] 23. PB11 (pin 22): GPIO pin, used for input and output signals, multiplexed as a communication interface pin such as SPI.
[0125] 24. PB12 (pin 25, marked POSITION1): GPIO pin used for feedback control functions, transmitting position or status feedback signals.
[0126] 25. PB13 (pin 26, marked POSITION2): GPIO pin used for feedback control functions, transmitting position or status feedback signals.
[0127] 26. PA15 (pin 38), PA14 (pin 37), PA13 (pin 34): GPIO pins. PA13 / 14 / 15 are multiplexed as JTAG TMS / TCK / TDI pins respectively.
[0128] 27. PA12 (pin 33, marked DP): Spare GPIO pin.
[0129] 28. PA11 (pin 32, marked DM): Spare GPIO pin.
[0130] 29. PA10 (pin 31, marked F103_UART_RX): UART receive pin, used to receive data sent by external devices via UART.
[0131] 30. PA9 (pin 30, marked F103_UART_TX): UART transmit pin, used to send data to external devices via UART.
[0132] 31. PA8 (pin 29, marked DPWMCON): Spare GPIO pin.
[0133] 32. PB15 (pin 28): Spare GPIO pin.
[0134] 33. PB14 (pin 27): Spare GPIO pin.
[0135] 34. PB9 (pin 46, marked CANTX): CAN bus transmit pin, used to send data to the CAN bus.
[0136] 35. PB8 (pin 45, marked CANRX): CAN bus receive pin, receives CAN bus data.
[0137] 36. PB7 (pin 42), PB6 (pin 41), PB5 (pin 40), PB4 (pin 39): GPIO pins, connected to the driver circuit to transmit drive control signals.
[0138] 37. PB3 (pin 38): Spare GPIO pin.
[0139] Communication interface pins
[0140] 38. CANRX (pin 45), CANTX (pin 46): CAN bus communication pins, enabling high-speed data transmission and reception with other CAN devices.
[0141] 39. F103_UART_RX (pin 31), F103_UART_TX (pin 30): UART communication pins, used for asynchronous serial data transmission with external devices.
[0142] Debug and Start-up Pins
[0143] 40. BOOT0 (pin 44): Boot mode selection pin. The level state after reset determines whether the chip boots from main flash memory, system memory, or SRAM.
[0144] 41. SWDIO (pin 34), SWCLK (pin 37): SWD debug interface pins, used for program download, debugging and online simulation.
[0145] Other function pins
[0146] 42. PC13 TAMPER RTC (pin 2): Multi-function pin used for functions such as intrusion detection (TAMPER) or RTC alarm output.
[0147] 43. SCL (multiplexed with other pins), SDA (multiplexed with other pins): I2C communication pins. SCL is the clock line and SDA is the data line, used for communication with I2C devices.
[0148] 44. DIO2 (pin 42), DII2 (pin 41), DPH2 (pin 40), DIO1 (pin 38), DII1 (pin 37), DPH1 (pin 39): Connected to the drive circuit, transmitting drive control signals to adjust the output current mode and magnetic field direction.
[0149] The peripheral components of the microcontroller circuit are described below:
[0150] Capacitor (starting with C)
[0151] C11 (100nF): Together with C13, it forms a power supply filter circuit. The 100nF capacitor has a good ability to filter out high-frequency noise, which can remove high-frequency noise on the power line, making the 3.3V power supply cleaner and providing a stable power supply environment for the microcontroller.
[0152] C13 (10μF): When paired with C11, the 10μF large-capacity capacitor is mainly used to filter out low-frequency noise, store a certain amount of electrical energy, and play a buffering role when the power supply fluctuates, so as to maintain the stability of the power supply voltage.
[0153] C15 (100nF): Together with R21, it forms an RC filter circuit to further filter out high-frequency interference signals at the power input, ensuring that the voltage input to the microcontroller's power pin is stable and pure, and reducing the impact of power supply noise on the chip's operation.
[0154] C16 (100nF): Connected to the power supply line, it acts as a bypass filter, which can bypass high-frequency noise on the power supply line to ground, making the power supply more stable and ensuring the normal operation of the microcontroller.
[0155] C17 (100nF): Similar to C16, it filters the power supply, removes high-frequency interference, and provides a stable power supply voltage for the relevant pins.
[0156] C18 (10μF): A large-capacity capacitor used in power supply circuits to store energy, filter low-frequency noise, stabilize power supply voltage, and ensure stable operation of the microcontroller.
[0157] C19 (100nF): Connected to the power line, it filters out high-frequency noise in the power supply and provides clean power to the power pins of the microcontroller.
[0158] Resistor (starting with R)
[0159] R21 (10kΩ): Together with C15, it forms an RC filter circuit. Utilizing its own impedance characteristics, it limits current changes and, in conjunction with the capacitor, filters out high-frequency noise in the power supply, stabilizing the power supply voltage.
[0160] R22 (10kΩ): This may be a pull-up or pull-down resistor, used to provide a default high or low level for the corresponding pin, ensuring that the pin is in a stable logic state when not driven by an external signal, thus enhancing signal stability.
[0161] R38 (3.3kΩ) and R39 (3.3kΩ): These are pull-up resistors for the I2C communication interfaces (SCL, SDA). In the I2C bus, pull-up resistors pull the bus signals high, ensuring that the signals are at a high level in the idle state, while also improving the signal driving capability and ensuring accurate data transmission.
[0162] The pin descriptions for the L6219 driver chip (pins 1-24) are as follows:
[0163] Output pin
[0164] 1. OUT1A (pin 1): Connects to the first bridge circuit (H-bridge 1), outputs current to drive the first magnetic coil connected to it, generating a magnetic field. By adjusting the magnitude and direction of the output current, the magnetic field strength and polarity of the first magnetic coil can be controlled.
[0165] 2. OUT2A (pin 2): Connects to the second bridge circuit (H-bridge 2), outputs current to drive the second magnetic coil connected to it, generating a magnetic field. By adjusting the magnitude and direction of the output current, the magnetic field strength and polarity of the second magnetic coil can be controlled.
[0166] 3. OUT2B (pin 4): Together with OUT2A, it forms the output terminal of the second bridge circuit (H-bridge 2). By controlling the direction and magnitude of the current, the magnetic field strength and direction of the second magnetic coil can be adjusted.
[0167] 4. OUT1B (pin 21): Together with OUT1A, it forms the output terminal of the first bridge circuit (H-bridge 1). By controlling the direction and magnitude of the current, the magnetic field strength and direction of the first magnetic coil can be adjusted.
[0168] Current sensing pin
[0169] 5. Sense1 (pin 23): Used to detect the output current of the first bridge circuit (H-bridge 1), convert the current signal into a voltage signal and feed it back to the internal circuit of the chip for current regulation and protection operations, ensuring that the current of the first magnetic coil is within the appropriate range.
[0170] 6. Sense2 (pin 3): Used to detect the output current of the second bridge circuit (H-bridge 2), convert the current signal into a voltage signal and feed it back to the internal circuit of the chip for current regulation and protection operations, ensuring that the current of the second magnetic coil is within the appropriate range.
[0171] Comparison input pin
[0172] 7. COMP.INPUT1 (pin 22): First comparator input pin, receives external input signals (such as current feedback signals, etc.), compares them with internal reference signals, and is used to control the output state of the first bridge circuit (H-bridge 1), thereby adjusting the magnetic field of the first magnetic coil.
[0173] 8. COMP.INPUT2 (pin 5): Second comparator input pin, receives external input signals (such as current feedback signals, etc.), compares them with internal reference signals, and is used to control the output state of the second bridge circuit (H-bridge 2), thereby adjusting the magnetic field of the second magnetic coil.
[0174] Logic input pins
[0175] 9. IO1 (pin 19): Connected to the GPIO pin of the microcontroller, used to control the output current mode of the second bridge circuit (H-bridge 2). By changing the level of this pin, the operating mode of H-bridge 2 (such as full-step, half-step drive, etc.) can be adjusted, thereby changing the current magnitude of the second magnetic coil.
[0176] 10. IO2 (pin 8): Connected to the GPIO pin of the microcontroller, used to control the output current mode of the first bridge circuit (H-bridge 1). By changing the level of this pin, the operating mode of H-bridge 1 can be adjusted (such as full-step, half-step drive, etc.), thereby changing the current of the first magnetic coil.
[0177] 11. DII1 (pin 16): Connects to the GPIO pin of the microcontroller and works with IO1 to control the output current mode of the second bridge circuit (H-bridge 2) to precisely adjust the current of the second magnetic coil.
[0178] 12. DII2 (pin 9): Connects to the GPIO pin of the microcontroller and works with IO2 to control the output current mode of the first bridge circuit (H-bridge 1) to precisely adjust the current of the first magnetic coil.
[0179] 13. DIO1 (pin 20): Connects to the GPIO pin of the microcontroller. It works with DIO1 to control the output current mode of the second bridge circuit (H-bridge 2) and precisely adjust the current of the second magnetic coil.
[0180] 14. DIO2 (pin 7): Connects to the GPIO pin of the microcontroller. It works with DIO2 to control the output current mode of the first bridge circuit (H-bridge 1) and precisely adjust the current of the first magnetic coil.
[0181] Phase control pin
[0182] 15. Phase 1 (pin 15, labeled DPH1): Connected to the GPIO pin of the microcontroller, controlling the current direction of the first bridge circuit (H-bridge 1). When high, the current direction is OUT1A→OUT1B; when low, the current direction is OUT1B→OUT1A, thereby changing the magnetic field polarity of the first magnetic coil and controlling the direction and speed of the magnetic rotor.
[0183] 16. Phase 2 (pin 11, marked DPH2): Connected to the GPIO pin of the microcontroller, it controls the current direction of the second bridge circuit (H-bridge 2). When the level is high, the current direction is OUT2A→OUT2B, and when the level is low, the current direction is OUT2B→OUT2A, thereby changing the magnetic field polarity of the second magnetic coil and realizing the control of the direction and speed of the magnetic rotor.
[0184] power pin
[0185] 17. VS (pin 24): Power supply pin, connected to an external power source, provides operating voltage for the internal power circuit of the chip, drives the magnetic coil to generate a magnetic field, and is the energy source for the drive circuit to work.
[0186] 18. VSS (pin 13): Ground pin, providing a stable potential reference point for the chip, ensuring normal circuit operation and guaranteeing the integrity of the current loop.
[0187] 19. VREF1 (pin 14): Reference voltage pin, providing a reference voltage for the chip's internal current detection, comparison, and other circuits, ensuring accurate operation of the relevant circuits and making current detection and control more precise.
[0188] Other pins
[0189] 20. GND (pin 18): Ground pin, used for signal grounding, providing a potential reference for the internal signal circuits of the chip, and ensuring the stability of signal transmission.
[0190] 21. II1 (pin 17): Pin related to current detection or control, participates in the chip's internal current control logic, and assists in adjusting the magnitude and stability of the output current.
[0191] 22. RC1 (pin 14): Connects to external resistors and capacitors to adjust the parameters of the chip's internal circuitry (such as time constant), affecting the circuit's response speed, control accuracy, etc., and optimizing the performance of the drive circuit.
[0192] 23. RC2 (pin 12): Connects to external resistors and capacitors to adjust the parameters of the chip's internal circuitry (such as time constant), affecting the circuit's response speed, control accuracy, etc., and optimizing the performance of the drive circuit.
[0193] 24. GND2 (pin 7): Ground pin, used for signal grounding, providing a potential reference for the internal signal circuit of the chip, and ensuring the stability of signal transmission.
[0194] The peripheral components of the drive circuit are as follows:
[0195] capacitance
[0196] C1 (10μF): Together with C2, it forms a power supply filter circuit. The large 10μF capacitor is mainly used to filter out low-frequency noise, store a certain amount of electrical energy, and act as a buffer during power fluctuations to maintain the stability of the power supply voltage of the drive circuit.
[0197] C2 (100nF): When used in conjunction with C1, it has a good ability to filter out high-frequency noise and can remove high-frequency noise on the power line, making the power supply of the drive circuit cleaner.
[0198] C3 (820pF): Together with R4, it forms an RC filter circuit to filter out high-frequency interference signals, ensuring that the signals input to the relevant pins of the drive circuit are stable and pure, and reducing the impact of signal noise on the circuit operation.
[0199] C4 (820pF): Together with R3, it forms an RC filter circuit to filter out high-frequency interference signals, making the signal input to the drive circuit more stable and ensuring the normal operation of the circuit.
[0200] C5 (100nF): Connected to the power line, it acts as a bypass filter, which can bypass high-frequency noise on the power line to ground, making the power supply of the drive circuit more stable.
[0201] C6 (820pF): Together with R5, it forms an RC filter circuit to filter out high-frequency interference signals, optimize the signal quality of the drive circuit, and ensure stable circuit operation.
[0202] C7 (820pF): Together with R6, it forms an RC filter circuit to filter out high-frequency interference signals, reduce the impact of signal noise on the drive circuit, and ensure reliable circuit operation.
[0203] resistance
[0204] R1 (3.3Ω): Connected in series in the power supply line, it serves to limit current and prevent excessive current from damaging the drive circuit. It can also suppress high-frequency noise on the power supply line to a certain extent.
[0205] R2 (3.3Ω): Connected in series in the circuit, it is used to limit the current and protect other components in the circuit, while also having a certain regulating effect on the signal.
[0206] R3 (1kΩ): Together with C4, it forms an RC filter circuit. It uses its own impedance characteristics to limit current changes and, together with the capacitor, filters out high-frequency noise and stabilizes the input signal.
[0207] R4 (1kΩ): Together with C3, it forms an RC filter circuit to limit current changes, filter out high-frequency interference signals, and make the signal input to the drive circuit more stable.
[0208] R5 (56kΩ): Together with C6, it forms an RC filter circuit to adjust parameters such as the circuit's time constant, filter out high-frequency noise, and optimize the signal characteristics of the drive circuit.
[0209] R6 (56kΩ): Together with C7, it forms an RC filter circuit to adjust circuit parameters, filter out high-frequency interference signals, and ensure the stability of the drive circuit signal.
[0210] Since the signal conditioning circuit is integrated on the microcontroller circuit, its output interface is built-in and not shown, and the signal receiving end of the microcontroller circuit is also not identified. The feedback control circuit is integrated into the microcontroller circuit, and its signal receiving end is built-in and not identified. Other unidentified components in this application may also be for similar reasons, and there is no suspicion of insufficient disclosure.
[0211] Furthermore, the microcontroller circuit in this application uses the STM32F103C8T6 microcontroller. This model is a mature commercial chip, and its internal structure, pin functions, and electrical characteristics are publicly available in semiconductor manufacturer official documents, electronic technology manuals, and online resources. The specification details the functions of each pin in the microcontroller circuit. For example, power-related pins (VBAT, VDD, VSS, etc.) clearly define the power supply and potential reference functions; clock and reset pins (PC14 - OSC32_IN, NRST, etc.) explain the clock input / output and reset functions; general purpose input / output (GPIO) pins (PA1, PB12, etc.) detail their connection to other circuits and signal transmission functions; communication interface pins (CANRX, CANTX, etc.) clearly define the communication functions; and debug and startup pins (BOOT0, SWDIO, etc.) and other functional pins (PC13 - TAMPER - RTC, SCL, etc.) also have their specific uses explained. Meanwhile, the parameters and technical functions of the peripheral structural components of the microcontroller circuit (such as capacitors C11-C19, resistors R21, R22, R38, R39, etc.) are also described in detail, enabling those skilled in the art to build the corresponding microcontroller circuit based on this information and the publicly available STM32F103C8T6 microcontroller datasheet, and realize its function in the magnetic speed circuit with feedback.
[0212] This application uses the L6219 stepper motor driver as its driving circuit. This model is a common and mature product on the market, and its datasheet, technical specifications, and other information can be obtained from the manufacturer's website or electronic component databases. The manual provides a detailed explanation of the functions of each pin of the L6219, including the output pins (OUT1A, OUT2A, etc.), which clearly define their function in driving the magnetic coil to generate a magnetic field and controlling the magnetic field strength and polarity; the current detection pins (Sense1, Sense2), which explain their function in detecting and adjusting the output current; the comparison input pins (COMP.INPUT1, COMP.INPUT2), which explain their function in comparing with an internal reference signal to control the output state of the bridge circuit; the logic input pins (IO1, DIO2, etc.) and phase control pins (Phase1, Phase2), which detail their function in controlling the current mode and magnetic field direction; and the power supply pins (VS, VSS, etc.) and other pins (GND, II1, etc.), all with clearly defined functions. Furthermore, the parameters and technical functions of the peripheral components of the driving circuit (such as capacitors C1-C7, resistors R1-R6, etc.) are also explained in detail. Therefore, based on this information and the publicly available L6219 stepper motor driver data, those skilled in the art can build a suitable drive circuit to achieve the function of adjusting the magnetic field of the magnetic coil and controlling the speed of the magnetic rotor in a magnetic speed circuit with feedback.
[0213] From the perspective of a person skilled in the art who meets the requirements of the examination guidelines, the specific implementation of the aforementioned microcontroller circuit and driver circuit does not constitute an obstacle and there is no suspicion of insufficient disclosure.
[0214] The above-described magnetic rotation speed circuit with feedback can be applied in the following scenarios:
[0215] I. Motor Control and Drive System
[0216] Closed-loop speed control for various types of electric motors (such as DC motors, AC motors, and stepper motors).
[0217] Servo systems and variable frequency speed control systems (such as motor drives for industrial robots and CNC machine tools).
[0218] By installing magnetic gears, toothed discs, or permanent magnets on the motor rotor (or shaft) and using fixed induction coils (such as Hall sensors or electromagnetic induction coils), the periodic changes in the magnetic field when the rotor rotates cause the coils to generate an induced electromotive force (or Hall voltage).
[0219] The circuit converts the induced signal into a pulse frequency, calculates the rotational speed based on the frequency, and feeds it back to the controller (such as MCU or DSP) to achieve real-time adjustment and stable control of the motor speed (closed-loop feedback).
[0220] II. Automotive Electronic Systems
[0221] Vehicle speed sensor (detects wheel speed and is used in ABS anti-lock braking system and ESP vehicle stability system).
[0222] Engine speed monitoring (such as crankshaft position sensor, camshaft position sensor).
[0223] Transmission speed detection (automatic transmission shift logic control).
[0224] Taking a vehicle speed sensor as an example, a toothed ring (made of magnetic material) is mounted on the wheel hub, and the sensor contains a permanent magnet and an induction coil. When the wheel rotates, the tooth tips and grooves of the toothed ring alternately pass through the sensor, causing a change in magnetic resistance, and the coil generates an alternating voltage signal.
[0225] The circuit amplifies and shapes the signal into a square wave, and calculates the wheel speed by measuring the pulse frequency. This speed is then used in vehicle control systems (such as ABS, which uses the speed difference to determine if the wheel is locked).
[0226] III. Consumer Electronics and Home Appliances
[0227] Smart home appliances (such as motor speed monitoring of washing machine and air conditioner compressors).
[0228] Speed feedback for handheld power tools (such as electric drills and electric saws).
[0229] Smartwatches or fitness devices (detect flywheel speed and calculate motion data).
[0230] Taking an air conditioner compressor as an example, the controller monitors the motor speed through a magnetic speed circuit and combines it with temperature sensor data to automatically adjust the compressor power, achieving energy saving and precise temperature control.
[0231] In power tools, speed signals are used to trigger overload protection or speed control functions (such as constant speed control).
[0232] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A magnetic tachometer circuit with feedback, characterized by include: The system includes a magnetic induction circuit, a signal conditioning circuit, a microcontroller circuit, a feedback control circuit, and a drive circuit. The magnetic induction circuit is connected to the signal conditioning circuit to sense changes in the magnetic field of the magnetic coil, generate an induction signal, and transmit it to the signal conditioning circuit. The signal conditioning circuit is connected to the microcontroller circuit to condition the induction signal, generate a pulse signal, and transmit it to the microcontroller circuit. The microcontroller circuit is connected to the feedback control circuit to compare the square wave pulse signal with a preset speed threshold to check if there is a deviation between the speed of the magnetic rotor and the preset speed. If there is a deviation, a speed deviation feedback signal is generated and transmitted to the feedback control circuit. The feedback control circuit is connected to the drive circuit and is used to generate a drive control signal based on the speed deviation feedback signal and transmit it to the drive circuit to generate a speed control signal to adjust the magnetic field of the magnetic coil and adjust the speed of the magnetic rotor accordingly.
2. The magnetic speed sensing circuit with feedback according to claim 1, characterized in that, The number of magnetic coils is four, and a magnetic induction circuit is fixed between every four magnetic coils.
3. The magnetic speed sensing circuit with feedback according to claim 1, wherein, The magnetic induction circuit includes a Hall effect sensor fixed between four magnetic coils. The Hall effect sensor is equipped with at least a first pin (1), a second pin (2), and a third pin (3). The first pin (1) is connected to the power supply (VCC), the second pin (2) is connected to ground (GND), and the third pin (3) is connected to the input interface (PA1) of the signal conditioning circuit to convert the magnetic field change of the sensed magnetic coils into an electrical signal and use it as an induction signal.
4. The magnetic speed sensing circuit with feedback according to claim 1, wherein, The signal conditioning circuit is integrated on the microcontroller circuit and is equipped with at least an input interface and an output interface. The input interface is connected to the magnetic induction circuit to receive the induction signal, and is used to amplify, filter, and shape the induction signal to generate a pulse signal, which is then output to the microcontroller circuit through the output interface.
5. The magnetic speed sensing circuit with feedback according to claim 1, wherein, The microcontroller circuit is equipped with at least a signal receiving end and a signal output end. The signal receiving end is connected to the signal conditioning circuit to receive pulse signals, count the frequency of the pulse signals, calculate the real-time rotational speed of the magnetic rotor based on the counting results, compare the calculated rotational speed with a preset rotational speed threshold to generate a pulse signal, and output it to the feedback control circuit through the signal output end.
6. The magnetic speed sensing circuit with feedback according to claim 1, wherein, The feedback control circuit is integrated into the microcontroller circuit and is equipped with at least a signal receiving end and a signal output end. The signal receiving end is connected to the microcontroller circuit to receive the speed deviation feedback signal to generate a drive control signal and output it to the drive circuit through the signal output end.
7. The magnetic speed sensing circuit with feedback according to claim 1, characterized in that, The drive circuit includes a stepper motor driver, which is configured with a signal receiving end and a signal output end. The signal receiving end is connected to the signal output end of the feedback control circuit and is used to receive the drive control signal output by the feedback control circuit to generate a speed control signal. The signal output end is connected to the magnetic coil to adjust the magnetic field of the magnetic coil and adjust the speed of the magnetic rotor accordingly.
8. The magnetic speed sensing circuit with feedback according to claim 7, characterized in that, The stepper motor driver is also equipped with logic input pins and phase control pins, which are connected to the GPIO pins of the microcontroller circuit to generate speed control signals with adjustable magnitude and direction according to the drive control signal.
9. The magnetic speed sensing circuit with feedback according to claim 8, characterized in that, The stepper motor driver includes a first bridge circuit and a second bridge circuit. The first bridge circuit is connected to a first magnetic coil to generate a first speed control signal with adjustable magnitude and direction according to a drive control signal under the control of a microcontroller circuit. The second bridge circuit is connected to a second magnetic coil to generate a second speed control signal with adjustable magnitude and direction according to a drive control signal.
10. The magnetic speed sensing circuit with feedback according to claim 9, characterized in that, The first bridge circuit has a first output pin and a second output pin, which are respectively connected to one end of the first magnetic coil to adjust the magnetic field change of the first magnetic coil through a first speed control signal. The second bridge circuit has a third output pin and a fourth output pin, which are respectively connected to one end of the second magnetic coil to adjust the magnetic field change of the first magnetic coil through a second speed control signal.