Motor based on Hall sensor and trigger
By simplifying the motor control circuit of Hall sensors and triggers, the problems of complexity and high resource consumption in existing motor control are solved, achieving efficient and safe motor control and reducing failure rate and resource consumption.
Patent Information
- Application Number
- CN202520344531.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-01
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2035-03-01
AI Technical Summary
Existing motor control circuits are complex, and their real-time performance and reliability are difficult to meet. In addition, the MCU consumes a lot of resources and has a high failure rate.
A motor control method based on Hall sensors and triggers is adopted to simplify circuit connections. The MCU is connected to specific pins of the stepper motor controller and Hall sensors to optimize motor control, reduce MCU I/O port resource usage, and adopt a simple hardware structure and real-time control strategy.
It achieves efficient, safe and reliable real-time control of the motor, reduces the failure rate, improves work efficiency, and saves MCU resources.
Smart Images

Figure CN223843661U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of motor technology, and in particular to a motor based on a Hall sensor and a trigger. Background Technology
[0002] In practical applications of electric motors, since the motors themselves lack position sensing capabilities, Hall effect sensors are typically integrated into the mechanical structure to detect the motor's position. For example, in automotive lighting, the lighting controller involves controlling various functional motors using Hall effect sensors, including but not limited to ALS motors, light-type motors, and AFS motors. Existing technologies for motor control circuits and methods are relatively complex. Because motor control requires high real-time performance and high reliability, and the increasingly complex functional logic of the microcontrollers (MCUs) used for control requires significant computing power, using CPU polling to control the motor's steps and start / stop functions is difficult to meet real-time and reliability requirements and is prone to malfunctions. Utility Model Content
[0003] In view of the shortcomings of the existing technology, the purpose of this utility model is to provide a motor based on a Hall sensor and a trigger to solve the above technical problems.
[0004] The technical solution adopted in this utility model is as follows:
[0005] A motor based on a Hall sensor and a trigger includes an MCU, a stepper motor, a stepper motor controller, and a Hall sensor. The stepper motor has a Hall sensor installed in its transmission mechanism; the MCU is connected to the stepper motor controller circuit; the stepper motor controller is connected to the stepper motor circuit; the stepper motor is electrically connected to the Hall sensor; and the Hall sensor is connected to the MCU circuit.
[0006] The motor based on Hall sensors and triggers is characterized in that the stepper motor controller includes a control IC, and in order to achieve the corresponding control function, the microcontroller includes the following specific circuit connections with the stepper motor controller control IC:
[0007] The MCU has a pin P00, and the stepper motor controller IC has a corresponding pin 2 for error status PIN.
[0008] The MCU has a pin P01, and the stepper motor controller IC has a corresponding pin 1 connected to its circuit for setting the rotation direction.
[0009] The MCU has a pin P02, and the control IC connected to the stepper motor controller has a corresponding pin 8 for enabling the PIN.
[0010] The MCU has a pin P03, and the stepper motor controller IC has a corresponding pin 3 connected to its circuit, used to control the number of steps the motor runs;
[0011] The MCU has a pin P21, and the stepper motor controller IC has a corresponding pin 7 connected to its circuit for setting the motor working state 1.
[0012] The MCU has a pin P50, and the stepper motor controller IC has a corresponding pin 6 connected to its circuit for setting the motor working state 2.
[0013] The MCU has a pin P51, and the stepper motor controller control IC has a corresponding pin 9 connected to its circuit for use in sleep mode.
[0014] The stepper motor has coils A1, A2, B1, and B2. The stepper motor controller is connected to the stepper motor as follows:
[0015] The stepper motor controller has pin 12, which is connected to the stepper motor coil A1.
[0016] The stepper motor controller has pin 22, which is connected to the stepper motor coil A2.
[0017] The stepper motor controller has pin 19, which is connected to the stepper motor coil B1.
[0018] The stepper motor controller has pin 11, which is connected to the stepper motor coil B2.
[0019] The MCU has a pin P70, and the Hall sensor circuit is connected to the MCU pin P70.
[0020] This invention relates to a motor and its control method based on Hall effect sensors and triggers. The design is rigorous and scientific, saves MCU I / O port resources, has a reasonable hardware structure and configuration, a simple circuit, and adopts appropriate methods for real-time and effective motor control. It has a low failure rate, is safe and reliable, and has high working efficiency. Attached Figure Description
[0021] The accompanying drawings, which are provided to further illustrate this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.
[0022] Figure 1 This is a basic block diagram of a motor based on existing technology using Hall sensors and triggers;
[0023] Figure 2This is a basic block diagram of the motor based on the Hall sensor and trigger of this utility model;
[0024] Figure 3 This is the electrical schematic diagram of the motor based on the Hall sensor and trigger of this utility model;
[0025] Figure 4 Timing diagram for initializing the PWM Channel;
[0026] Figure 5 Timing diagram for initializing the PWM Counter;
[0027] Figure 6 Timing diagram for initializing the PWM Trigger Counter;
[0028] Figure 7 The initialization and triggering timing diagram for the Hall sensor;
[0029] Figure 8 The sequence diagram for the CallBack Handler;
[0030] Figure 9 This is the schematic diagram of the MCU electrical connection.
[0031] The preferred embodiments of this utility model will be further described below with reference to the accompanying drawings. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this utility model clearer, the present utility model will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described below are only used to explain this utility model. Keywords that need attention in these descriptions, including "electrical signal connection," "circuit connection," "timing," "PWM channel," "PWM counter," and "callback processor," are only for the purpose of facilitating and simplifying the description of this utility model, and therefore should not be construed as limiting this utility model.
[0033] Example 1
[0034] like Figure 2 As shown, and see also Figure 3 and Figure 8In this embodiment, the motor based on a Hall sensor and trigger is a vehicle headlight stepper motor, controlled by a microcontroller and other peripherals. It includes a microcontroller (MCU), a stepper motor, a stepper motor controller, and a Hall sensor. In this embodiment, the microcontroller uses the Infineon Travo T2G series chip, preferably the Infineon Travo T2G CYT2B7x chip, with driver library version 7.9.0. The stepper motor controller uses the MPSMPQ6600L product from Silicon Source Systems, Inc. The stepper motor's transmission mechanism incorporates a Hall sensor. The microcontroller is circuitically connected to the stepper motor controller, which is in turn circuitically connected to the stepper motor. The stepper motor is electrically connected to the Hall sensor, and the Hall sensor is also circuitically connected to the microcontroller.
[0035] like Figure 3 and Figure 9 As shown, the stepper motor controller includes a control IC (chip). In this embodiment, its model is MPQ6600L. To achieve the corresponding control function, the microcontroller includes the following circuit connection with the stepper motor controller control IC MPQ6600L:
[0036] The MCU has a pin P00 (DI MOTOR1 FLTN) for the error status PIN, and the stepper motor controller control IC has a corresponding pin 2 (nFAULT) for the error status PIN (only for MCU sensing signal feedback);
[0037] The MCU has a pin P01 (DO MOTOR1 DIR) for setting the rotation direction, and the stepper motor controller IC has a corresponding pin 1 (DIR) connected to its circuit for setting the rotation direction.
[0038] The MCU has an enable pin P02 (DO MOTOR1 ENBL), and the control IC connected to the stepper motor controller has a pin 8 (ENBL) for enabling the PIN.
[0039] The MCU has a pin P03 (DPO MOTOR1 STEP) for controlling the number of steps the motor runs, and the stepper motor controller IC has a corresponding pin 3 (STEP) connected to its circuit to input PWM pulses to control the number of steps the motor runs.
[0040] The MCU has a pin P21 (DO MOTOR1 MS1) for setting the motor operating state 1, and the stepper motor controller control IC has a corresponding pin 7 (MS1) connected to its circuit for setting the motor operating state 1.
[0041] The MCU has a pin P50 (DO MOTOR1 MS2) for setting the motor operating state 2, and the stepper motor controller control IC has a corresponding pin 6 (MS2) connected to its circuit for setting the motor operating state 2.
[0042] The MCU has a sleep state PIN on pin P51 (DO MOTOR1 SLEEPN), and the stepper motor controller control IC has a corresponding pin 9 (nSLEEP) connected to its circuit for the sleep state PIN (only for MCU sensing signal feedback).
[0043] The stepper motor has coils A1, A2, B1, and B2. The stepper motor controller is connected to the stepper motor as follows:
[0044] The stepper motor controller has pin 12 (AOUT1), which is connected to the stepper motor coil A1.
[0045] The stepper motor controller has pin 22 (AOUT2), which is connected to the stepper motor coil A2.
[0046] The stepper motor controller has pin 19 (BOUT1), which is connected to the stepper motor coil B1.
[0047] The stepper motor controller has pin 11 (BOUT2), which is connected to the stepper motor coil B2.
[0048] The MCU has a pin P70 (SENSOR GLW), and the Hall sensor circuit is connected to the MCU pin P70 (SENSOR GLW) in order for the MCU to receive the status signal output by the Hall sensor and thus know the position of the stepper motor.
[0049] See also Figure 1 As shown, compared with existing technical solutions, this invention simplifies the control circuit and the corresponding control method. Existing technologies require an additional I / O port on the MCU to receive the PWM pulses from the stepper motor controller (pin 3.STEP of the MPQ6600L control IC), which leads to the following problems:
[0050] 1. Higher circuit and connection complexity;
[0051] 2. Higher failure rate;
[0052] 3. It consumes more I / O port resources of the MCU.
[0053] This invention provides a method for controlling a motor based on a Hall sensor and a trigger. In this embodiment, a stepper motor is controlled. After power-on, the MCU sequentially initializes the PWM peripheral and the Hall sensor through steps A, B, and C. The motor then enters standby mode. When the user issues a motor start command, the system calls step D and executes it repeatedly until the stop condition is met, at which point step F is called to stop the motor. The specific method steps are as follows:
[0054] Step A: Turn on the motor
[0055] 1. Enables power supply to the motor and Hall sensor;
[0056] 2. Register the Hall sensor rising edge interrupt (RISING);
[0057] 3. Register the Hall sensor falling edge interrupt (FALLING);
[0058] 4. Set the motor's running direction;
[0059] 5. Start the PWM driver, and the motor begins to start;
[0060] 6. Wait for the Hall sensor interrupt to trigger and execute the corresponding logic processing;
[0061] Step B: Initialize the PWM Generator (PWM generator), see [link / reference] Figure 4 The described timing sequence refers to the MCU software's HAL (Hardware Abstraction Layer) calling Infineon's driver library to initialize the TCPWM peripheral. Figure 4 The described timing sequence mainly performs the following tasks:
[0062] 1. Configure the clock domain of the PWM Generator peripheral;
[0063] 2. Enable the frequency divider of the PWM Gen peripheral;
[0064] 3. Initialize the pins for peripheral multiplexing;
[0065] 4. Initialize the PWM Gen to motor-dedicated mode;
[0066] 5. Enable PWM Gen;
[0067] 6. Trigger PWM Gen;
[0068] Step C: Initialize the PWM Counter (see [link]). Figure 5The described timing sequence mainly involves the following tasks:
[0069] 1. Set the clock domain for the PWM Counter;
[0070] 2. Enable the PWM Counter peripheral divider;
[0071] 3. Initialize IRQ (Interrupt Request);
[0072] 4. Configure the interrupt vector table;
[0073] 5. Connect the PWM generator and the trigger;
[0074] 6. Initialize the PWM Counter;
[0075] 7. Enable PWM Counter;
[0076] Step D: Connect the TriggerOut of the PWM generator to the TriggerIn of the PWMCounter. See [link to relevant documentation]. Figure 6 The described timing sequence mainly involves the following tasks:
[0077] 1. Set the pulse count for the PWM Counter;
[0078] 2. Trigger the output of the PWM Gen;
[0079] 3. The PWM Gen triggers the counting behavior of the PWM Counter;
[0080] 4. The PWM Counter calls back to the HAL layer interface after the counting condition is met;
[0081] Step F: Callback Handler, see [link / reference] Figure 8 The described timing sequence mainly involves the following tasks:
[0082] 1. Call back the HAL layer interface after the conditions are met;
[0083] 2. HAL layer callback driven;
[0084] 3. Drive callbacks to the application layer;
[0085] 4. The application layer executes the corresponding strategy.
[0086] The stepper motor is in standby mode.
[0087] Example 2
[0088] This embodiment is basically similar to Embodiment 1, except that it uses a different set of steps to control a motor based on a Hall sensor and a trigger. In this embodiment, a stepper motor is controlled. After power-on, the MCU will sequentially initialize the PWM peripherals and the Hall sensor through steps A, B, and C. The motor will then be in standby mode. When the user gives a run command, the system enters step D and executes it cyclically. If the stopping condition (the object driven by the motor reaches a specified position) is met before the conditions set in the steps are satisfied, the Hall position sensor is triggered, and step E (stopping) is executed. The specific method steps are as follows:
[0089] Step A: Turn on the motor
[0090] 1. Enables power supply to the motor and Hall sensor;
[0091] 2. Register the Hall sensor rising edge interrupt (RISING);
[0092] 3. Register the Hall sensor falling edge interrupt (FALLING);
[0093] 4. Set the motor's running direction;
[0094] 5. Start the PWM driver, and the motor begins to start;
[0095] 6. Wait for the Hall sensor interrupt to trigger and execute the corresponding logic processing;
[0096] Step B: Initialize the PWM Generator (PWM generator), see [link / reference] Figure 4 The described timing sequence refers to the MCU software's HAL (Hardware Abstraction Layer) calling Infineon's driver library to initialize the TCPWM peripheral. Figure 4 The described timing sequence mainly performs the following tasks:
[0097] 1. Configure the clock domain of the PWM Generator peripheral;
[0098] 2. Enable the frequency divider of the PWM Gen peripheral;
[0099] 3. Initialize the pins for peripheral multiplexing;
[0100] 4. Initialize the PWM Gen to motor-dedicated mode;
[0101] 5. Enable PWM Gen;
[0102] 6. Trigger PWM Gen;
[0103] Step C: Initialize the PWM Counter (see [link]). Figure 5 The described timing sequence mainly involves the following tasks:
[0104] 1. Set the clock domain for the PWM Counter;
[0105] 2. Enable the PWM Counter peripheral divider;
[0106] 3. Initialize IRQ (Interrupt Request);
[0107] 4. Configure the interrupt vector table;
[0108] 5. Connect the PWM generator and the trigger;
[0109] 6. Initialize the PWM Counter;
[0110] 7. Enable PWM Counter;
[0111] Step D: Connect the TriggerOut of the PWM generator to the TriggerIn of the PWMCounter. See [link to relevant documentation]. Figure 6 The described timing sequence mainly involves the following tasks:
[0112] 1. Set the pulse count for the PWM Counter;
[0113] 2. Trigger the output of the PWM Gen;
[0114] 3. The PWM Gen triggers the counting behavior of the PWM Counter;
[0115] 4. The PWM Counter calls back to the HAL layer interface after the counting condition is met;
[0116] Step E: Hall sensor initialization and triggering, see [link to documentation] Figure 7 The described timing sequence mainly involves the following tasks:
[0117] 1. Enable the power supply pin of the Hall sensor;
[0118] 2. Initialize IRQ;
[0119] 3. Register callback functions with the HAL layer;
[0120] 4. Call back the HAL layer and driver when the event requirements are met;
[0121] The stepper motor is in standby mode.
[0122] The above description is merely one embodiment of this utility model. For those skilled in the art, various modifications and variations of this utility model are possible, which will not be elaborated upon here. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this utility model should be included within the scope of protection claimed by this utility model.
Claims
1. A motor based on a Hall sensor and a trigger, comprising an MCU, a stepper motor, a stepper motor controller, and a Hall sensor, characterized in that, The stepper motor has a Hall sensor in its transmission mechanism. The MCU is connected to the stepper motor controller circuit, the stepper motor controller is connected to the stepper motor circuit, the stepper motor is electrically connected to the Hall sensor, and the Hall sensor is connected to the MCU circuit.
2. The motor based on a Hall sensor and a trigger according to claim 1, characterized in that, The stepper motor controller includes a control IC. To achieve the corresponding control function, the MCU includes the following specific circuit connections with the stepper motor controller control IC: The MCU has a pin P00 (DI MOTOR1 FLTN), and the stepper motor controller IC has a corresponding pin 2 (nFAULT) for error status. The MCU has a pin P01 (DO MOTOR1 DIR), and the stepper motor controller IC has a corresponding pin 1 (DIR) connected to its circuit for setting the rotation direction. The MCU has a pin P02 (DO MOTOR1 ENBL), and the control IC connected to the stepper motor controller has a corresponding pin 8 (ENBL) for enabling the pin. The MCU has a pin P03 (DPO MOTOR1 STEP), and the stepper motor controller IC has a corresponding pin 3 (STEP) connected to its circuit, used to control the number of steps the motor runs; The MCU has a pin P21 (DO MOTOR1 MS1), and the stepper motor controller control IC has a corresponding pin 7 (MS1) connected to its circuit for setting the motor working state 1. The MCU has a pin P50 (DO MOTOR1 MS2), and the stepper motor controller control IC has a corresponding pin 6 (MS2) connected to its circuit for setting the motor working state 2; The MCU has a pin P51 (DO MOTOR1 SLEEPN), and the stepper motor controller control IC has a corresponding pin 9 (nSLEEP) connected to its circuit for use as a sleep state pin. The stepper motor has coils A1, A2, B1, and B2. The stepper motor controller is connected to the stepper motor as follows: The stepper motor controller has pin 12 (AOUT1), which is connected to the stepper motor coil A1. The stepper motor controller has pin 22 (AOUT2), which is connected to the stepper motor coil A2. The stepper motor controller has pin 19 (BOUT1), which is connected to the stepper motor coil B1. The stepper motor controller has pin 11 (BOUT2), which is connected to the stepper motor coil B2. The MCU has a pin P70 (SENSOR GLW), and the Hall sensor circuit is connected to the MCU pin P70 (SENSOR GLW).