WO2020221044A1 - Control method for step motor and mobile terminal - Google Patents

Control method for step motor and mobile terminal Download PDF

Info

Publication number
WO2020221044A1
WO2020221044A1 PCT/CN2020/085669 CN2020085669W WO2020221044A1 WO 2020221044 A1 WO2020221044 A1 WO 2020221044A1 CN 2020085669 W CN2020085669 W CN 2020085669W WO 2020221044 A1 WO2020221044 A1 WO 2020221044A1
Authority
WO
WIPO (PCT)
Prior art keywords
current
stepping motor
slider
limit
mobile terminal
Prior art date
Application number
PCT/CN2020/085669
Other languages
French (fr)
Chinese (zh)
Inventor
张潮红
Original Assignee
维沃移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2020221044A1 publication Critical patent/WO2020221044A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P8/00Arrangements for controlling dynamo-electric motors rotating step by step
    • H02P8/12Control or stabilisation of current
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P2207/00Indexing scheme relating to controlling arrangements characterised by the type of motor

Definitions

  • the present disclosure relates to the field of mobile terminals, and in particular to a method for controlling a stepping motor and a mobile terminal.
  • Stepping motors have been widely used, ranging from mechanical engineering to smart terminal devices, especially smart terminal devices that require high precision, low power consumption, and cost, such as telescopic cameras of smart terminal devices.
  • the stepping motor drives the metal screw and plastic slide mode to realize the extension and contraction of the camera. Specifically, when the plastic slider moves to the limit position on the lead screw and is stuck, due to the large output torque of the motor, the lead screw may be driven to rotate, causing the sliding wire vibration between the lead screw and the slider to generate noise. Noise will also be generated when the stepper motor works abnormally, which will not only affect the user experience, but also affect the accuracy of the stepper motor's operation and reduce the service life of the stepper motor.
  • the embodiments of the present disclosure provide a stepping motor control method and a mobile terminal, so as to solve the noise problem caused by idling after the sliding block driven by the stepping motor moves into position and gets stuck, and to ensure the service life of the stepping motor and Run accuracy and improve user experience.
  • a method for controlling a stepper motor includes:
  • the stepping motor is driven according to a second current, which is less than the first current.
  • a mobile terminal in a second aspect, includes:
  • the determining module is used for determining the current position of the slider when the stepper motor pushes the slider from the first limit to the second limit;
  • a control module configured to drive the stepping motor according to a first current when the distance between the current position and the second limit is greater than a preset threshold
  • the control module is further configured to drive the stepping motor according to a second current when the distance is less than the preset threshold, and the second current is less than the first current.
  • a mobile terminal in a third aspect, includes a processor, a memory, and a computer program that is stored on the memory and can run on the processor.
  • the computer program When the computer program is executed by the processor, Implement the steps of the method as described in the first aspect.
  • a computer-readable storage medium wherein a computer program is stored on the computer-readable storage medium, and the computer program implements the steps of the method described in the first aspect when the computer program is executed by a processor.
  • a stepper motor is used to push the slider to move between the first limit and the second limit, and the stepper motor is used to push the slider to move from the first limit to the second limit.
  • the output torque of the stepping motor is reduced, so that when the slider quickly moves to the second limit, a smaller output torque can ensure that the lead screw can rotate normally. And when the slider moves to the second limit, the output torque cannot drive the screw to continue to rotate, which can reduce or eliminate the rotational vibration noise between the screw and the slider, so as to ensure the service life and operating accuracy of the stepping motor. Improve user experience.
  • FIG. 1 is a schematic flowchart of a stepping motor control method in an embodiment of the present disclosure
  • Figure 2 is a schematic diagram of a stepping motor control system in an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of the structure of a mobile terminal in an embodiment of the present disclosure.
  • Fig. 4 is a schematic diagram of another structure of a mobile terminal in an embodiment of the present disclosure.
  • photoelectric devices are generally used to detect whether the slider moves in place, so that the motor stops running after the slider moves in place to minimize the time of idling noise.
  • a magnet can be added to the slider, and the strength of the magnet on the slider can be detected by the Hall sensor, so as to determine whether the slider has moved in place according to the detection value and stability of the Hall sensor.
  • the vibration of the slider during the movement will affect the stability of the detection value of the Hall sensor, so that it is impossible to accurately determine whether the slider has moved in place, that is, the Hall sensor detects that the slider moves in place and is stuck.
  • an embodiment of the present disclosure provides a method for controlling a stepper motor, which is executed by a mobile terminal.
  • the method may specifically include:
  • Step 101 Determine the current position of the slider when the stepper motor pushes the slider from the first limit to the second limit.
  • Step 103 If the distance between the current position and the second limit is greater than the preset threshold, drive the stepping motor according to the first current.
  • Step 105 If the distance is less than the preset threshold, drive the stepping motor according to the second current, which is less than the first current.
  • the stepper motor can push the slider from the first limit to the second limit on the screw, and determine the corresponding current to drive the stepper motor to push the slider according to the current position of the slider on the screw. Block move.
  • a stepper motor is used to push the slider to move between the first limit and the second limit, and the stepper motor is used to push the slider to move from the first limit to the second limit.
  • the output torque of the stepping motor is reduced, so that when the slider quickly moves to the second limit, a smaller output torque can ensure that the screw can rotate normally
  • it can reduce or eliminate the sliding wire vibration between the lead screw and the slider, thereby reducing or preventing the noise generated between the lead screw and the slider, so as to ensure the service life and operating accuracy of the stepping motor, and improve the user experience .
  • the value of the distance threshold can be limited according to actual conditions, for example, limited to 1 mm.
  • the system controller provides power to the stepper motor by controlling the power supply module for the motor, and by controlling the operating accuracy, operating speed and direction, and operating current of the stepper motor driver.
  • the stepping motor is driven by a two-phase current drive as shown in Figure 2.
  • the stepping motor outputs torque based on the aforementioned operating parameters and drives the screw to rotate, thereby pushing the slider at the limit 1 and limit of the screw. 2 for telescopic movement.
  • the stepping motor control method can be based on the slider on the screw
  • the specific position control is used to drive the phase current of the stepper motor to reduce the output torque of the stepper motor by reducing the current before the slider moves to the limit position (limit 1 or limit 2). Then, when the screw cannot be rotated after the slider is stuck, the noise caused by the sliding wire vibration caused by the screw still idling after the slider is in place can be eliminated, thereby improving the user experience.
  • limit 1 is the first limit and limit 2 is the second limit;
  • the limit 1 is the second limit, and the limit 2 is the first limit.
  • the above-mentioned second current is the limit minimum current required by the stepping motor to push the slider to move.
  • the second current is the limit current required by the stepper motor to push the slider to move, that is, when the current used to drive the stepper motor reaches the second current, the stepper motor can just drive the motor load, namely the screw and the slider. Movement, that is, the second current is the minimum critical current that can drive the motor load to move.
  • the second current can be a value calibrated before the mobile terminal leaves the factory, as a system preset parameter, used in the process of controlling the operation of the stepping motor;
  • the specific current calibration determination process can include: the system passes thrust calibration, configuration steps The current entering the motor driver changes from small to large, and the stepper motor runs at a certain speed, such as keeping a low speed, using a Hall sensor to detect the position of the slider, when the driving current reaches Ic (the second current) Normally drive the stepper motor to run, that is, when the Hall sensor can detect that the position of the slider just changes, it is considered that the current Ic can just drive the motor load.
  • the second current may be calibrated periodically or whenever the operating time of the stepping motor reaches a certain value.
  • the stepping motor control method of the embodiment of the present disclosure after the stepping motor is driven to operate according to a larger first current is converted to the stepping motor is driven to operate according to a smaller second current, it may further include The following process steps:
  • the stepper motor is controlled to stop running.
  • the stepping motor is directly controlled to stop running.
  • the value of the duration threshold can be limited according to actual conditions.
  • the stepping motor control method of the embodiment of the present disclosure in order to ensure the pushing effect of the stepping motor on the slider, that is, to ensure the telescopic movement efficiency of the slider, it can be driven according to the first current and the second current. While stepping the motor, make the rotation speed of the stepping motor the first rotation speed.
  • the current state of the slider is determined before the location steps, the following process steps can be performed:
  • the stepping motor When the stepping motor is driven for the first duration according to the second rotation speed and the third current, the stepping motor is driven according to the third rotation speed and the third current, wherein the second rotation speed is less than the third rotation speed, and the third rotation speed is greater than the first rotation speed.
  • the third current is greater than the second current.
  • the stepping motor is first driven at a low speed and high current to run for the first time, and then the stepping motor is driven at a high speed and high current.
  • the value of the first duration can be selected and set according to specific conditions.
  • step 101 of the stepping motor control method of the embodiment of the present disclosure can be specifically executed as follows:
  • the current position is determined.
  • the value of the second duration can be selected and set according to specific conditions.
  • the operation phase from low speed and high current to high speed and high current operation phase to low speed and high current operation phase is realized in turn. Enter the low speed, low current operation stage.
  • the current position of the slider can be determined by the combination of the magnet and the Hall sensor, that is, when the magnet is provided on the slider, the The following steps determine the current position of the slider:
  • the current position is determined.
  • the magnet is detected simultaneously by the first Hall sensor and the second Hall sensor respectively, based on the obtained first
  • the detection value and the second detection value determine the current position of the slider; wherein the first detection value and the second detection value may be magnetic field strength values.
  • the real-time position of the slider on the lead screw can be preliminarily and accurately determined through the detection value of the Hall sensor.
  • the slider is the first The Hall sensor is farther and closer to the second Hall sensor, that is, the slider has moved to approach or reach a position where the drive current of the stepping motor needs to be reduced.
  • Hall sensor 1 when the stepper motor pushes the slider to move from limit 1 to limit 2 on the lead screw, Hall sensor 1 is the first Hall sensor and Hall sensor. 2 is the second Hall sensor; and when the stepper motor pushes the slider to move from the limit 2 on the screw to the limit 1, Hall sensor 1 is the second Hall sensor, and Hall sensor 2 is The first Hall sensor.
  • the stepping motor is reduced at an appropriate time.
  • Phase current when the stepper motor is locked, it is ensured that the torque of the screw cannot be transmitted to the back stage of the slider, so as to reduce or eliminate the noise caused by the vibration of the sliding wire between the screw and the slider. It is a good solution to the noise problem of the telescopic motor on the mobile terminal in the related technology.
  • an embodiment of the present disclosure further provides a mobile terminal 200, and the mobile terminal 200 may specifically include:
  • the determining module 201 is used for determining the current position of the slider when the stepper motor pushes the slider from the first limit to the second limit;
  • the control module 203 is configured to drive the stepping motor according to the first current when the distance between the current position and the second limit is greater than a preset threshold;
  • the control module 203 is further configured to drive the stepping motor according to a second current when the distance is less than a preset threshold, and the second current is less than the first current.
  • the above-mentioned second current is the minimum current required by the stepper motor to push the slider to move.
  • control module 203 may also be used for:
  • the stepping motor is controlled to stop running.
  • the rotation speed of the stepping motor when operating at the first current and the second current is the first rotation speed
  • control module 203 may also be used to:
  • the stepping motor When the stepping motor is driven for the first duration according to the second rotation speed and the third current, the stepping motor is driven according to the third rotation speed and the third current, wherein the second rotation speed is less than the third rotation speed, and the third rotation speed is greater than the first rotation speed.
  • the third current is greater than the second current;
  • the above determining module 201 may be specifically used for:
  • the current position is determined.
  • a magnet is provided on the aforementioned slider
  • the above determining module 201 may specifically include:
  • the first acquisition sub-module is used to acquire the first detection value of the magnet by the first Hall sensor, and the first Hall sensor is set close to the first limit;
  • the second acquisition sub-module is used to acquire the second detection value of the magnet by the second Hall sensor, and the second Hall sensor is set close to the second limit;
  • the determining sub-module is used to determine the current position according to the first detection value and the second detection value.
  • the mobile terminal 200 provided by the embodiments of the present disclosure can implement the aforementioned steps of the stepping motor control method executed by the mobile terminal 200.
  • the relevant explanations about the stepping motor control method are all applicable to the mobile terminal 200. I won't repeat it here.
  • a stepper motor is used to push the slider to move between the first limit and the second limit, and the stepper motor is used to push the slider to move from the first limit to the second limit.
  • the output torque of the stepping motor is reduced, so that when the slider quickly moves to the second limit, a smaller output torque can ensure that the screw can rotate normally
  • it can reduce or eliminate the sliding wire vibration between the lead screw and the slider, thereby reducing or preventing the noise generated between the lead screw and the slider, so as to ensure the service life and operating accuracy of the stepping motor, and improve the user experience .
  • the mobile terminal 300 includes but is not limited to: a radio frequency unit 301, a network module 302, an audio output unit 303, an input unit 304, a sensor 305, and a display unit 306, a user input unit 307, an interface unit 308, a memory 309, a processor 310, and a power supply 311 and other components.
  • a radio frequency unit 301 includes but is not limited to: a radio frequency unit 301, a network module 302, an audio output unit 303, an input unit 304, a sensor 305, and a display unit 306, a user input unit 307, an interface unit 308, a memory 309, a processor 310, and a power supply 311 and other components.
  • the mobile terminal may include more or fewer components than those shown in the figure, or combine certain components, or different components. Layout.
  • mobile terminals include, but are not limited to, mobile phones, tablet computers, notebook computers, palmtop computers, vehicle-mounted terminals, wearable devices, and pedometers.
  • the processor 310 is configured to perform the following processes:
  • the stepping motor is driven according to the second current, which is less than the first current.
  • a stepper motor is used to push the slider to move between the first limit and the second limit, and the stepper motor is used to push the slider to move from the first limit to the second limit.
  • the output torque of the stepping motor is reduced, so that when the slider quickly moves to the second limit, a smaller output torque can ensure that the screw can rotate normally
  • it can reduce or eliminate the sliding wire vibration between the lead screw and the slider, thereby reducing or preventing the noise generated between the lead screw and the slider, so as to ensure the service life and operating accuracy of the stepping motor, and improve the user experience .
  • the radio frequency unit 301 can be used for receiving and sending signals in the process of sending and receiving information or talking. Specifically, the downlink data from the base station is received and processed by the processor 310; in addition, Uplink data is sent to the base station.
  • the radio frequency unit 301 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
  • the radio frequency unit 301 can also communicate with the network and other devices through a wireless communication system.
  • the mobile terminal provides users with wireless broadband Internet access through the network module 302, such as helping users to send and receive emails, browse web pages, and access streaming media.
  • the audio output unit 303 may convert the audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into audio signals and output them as sounds. Moreover, the audio output unit 303 may also provide audio output related to a specific function performed by the mobile terminal 300 (for example, call signal reception sound, message reception sound, etc.).
  • the audio output unit 303 includes a speaker, a buzzer, a receiver, and the like.
  • the input unit 304 is used to receive audio or video signals.
  • the input unit 304 may include a graphics processing unit (GPU) 3041 and a microphone 3042.
  • the graphics processor 3041 is configured to monitor images of still pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. Data is processed.
  • the processed image frame may be displayed on the display unit 306.
  • the image frame processed by the graphics processor 3041 may be stored in the memory 309 (or other storage medium) or sent via the radio frequency unit 301 or the network module 302.
  • the microphone 3042 can receive sound, and can process such sound into audio data.
  • the processed audio data can be converted into a format that can be sent to the mobile communication base station via the radio frequency unit 301 for output in the case of a telephone call mode.
  • the mobile terminal 300 also includes at least one sensor 305, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor includes an ambient light sensor and a proximity sensor.
  • the ambient light sensor can adjust the brightness of the display panel 3061 according to the brightness of the ambient light.
  • the proximity sensor can close the display panel 3061 and the display panel 3061 when the mobile terminal 300 is moved to the ear. / Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three-axis), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games , Magnetometer attitude calibration), vibration recognition related functions (such as pedometer, percussion), etc.; the sensor 305 can also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, Infrared sensors, etc., will not be repeated here.
  • the display unit 306 is used to display information input by the user or information provided to the user.
  • the display unit 306 may include a display panel 3061, and the display panel 3061 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • the user input unit 307 can be used to receive inputted numeric or character information, and generate key signal input related to user settings and function control of the mobile terminal.
  • the user input unit 307 includes a touch panel 3071 and other input devices 3072.
  • the touch panel 3071 also called a touch screen, can collect the user's touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 3071 or near the touch panel 3071. operating).
  • the touch panel 3071 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 310, the command sent by the processor 310 is received and executed.
  • the touch panel 3071 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave.
  • the user input unit 307 may also include other input devices 3072.
  • other input devices 3072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick, which will not be repeated here.
  • the touch panel 3071 can be overlaid on the display panel 3061.
  • the touch panel 3071 detects a touch operation on or near it, it is transmitted to the processor 310 to determine the type of the touch event, and then the processor 310 responds to the touch The type of event provides corresponding visual output on the display panel 3061.
  • the touch panel 3071 and the display panel 3061 are used as two independent components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 3071 and the display panel 3061 can be integrated
  • the implementation of the input and output functions of the mobile terminal is not specifically limited here.
  • the interface unit 308 is an interface for connecting an external device with the mobile terminal 300.
  • the external device may include a wired or wireless headset port, an external power source (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, audio input/output (I/O) port, video I/O port, headphone port, etc.
  • the interface unit 308 can be used to receive input (for example, data information, power, etc.) from an external device and transmit the received input to one or more elements in the mobile terminal 300 or can be used to connect to the mobile terminal 300 and external Transfer data between devices.
  • the memory 309 can be used to store software programs and various data.
  • the memory 309 may mainly include a storage program area and a storage data area.
  • the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data (such as audio data, phone book, etc.) created by the use of mobile phones.
  • the memory 309 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the processor 310 is the control center of the mobile terminal. It uses various interfaces and lines to connect the various parts of the entire mobile terminal, runs or executes software programs and/or modules stored in the memory 309, and calls data stored in the memory 309 , Perform various functions of the mobile terminal and process data, so as to monitor the mobile terminal as a whole.
  • the processor 310 may include one or more processing units; optionally, the processor 310 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, and application programs, etc.
  • the adjustment processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 310.
  • the mobile terminal 300 may also include a power source 311 (such as a battery) for supplying power to various components.
  • a power source 311 such as a battery
  • the power source 311 may be logically connected to the processor 310 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. Management and other functions.
  • the mobile terminal 300 includes some functional modules not shown, which will not be repeated here.
  • an embodiment of the present disclosure also provides a mobile terminal, including a processor 310, a memory 309, a computer program stored in the memory 309 and capable of running on the processor 310, and the computer program is executed by the processor 310
  • a mobile terminal including a processor 310, a memory 309, a computer program stored in the memory 309 and capable of running on the processor 310, and the computer program is executed by the processor 310
  • the various processes of the above-mentioned stepping motor control method embodiment are realized at a time, and the same technical effect can be achieved. To avoid repetition, details are not described here.
  • the embodiments of the present disclosure also provide a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the computer program is executed by a processor, each process of the above-mentioned stepper motor control method embodiment is realized, and can achieve The same technical effect is not repeated here in order to avoid repetition.
  • the computer-readable storage medium such as read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
  • the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. ⁇
  • the technical solution of the present disclosure essentially or the part that contributes to the related technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk). ) Includes several instructions to make a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present disclosure.

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Control Of Stepping Motors (AREA)

Abstract

A control method for a step motor, and a mobile terminal, the method comprising: within a process of a step motor driving a sliding block to move from a first limiting position to a second limiting position, determining a current position of the sliding block (step 101); if the distance between the current position and the second limiting position is greater than a preset threshold, then driving the step motor according to a first current (step 103); and if the distance is less than the preset threshold, then driving the step motor according to a second current, the second current being smaller than the first current (step 105).

Description

步进电机的控制方法和移动终端Control method of stepping motor and mobile terminal
相关申请的交叉引用Cross references to related applications
本申请主张在2019年4月28日在中国提交的中国专利申请No.201910348649.5的优先权,其全部内容通过引用包含于此。This application claims the priority of Chinese Patent Application No. 201910348649.5 filed in China on April 28, 2019, the entire content of which is incorporated herein by reference.
技术领域Technical field
本公开涉及移动终端领域,尤其涉及一种步进电机的控制方法和移动终端。The present disclosure relates to the field of mobile terminals, and in particular to a method for controlling a stepping motor and a mobile terminal.
背景技术Background technique
步进电机得到了非常广泛的使用,范围大到机械工程、小到智能终端设备,特别是对精度、低功耗、成本等要求较高的智能终端设备,比如智能终端设备的伸缩摄像头,采用步进电机驱动金属丝杠和塑料滑块模式实现摄像头的伸和缩。具体当塑料滑块移动到丝杠上的限制位且卡住后,由于电机输出扭矩较大,可能驱动丝杠还在转动,造成丝杠和滑块之间存在滑丝震动,产生噪声,同时在步进电机异常工作的情况下也会产生噪声,如此不仅会影响用户体验,还会影响步进电机运行的精度,并缩减步进电机的使用寿命。Stepping motors have been widely used, ranging from mechanical engineering to smart terminal devices, especially smart terminal devices that require high precision, low power consumption, and cost, such as telescopic cameras of smart terminal devices. The stepping motor drives the metal screw and plastic slide mode to realize the extension and contraction of the camera. Specifically, when the plastic slider moves to the limit position on the lead screw and is stuck, due to the large output torque of the motor, the lead screw may be driven to rotate, causing the sliding wire vibration between the lead screw and the slider to generate noise. Noise will also be generated when the stepper motor works abnormally, which will not only affect the user experience, but also affect the accuracy of the stepper motor's operation and reduce the service life of the stepper motor.
因此,需要一种有效的步进电机控制方案,以解决在步进电机驱动的滑块移动到位并卡住后,由于空转所引起的噪声问题。Therefore, there is a need for an effective stepper motor control solution to solve the noise problem caused by idling after the slider driven by the stepper motor moves into position and gets stuck.
发明内容Summary of the invention
本公开实施例提供一种步进电机的控制方法和移动终端,以解决在步进电机驱动的滑块移动到位并卡住后,由于空转所引起的噪声问题,保障步进电机的使用寿命以及运行精度,并提升用户体验。The embodiments of the present disclosure provide a stepping motor control method and a mobile terminal, so as to solve the noise problem caused by idling after the sliding block driven by the stepping motor moves into position and gets stuck, and to ensure the service life of the stepping motor and Run accuracy and improve user experience.
为了解决上述技术问题,本公开是这样实现的:In order to solve the above technical problems, the present disclosure is implemented as follows:
第一方面,提供了一种步进电机的控制方法,该方法包括:In the first aspect, a method for controlling a stepper motor is provided, and the method includes:
在步进电机推动滑块由第一限位向第二限位移动的过程中,确定所述滑块的当前位置;Determining the current position of the slider during the process of pushing the slider from the first limit to the second limit by the stepping motor;
若所述当前位置与所述第二限位间的距离大于预设阈值,则按照第一电流驱动所述步进电机;If the distance between the current position and the second limit is greater than a preset threshold, drive the stepping motor according to the first current;
若所述距离小于所述预设阈值,则按照第二电流驱动所述步进电机,所述第二电流小于所述第一电流。If the distance is less than the preset threshold, the stepping motor is driven according to a second current, which is less than the first current.
第二方面,提供了一种移动终端,该移动终端包括:In a second aspect, a mobile terminal is provided, and the mobile terminal includes:
确定模块,用于在步进电机推动滑块由第一限位向第二限位移动的过程中,确定所述滑块的当前位置;The determining module is used for determining the current position of the slider when the stepper motor pushes the slider from the first limit to the second limit;
控制模块,用于在所述当前位置与所述第二限位间的距离大于预设阈值的情况下,按照第一电流驱动所述步进电机;A control module, configured to drive the stepping motor according to a first current when the distance between the current position and the second limit is greater than a preset threshold;
所述控制模块还用于:在所述距离小于所述预设阈值的情况下,按照第二电流驱动所述步进电机,所述第二电流小于所述第一电流。The control module is further configured to drive the stepping motor according to a second current when the distance is less than the preset threshold, and the second current is less than the first current.
第三方面,提供了一种移动终端,该移动终端包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如第一方面所述的方法的步骤。In a third aspect, a mobile terminal is provided. The mobile terminal includes a processor, a memory, and a computer program that is stored on the memory and can run on the processor. When the computer program is executed by the processor, Implement the steps of the method as described in the first aspect.
第四方面,提供了一种计算机可读存储介质,其中,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现如第一方面所述的方法的步骤。In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program implements the steps of the method described in the first aspect when the computer program is executed by a processor.
本公开实施例,通过步进电机推动滑块在第一限位和第二限位之间进行伸缩移动,并在通过步进电机推动滑块由第一限位向第二限位移动的过程中,根据滑块当前所在的位置调整用于驱动步进电机的电流,具体地,当滑块距离第二限位较远即与第二限位间的距离大于预设阈值时,按照较大的第一电流驱动步进电机运行以推动滑块,而当滑块距离第二限位较近即与第二限位间的距离小于该距离阈值,按照较小的第二电流驱动步进电机运行以推动滑块。如此,通过减小用于驱动步进电机的电流的方式,降低步进电机的输出扭矩,以在滑块快移动至第二限位时,以较小的输出扭矩保证丝杠能正常转动,且在滑块移动至第二限位时,输出扭矩无法带动丝杠继续转动,能够降低或消除丝杠和滑块之间的转动震动噪声,以保障步进电机的使用寿命以及运行精度,同时提升用户体验。In the embodiment of the present disclosure, a stepper motor is used to push the slider to move between the first limit and the second limit, and the stepper motor is used to push the slider to move from the first limit to the second limit. , Adjust the current used to drive the stepping motor according to the current position of the slider. Specifically, when the slider is farther from the second limit, that is, the distance from the second limit is greater than the preset threshold, the The first current drives the stepper motor to move the slider, and when the slider is closer to the second limit, the distance between the slider and the second limit is less than the distance threshold, the stepper motor is driven according to the smaller second current Run to push the slider. In this way, by reducing the current used to drive the stepping motor, the output torque of the stepping motor is reduced, so that when the slider quickly moves to the second limit, a smaller output torque can ensure that the lead screw can rotate normally. And when the slider moves to the second limit, the output torque cannot drive the screw to continue to rotate, which can reduce or eliminate the rotational vibration noise between the screw and the slider, so as to ensure the service life and operating accuracy of the stepping motor. Improve user experience.
附图说明Description of the drawings
此处所说明的附图用来提供对本公开的进一步理解,构成本公开的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:The drawings described here are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure, and do not constitute an improper limitation of the present disclosure. In the attached picture:
图1是本公开实施例中步进电机的控制方法的流程示意图;FIG. 1 is a schematic flowchart of a stepping motor control method in an embodiment of the present disclosure;
图2是本公开实施例中步进电机的控制系统的示意图;Figure 2 is a schematic diagram of a stepping motor control system in an embodiment of the present disclosure;
图3是本公开实施例中移动终端的结构示意图;FIG. 3 is a schematic diagram of the structure of a mobile terminal in an embodiment of the present disclosure;
图4是本公开实施例中移动终端的又一种结构示意图。Fig. 4 is a schematic diagram of another structure of a mobile terminal in an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。The technical solutions in the embodiments of the present disclosure will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present disclosure.
对于背景技术部分陈述的步进电机驱动丝杠和滑块的方案,一般通过光电类器件检测滑块是否移动到位,以在滑块移动到位后使电机停止运行,来尽量缩短空转噪声产生的时间。举例来说,可以通过在滑块上增设磁铁,并通过霍尔传感器检测滑块上的磁铁强度,从而根据霍尔传感器的检测值和稳定度判断滑块是否移动到位。但是,滑块在移动过程中的振动会影响霍尔传感器的检测值的稳定度,以致无法准确地判定滑块是否移动到位,也就是说,通过霍尔传感器检测到滑块移动到位并卡住会出现延迟,导致无法及时使电机停止运行,则会出现由于电机输出扭矩较大,还在继续驱动丝杠转动,造成丝杠和滑块之间存在滑丝震动,产生噪声,从而在电机停止运行前,由于滑丝震动产生的噪声会持续比较长的时间后才能消失。For the stepper motor drive screw and slider solution stated in the background technology section, photoelectric devices are generally used to detect whether the slider moves in place, so that the motor stops running after the slider moves in place to minimize the time of idling noise. . For example, a magnet can be added to the slider, and the strength of the magnet on the slider can be detected by the Hall sensor, so as to determine whether the slider has moved in place according to the detection value and stability of the Hall sensor. However, the vibration of the slider during the movement will affect the stability of the detection value of the Hall sensor, so that it is impossible to accurately determine whether the slider has moved in place, that is, the Hall sensor detects that the slider moves in place and is stuck. There will be a delay, resulting in the inability to stop the motor in time, and the motor will continue to drive the screw to rotate due to the large output torque of the motor, causing the sliding wire between the screw and the slider to vibrate and generate noise, so that the motor stops Before running, the noise caused by the vibration of the sliding wire will last a long time before it disappears.
因此,需要一种有效的步进电机控制方案,以解决在步进电机驱动的滑块移动到位卡住后,由于空转所引起的噪声问题,提升用户体验。Therefore, there is a need for an effective stepper motor control solution to solve the noise problem caused by idling after the slider driven by the stepper motor is stuck in place and improve user experience.
以下结合附图,详细说明本公开各实施例提供的技术方案。The technical solutions provided by the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
参见图1所示,本公开实施例提供一种步进电机的控制方法,由移动终端执行。该方法可具体包括:Referring to FIG. 1, an embodiment of the present disclosure provides a method for controlling a stepper motor, which is executed by a mobile terminal. The method may specifically include:
步骤101:在步进电机推动滑块由第一限位向第二限位移动的过程中,确定滑块的当前位置。Step 101: Determine the current position of the slider when the stepper motor pushes the slider from the first limit to the second limit.
步骤103:若当前位置与第二限位间的距离大于距预设阈值,则按照第一电流驱动步进电机。Step 103: If the distance between the current position and the second limit is greater than the preset threshold, drive the stepping motor according to the first current.
步骤105:若距离小于预设阈值,则按照第二电流驱动步进电机,第二电流小于第一电流。Step 105: If the distance is less than the preset threshold, drive the stepping motor according to the second current, which is less than the first current.
可选地,步进电机可以推动滑块由丝杠上的第一限位向第二限位移动,并根据滑块在丝杠上的当前位置,确定对应的电流以驱动步进电机推动滑块移动。Optionally, the stepper motor can push the slider from the first limit to the second limit on the screw, and determine the corresponding current to drive the stepper motor to push the slider according to the current position of the slider on the screw. Block move.
本公开实施例,通过步进电机推动滑块在第一限位和第二限位之间进行伸缩移动,并在通过步进电机推动滑块由第一限位向第二限位移动的过程中,根据滑块当前所在的位置调整用于驱动步进电机的电流,具体地,当滑块距离第二限位较远即与第二限位间的距离大于预设阈值时,按照较大的第一电流驱动步进电机运行以推动滑块,而当滑块距离第二限位较近即与第二限位间的距离小于该距离阈值,按照较小的第二电流驱动步进电机运行以推动滑块。如此,通过减小用于驱动步进电机的电流的方式,降低步进电机的输出扭矩,以在滑块快移动至第二限位时,即以较小的输出扭矩保证丝杠能正常转动的同时,能够降低或消除丝杠和滑块之间的滑丝震动,从而减少或防止丝杠和滑块之间产生的噪声,以保障步进电机的使用寿命以及运行精度,同时提升用户体验。In the embodiment of the present disclosure, a stepper motor is used to push the slider to move between the first limit and the second limit, and the stepper motor is used to push the slider to move from the first limit to the second limit. , Adjust the current used to drive the stepping motor according to the current position of the slider. Specifically, when the slider is farther from the second limit, that is, the distance from the second limit is greater than the preset threshold, the The first current drives the stepper motor to move the slider, and when the slider is closer to the second limit, the distance between the slider and the second limit is less than the distance threshold, the stepper motor is driven according to the smaller second current Run to push the slider. In this way, by reducing the current used to drive the stepping motor, the output torque of the stepping motor is reduced, so that when the slider quickly moves to the second limit, a smaller output torque can ensure that the screw can rotate normally At the same time, it can reduce or eliminate the sliding wire vibration between the lead screw and the slider, thereby reducing or preventing the noise generated between the lead screw and the slider, so as to ensure the service life and operating accuracy of the stepping motor, and improve the user experience .
其中,距离阈值的取值大小可以根据实际情况进行限定,比如限定为1mm。Among them, the value of the distance threshold can be limited according to actual conditions, for example, limited to 1 mm.
举例来说,如图2所示,系统控制器通过对电源模块进行电机供电控制为步进电机供电,以及通过对步进电机的驱动器进行运行精度、运行速度及方向以及运行电流的控制,实现对步进电机的驱动,如图2所示实现的是两相电流驱动,步进电机基于前述各运行参数输出扭矩,驱动丝杠转动,从而推动滑块在丝杠的限位1和限位2间进行伸缩移动。具体地,基于步进电机的输出扭矩与相电流相关的特性,即相电流越大,输出扭矩越大,则根据发明实施例的步进电机的控制方法,可以依据滑块在丝杠上的具体位置控制用于驱动步进电机的相电流,以在滑块运动到极限位置(限位1或限位2)前, 通过减小电流的方式达到减小步进电机的输出扭矩的目的,则当滑块卡住后无法转动丝杠时,可以消除滑块到位后由于丝杠仍然空转产生滑丝震动所导致的噪声,从而提升用户体验。For example, as shown in Figure 2, the system controller provides power to the stepper motor by controlling the power supply module for the motor, and by controlling the operating accuracy, operating speed and direction, and operating current of the stepper motor driver. The stepping motor is driven by a two-phase current drive as shown in Figure 2. The stepping motor outputs torque based on the aforementioned operating parameters and drives the screw to rotate, thereby pushing the slider at the limit 1 and limit of the screw. 2 for telescopic movement. Specifically, based on the characteristics of the output torque of the stepper motor related to the phase current, that is, the greater the phase current, the greater the output torque, the stepping motor control method according to the embodiment of the invention can be based on the slider on the screw The specific position control is used to drive the phase current of the stepper motor to reduce the output torque of the stepper motor by reducing the current before the slider moves to the limit position (limit 1 or limit 2). Then, when the screw cannot be rotated after the slider is stuck, the noise caused by the sliding wire vibration caused by the screw still idling after the slider is in place can be eliminated, thereby improving the user experience.
需要说明的是,在步进电机推动滑块由丝杠的限位1向限位2移动时,限位1即为第一限位、限位2即为第二限位;而在步进电机推动滑块由丝杠的限位2向限位1移动时,限位1即为第二限位、限位2即为第一限位。It should be noted that when the stepper motor pushes the slider to move from limit 1 to limit 2 of the screw, limit 1 is the first limit and limit 2 is the second limit; When the motor pushes the slider to move from the limit 2 of the screw to the limit 1, the limit 1 is the second limit, and the limit 2 is the first limit.
可选地,在本公开实施例的步进电机的控制方法中,上述第二电流为步进电机推动滑块移动所需的极限最小电流。Optionally, in the stepping motor control method of the embodiment of the present disclosure, the above-mentioned second current is the limit minimum current required by the stepping motor to push the slider to move.
可以理解,第二电流为步进电机推动滑块移动所需的极限电流,即当用于驱动步进电机的电流达到第二电流后,步进电机刚好能够推动电机负载即丝杠和滑块运动,也就是说,第二电流为能够推动电机负载运动的最小临界电流。It can be understood that the second current is the limit current required by the stepper motor to push the slider to move, that is, when the current used to drive the stepper motor reaches the second current, the stepper motor can just drive the motor load, namely the screw and the slider. Movement, that is, the second current is the minimum critical current that can drive the motor load to move.
其中,第二电流可以为移动终端出厂前校准好的值,作为系统预置参数,应用于对步进电机运行的控制过程中;具体的电流校准确定过程可以包括:系统通过推力校准,配置步进电机驱动器的电流从小到大进行变化,并使步进电机按照一定的速度运行,比如保持低转速,使用霍尔传感器检测滑块的位置,当驱动电流达到Ic(即第二电流)后能正常驱动步进电机运行,即霍尔传感器能够检测到滑块的位置刚好变化时,则认为此时电流Ic刚好能推动电机负载运动。进一步地,为了保证在移动终端出厂后,该第二电流的稳定性和准确性,可以周期性或每当步进电机的运行时长达到一定值后对第二电流进行校准。Among them, the second current can be a value calibrated before the mobile terminal leaves the factory, as a system preset parameter, used in the process of controlling the operation of the stepping motor; the specific current calibration determination process can include: the system passes thrust calibration, configuration steps The current entering the motor driver changes from small to large, and the stepper motor runs at a certain speed, such as keeping a low speed, using a Hall sensor to detect the position of the slider, when the driving current reaches Ic (the second current) Normally drive the stepper motor to run, that is, when the Hall sensor can detect that the position of the slider just changes, it is considered that the current Ic can just drive the motor load. Further, in order to ensure the stability and accuracy of the second current after the mobile terminal leaves the factory, the second current may be calibrated periodically or whenever the operating time of the stepping motor reaches a certain value.
可选地,在本公开实施例的步进电机的控制方法中,由按照较大的第一电流驱动步进电机运行转换为按照较小的第二电流驱动步进电机运行后,还可以包括如下流程步骤:Optionally, in the stepping motor control method of the embodiment of the present disclosure, after the stepping motor is driven to operate according to a larger first current is converted to the stepping motor is driven to operate according to a smaller second current, it may further include The following process steps:
若检测到滑块移动至第二限位或按照第二电流持续驱动步进电机的时长达到时长阈值,则控制步进电机停止运行。If it is detected that the slider moves to the second limit or the duration of continuously driving the stepper motor according to the second current reaches the duration threshold, the stepper motor is controlled to stop running.
可以理解,在将用于驱动步进电机的电流由第一电流减小为第二电流后,为了进一步降低或消除由于空转使丝杠和滑块间存在滑丝震动而产生的噪声,可以在检测到滑块移动至第二限位或步进电机按第二电流持续运行的时长达 到时长阈值时,直接控制步进电机停止运行。It can be understood that after the current used to drive the stepper motor is reduced from the first current to the second current, in order to further reduce or eliminate the noise generated by the sliding wire vibration between the lead screw and the slider due to idling, the When it is detected that the slider moves to the second limit or the duration of the stepping motor continuously running at the second current reaches the duration threshold, the stepping motor is directly controlled to stop running.
其中,时长阈值的取值大小可以根据实际情况进行限定。Among them, the value of the duration threshold can be limited according to actual conditions.
可选地,在本公开实施例的步进电机的控制方法中,为保证步进电机对滑块的推动效果,即确保滑块的伸缩运动效率,可以在按照第一电流和第二电流驱动步进电机的同时,使步进电机的转速为第一转速。Optionally, in the stepping motor control method of the embodiment of the present disclosure, in order to ensure the pushing effect of the stepping motor on the slider, that is, to ensure the telescopic movement efficiency of the slider, it can be driven according to the first current and the second current. While stepping the motor, make the rotation speed of the stepping motor the first rotation speed.
进一步地,在本公开实施例的步进电机的控制方法中,在步进电机接收到启动命令,开启运行后,为了保证步进电机运行的平滑性和静音效果,在执行确定滑块的当前位置的步骤之前,可以执行以下流程步骤:Further, in the stepping motor control method of the embodiment of the present disclosure, after the stepping motor receives the start command and starts to run, in order to ensure the smoothness and mute effect of the stepping motor, the current state of the slider is determined Before the location steps, the following process steps can be performed:
从步进电机的启动时刻开始,按照第二转速和第三电流驱动步进电机;From the moment of starting the stepper motor, drive the stepper motor according to the second speed and the third current;
在按照第二转速和第三电流驱动步进电机第一时长时,按照第三转速和第三电流驱动步进电机,其中,第二转速小于第三转速,第三转速大于第一转速,第三电流大于第二电流。When the stepping motor is driven for the first duration according to the second rotation speed and the third current, the stepping motor is driven according to the third rotation speed and the third current, wherein the second rotation speed is less than the third rotation speed, and the third rotation speed is greater than the first rotation speed. The third current is greater than the second current.
可以理解,在启动步进电机开始运行后,首先按照低转速、大电流驱动步进电机运行第一时长,然后按照高转速、大电流驱动步进电机。It can be understood that after the stepping motor is started to run, the stepping motor is first driven at a low speed and high current to run for the first time, and then the stepping motor is driven at a high speed and high current.
其中,第一时长的取值可以根据具体情况进行选取设置。Among them, the value of the first duration can be selected and set according to specific conditions.
同时,考虑到步进电机的输出扭矩与转速成反比,即转速越高、扭矩越小,故首先按低转速驱动步进电机运行,可以使步进电机的输出扭矩尽快增大到能够推动滑块进行移动的大小,进而为了便于在滑块后续移动至接近第二限位的位置时,能够更好的减小或消除由于丝杠和滑块间的滑丝震动而产生的噪声,可以在保持大电流的同时增大转速,以高转速运行。At the same time, considering that the output torque of a stepper motor is inversely proportional to the speed, that is, the higher the speed, the smaller the torque. Therefore, first drive the stepper motor at a low speed to increase the output torque of the stepper motor as soon as possible The size of the movement of the block, in order to facilitate the subsequent movement of the slider to a position close to the second limit, to better reduce or eliminate the noise generated by the sliding wire vibration between the lead screw and the slider. Increase the speed while maintaining a large current, and run at a high speed.
进一步具体地,在启动步进电机推动滑块由第一限位向第二限位移动的过程中,当步进电机完成上述由低转速、大电流驱动转换为高转速、大电流驱动的运行步骤后,再执行确定滑块的当前位置的步骤,可以达到降低功耗的目的。也就是说,本公开实施例的步进电机的控制方法的步骤101中确定滑块的当前位置的步骤,可以具体执行为:More specifically, in the process of starting the stepper motor to push the slider from the first limit to the second limit, when the stepper motor completes the above-mentioned operation of converting from a low-speed, high-current drive to a high-speed, high-current drive After the steps, perform the step of determining the current position of the slider to achieve the purpose of reducing power consumption. In other words, the step of determining the current position of the slider in step 101 of the stepping motor control method of the embodiment of the present disclosure can be specifically executed as follows:
在按照第三转速和第三电流驱动步进电机第二时长后,确定当前位置。After the stepping motor is driven for the second duration according to the third rotational speed and the third current, the current position is determined.
其中,第二时长的取值可以根据具体情况进行选取设置。Among them, the value of the second duration can be selected and set according to specific conditions.
综上可知,在本公开实施例的步进电机的控制方法中,依次实现了由低转速、大电流的运行阶段到高转速、大电流的运行阶段再到低转速、大电流 的运行阶段最后进入低转速、小电流的运行阶段。In summary, in the stepping motor control method of the embodiment of the present disclosure, the operation phase from low speed and high current to high speed and high current operation phase to low speed and high current operation phase is realized in turn. Enter the low speed, low current operation stage.
可选地,在本公开实施例的步进电机的控制方法中,可以通过磁铁和霍尔传感器的组合,确定滑块的当前位置,即在滑块上设置有磁铁的情况下,可以具体通过如下步骤确定滑块的当前位置:Optionally, in the stepping motor control method of the embodiment of the present disclosure, the current position of the slider can be determined by the combination of the magnet and the Hall sensor, that is, when the magnet is provided on the slider, the The following steps determine the current position of the slider:
获取第一霍尔传感器对磁铁的第一检测值,第一霍尔传感器靠近第一限位设置;Acquiring the first detection value of the magnet by the first hall sensor, and the first hall sensor is set close to the first limit;
获取第二霍尔传感器对磁铁的第二检测值,第二霍尔传感器靠近第二限位设置;Acquire the second detection value of the second Hall sensor to the magnet, and the second Hall sensor is set close to the second limit;
根据第一检测值和第二检测值,确定当前位置。According to the first detection value and the second detection value, the current position is determined.
可以理解,在步进电机推动滑块由第一限位向第二限位移动的过程中,分别通过第一霍尔传感器和第二霍尔传感器同时对磁铁进行检测,以基于得到的第一检测值和第二检测值确定滑块的当前位置;其中,第一检测值和第二检测值可以为磁场强度值。It can be understood that when the stepper motor pushes the slider from the first limit to the second limit, the magnet is detected simultaneously by the first Hall sensor and the second Hall sensor respectively, based on the obtained first The detection value and the second detection value determine the current position of the slider; wherein the first detection value and the second detection value may be magnetic field strength values.
考虑到,在通过霍尔传感器对滑块进行位置检测时,若霍尔传感器离滑块越近,则其检测值会越大,而当霍尔传感器距离滑块越远时,其检测值越小,如此,通过霍尔传感器的检测值可以初步准确地判断滑块在丝杠上的实时位置。Considering that when the position of the slider is detected by the Hall sensor, if the Hall sensor is closer to the slider, the detection value will be larger, and when the Hall sensor is farther from the slider, the detection value will be greater. Therefore, the real-time position of the slider on the lead screw can be preliminarily and accurately determined through the detection value of the Hall sensor.
具体地,当第一霍尔传感器检测到的第一检测值小到处于第一区间且第二霍尔传感器检测到的第二检测值大到处于第二区间时,则说明滑块距离第一霍尔传感器较远而距离第二霍尔传感器较近,即滑块已移动至接近或到达需要减小步进电机的驱动电流的位置。Specifically, when the first detection value detected by the first Hall sensor is small enough to be in the first interval and the second detection value detected by the second Hall sensor is large enough to be in the second interval, it means that the slider is the first The Hall sensor is farther and closer to the second Hall sensor, that is, the slider has moved to approach or reach a position where the drive current of the stepping motor needs to be reduced.
另外,需要说明的是,如图2所示,在步进电机推动滑块由丝杠上的限位1向限位2移动时,霍尔传感器1即为第一霍尔传感器、霍尔传感器2即为第二霍尔传感器;而在步进电机推动滑块由丝杠上的限位2向限位1移动时,霍尔传感器1即为第二霍尔传感器、霍尔传感器2即为第一霍尔传感器。In addition, it should be noted that, as shown in Figure 2, when the stepper motor pushes the slider to move from limit 1 to limit 2 on the lead screw, Hall sensor 1 is the first Hall sensor and Hall sensor. 2 is the second Hall sensor; and when the stepper motor pushes the slider to move from the limit 2 on the screw to the limit 1, Hall sensor 1 is the second Hall sensor, and Hall sensor 2 is The first Hall sensor.
由上可知,在本公开实施例的步进电机的控制方法中,在霍尔传感器检测步进电机推动滑块进行伸缩运动的位置变化的基础上,通过在适当的时机减小步进电机的相电流,当步进电机发生堵转时保证使丝杠转动的扭矩无法传动到滑块后级,以减小或消除由于丝杠和滑块间的滑丝震动所产生的噪声 问,从而能够很好的解决相关技术中的移动终端上伸缩电机的音杂问题。It can be seen from the above that, in the stepping motor control method of the embodiment of the present disclosure, on the basis of the Hall sensor detecting the position change of the stepping motor pushing the slider for telescopic movement, the stepping motor is reduced at an appropriate time. Phase current, when the stepper motor is locked, it is ensured that the torque of the screw cannot be transmitted to the back stage of the slider, so as to reduce or eliminate the noise caused by the vibration of the sliding wire between the screw and the slider. It is a good solution to the noise problem of the telescopic motor on the mobile terminal in the related technology.
参见图3所示,本公开实施例还提供一种移动终端200,该移动终端200可具体包括:Referring to FIG. 3, an embodiment of the present disclosure further provides a mobile terminal 200, and the mobile terminal 200 may specifically include:
确定模块201,用于在步进电机推动滑块由第一限位向第二限位移动的过程中,确定滑块的当前位置;The determining module 201 is used for determining the current position of the slider when the stepper motor pushes the slider from the first limit to the second limit;
控制模块203,用于在当前位置与第二限位间的距离大于预设阈值的情况下,按照第一电流驱动步进电机;The control module 203 is configured to drive the stepping motor according to the first current when the distance between the current position and the second limit is greater than a preset threshold;
控制模块203还用于:在距离小于预设阈值的情况下,按照第二电流驱动步进电机,第二电流小于第一电流。The control module 203 is further configured to drive the stepping motor according to a second current when the distance is less than a preset threshold, and the second current is less than the first current.
可选地,本公开实施例提供的移动终端200中,上述第二电流为步进电机推动滑块移动所需的极限最小电流。Optionally, in the mobile terminal 200 provided by the embodiment of the present disclosure, the above-mentioned second current is the minimum current required by the stepper motor to push the slider to move.
可选地,本公开实施例提供的移动终端200中,上述控制模块203,还可以用于:Optionally, in the mobile terminal 200 provided by the embodiment of the present disclosure, the aforementioned control module 203 may also be used for:
在检测到滑块移动至第二限位或按照第二电流持续驱动步进电机的时长达到时长阈值的情况下,控制步进电机停止运行。When it is detected that the slider moves to the second limit or the duration of continuously driving the stepping motor according to the second current reaches the duration threshold, the stepping motor is controlled to stop running.
可选地,本公开实施例提供的移动终端200中,上述步进电机在按第一电流和第二电流运行时的转速为第一转速;Optionally, in the mobile terminal 200 provided by the embodiment of the present disclosure, the rotation speed of the stepping motor when operating at the first current and the second current is the first rotation speed;
其中,上述控制模块203在确定滑块的当前位置之前,还可以用于:Wherein, before determining the current position of the slider, the aforementioned control module 203 may also be used to:
从步进电机的启动时刻开始,按照第二转速和第三电流驱动步进电机;From the moment of starting the stepper motor, drive the stepper motor according to the second speed and the third current;
在按照第二转速和第三电流驱动步进电机第一时长时,按照第三转速和第三电流驱动步进电机,其中,第二转速小于第三转速,第三转速大于第一转速,第三电流大于第二电流;When the stepping motor is driven for the first duration according to the second rotation speed and the third current, the stepping motor is driven according to the third rotation speed and the third current, wherein the second rotation speed is less than the third rotation speed, and the third rotation speed is greater than the first rotation speed. The third current is greater than the second current;
上述确定模块201,可以具体用于:The above determining module 201 may be specifically used for:
在按照第三转速和第三电流驱动步进电机第二时长后,确定当前位置。After the stepping motor is driven for the second duration according to the third rotational speed and the third current, the current position is determined.
可选地,本公开实施例提供的移动终端200中,上述滑块上设置有磁铁;Optionally, in the mobile terminal 200 provided by the embodiment of the present disclosure, a magnet is provided on the aforementioned slider;
其中,上述确定模块201,可以具体包括:Wherein, the above determining module 201 may specifically include:
第一获取子模块,用于获取第一霍尔传感器对磁铁的第一检测值,第一霍尔传感器靠近第一限位设置;The first acquisition sub-module is used to acquire the first detection value of the magnet by the first Hall sensor, and the first Hall sensor is set close to the first limit;
第二获取子模块,用于获取第二霍尔传感器对磁铁的第二检测值,第二 霍尔传感器靠近第二限位设置;The second acquisition sub-module is used to acquire the second detection value of the magnet by the second Hall sensor, and the second Hall sensor is set close to the second limit;
确定子模块,用于根据第一检测值和第二检测值,确定当前位置。The determining sub-module is used to determine the current position according to the first detection value and the second detection value.
能够理解,本公开实施例提供的移动终端200,能够实现前述由移动终端200执行的步进电机的控制方法的各个过程,关于步进电机的控制方法的相关阐述均适用于移动终端200,此处不再赘述。It can be understood that the mobile terminal 200 provided by the embodiments of the present disclosure can implement the aforementioned steps of the stepping motor control method executed by the mobile terminal 200. The relevant explanations about the stepping motor control method are all applicable to the mobile terminal 200. I won't repeat it here.
本公开实施例,通过步进电机推动滑块在第一限位和第二限位之间进行伸缩移动,并在通过步进电机推动滑块由第一限位向第二限位移动的过程中,根据滑块当前所在的位置调整用于驱动步进电机的电流,具体地,当滑块距离第二限位较远即与第二限位间的距离大于预设阈值时,按照较大的第一电流驱动步进电机运行以推动滑块,而当滑块距离第二限位较近即与第二限位间的距离小于该距离阈值,按照较小的第二电流驱动步进电机运行以推动滑块。如此,通过减小用于驱动步进电机的电流的方式,降低步进电机的输出扭矩,以在滑块快移动至第二限位时,即以较小的输出扭矩保证丝杠能正常转动的同时,能够降低或消除丝杠和滑块之间的滑丝震动,从而减少或防止丝杠和滑块之间产生的噪声,以保障步进电机的使用寿命以及运行精度,同时提升用户体验。In the embodiment of the present disclosure, a stepper motor is used to push the slider to move between the first limit and the second limit, and the stepper motor is used to push the slider to move from the first limit to the second limit. , Adjust the current used to drive the stepping motor according to the current position of the slider. Specifically, when the slider is farther from the second limit, that is, the distance from the second limit is greater than the preset threshold, the The first current drives the stepper motor to move the slider, and when the slider is closer to the second limit, the distance between the slider and the second limit is less than the distance threshold, the stepper motor is driven according to the smaller second current Run to push the slider. In this way, by reducing the current used to drive the stepping motor, the output torque of the stepping motor is reduced, so that when the slider quickly moves to the second limit, a smaller output torque can ensure that the screw can rotate normally At the same time, it can reduce or eliminate the sliding wire vibration between the lead screw and the slider, thereby reducing or preventing the noise generated between the lead screw and the slider, so as to ensure the service life and operating accuracy of the stepping motor, and improve the user experience .
图4为实现本公开各个实施例的一种移动终端的硬件结构示意图,该移动终端300包括但不限于:射频单元301、网络模块302、音频输出单元303、输入单元304、传感器305、显示单元306、用户输入单元307、接口单元308、存储器309、处理器310、以及电源311等部件。本领域技术人员可以理解,图4中示出的移动终端结构并不构成对移动终端的限定,移动终端可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本公开实施例中,移动终端包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。4 is a schematic diagram of the hardware structure of a mobile terminal implementing various embodiments of the present disclosure. The mobile terminal 300 includes but is not limited to: a radio frequency unit 301, a network module 302, an audio output unit 303, an input unit 304, a sensor 305, and a display unit 306, a user input unit 307, an interface unit 308, a memory 309, a processor 310, and a power supply 311 and other components. Those skilled in the art can understand that the structure of the mobile terminal shown in FIG. 4 does not constitute a limitation on the mobile terminal. The mobile terminal may include more or fewer components than those shown in the figure, or combine certain components, or different components. Layout. In the embodiments of the present disclosure, mobile terminals include, but are not limited to, mobile phones, tablet computers, notebook computers, palmtop computers, vehicle-mounted terminals, wearable devices, and pedometers.
其中,处理器310,用于执行以下过程:Among them, the processor 310 is configured to perform the following processes:
在步进电机推动滑块由第一限位向第二限位移动的过程中,确定滑块的当前位置;Determine the current position of the slider when the stepper motor pushes the slider from the first limit to the second limit;
若当前位置与第二限位间的距离大于预设阈值,则按照第一电流驱动步进电机;If the distance between the current position and the second limit is greater than the preset threshold, drive the stepping motor according to the first current;
若距离小于预设阈值,则按照第二电流驱动步进电机,第二电流小于第一电流。If the distance is less than the preset threshold, the stepping motor is driven according to the second current, which is less than the first current.
本公开实施例,通过步进电机推动滑块在第一限位和第二限位之间进行伸缩移动,并在通过步进电机推动滑块由第一限位向第二限位移动的过程中,根据滑块当前所在的位置调整用于驱动步进电机的电流,具体地,当滑块距离第二限位较远即与第二限位间的距离大于预设阈值时,按照较大的第一电流驱动步进电机运行以推动滑块,而当滑块距离第二限位较近即与第二限位间的距离小于该距离阈值,按照较小的第二电流驱动步进电机运行以推动滑块。如此,通过减小用于驱动步进电机的电流的方式,降低步进电机的输出扭矩,以在滑块快移动至第二限位时,即以较小的输出扭矩保证丝杠能正常转动的同时,能够降低或消除丝杠和滑块之间的滑丝震动,从而减少或防止丝杠和滑块之间产生的噪声,以保障步进电机的使用寿命以及运行精度,同时提升用户体验。In the embodiment of the present disclosure, a stepper motor is used to push the slider to move between the first limit and the second limit, and the stepper motor is used to push the slider to move from the first limit to the second limit. , Adjust the current used to drive the stepping motor according to the current position of the slider. Specifically, when the slider is farther from the second limit, that is, the distance from the second limit is greater than the preset threshold, the The first current drives the stepper motor to move the slider, and when the slider is closer to the second limit, the distance between the slider and the second limit is less than the distance threshold, the stepper motor is driven according to the smaller second current Run to push the slider. In this way, by reducing the current used to drive the stepping motor, the output torque of the stepping motor is reduced, so that when the slider quickly moves to the second limit, a smaller output torque can ensure that the screw can rotate normally At the same time, it can reduce or eliminate the sliding wire vibration between the lead screw and the slider, thereby reducing or preventing the noise generated between the lead screw and the slider, so as to ensure the service life and operating accuracy of the stepping motor, and improve the user experience .
应理解的是,本公开实施例中,射频单元301可用于收发信息或通话过程中,信号的接收和发送,具体地,将来自基站的下行数据接收后,给处理器310处理;另外,将上行的数据发送给基站。通常,射频单元301包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元301还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in the embodiment of the present disclosure, the radio frequency unit 301 can be used for receiving and sending signals in the process of sending and receiving information or talking. Specifically, the downlink data from the base station is received and processed by the processor 310; in addition, Uplink data is sent to the base station. Generally, the radio frequency unit 301 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 301 can also communicate with the network and other devices through a wireless communication system.
移动终端通过网络模块302为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The mobile terminal provides users with wireless broadband Internet access through the network module 302, such as helping users to send and receive emails, browse web pages, and access streaming media.
音频输出单元303可以将射频单元301或网络模块302接收的或者在存储器309中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元303还可以提供与移动终端300执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元303包括扬声器、蜂鸣器以及受话器等。The audio output unit 303 may convert the audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into audio signals and output them as sounds. Moreover, the audio output unit 303 may also provide audio output related to a specific function performed by the mobile terminal 300 (for example, call signal reception sound, message reception sound, etc.). The audio output unit 303 includes a speaker, a buzzer, a receiver, and the like.
输入单元304用于接收音频或视频信号。输入单元304可以包括图形处理器(Graphics Processing Unit,GPU)3041和麦克风3042,图形处理器3041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元306 上。经图形处理器3041处理后的图像帧可以存储在存储器309(或其它存储介质)中或者经由射频单元301或网络模块302进行发送。麦克风3042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元301发送到移动通信基站的格式输出。The input unit 304 is used to receive audio or video signals. The input unit 304 may include a graphics processing unit (GPU) 3041 and a microphone 3042. The graphics processor 3041 is configured to monitor images of still pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. Data is processed. The processed image frame may be displayed on the display unit 306. The image frame processed by the graphics processor 3041 may be stored in the memory 309 (or other storage medium) or sent via the radio frequency unit 301 or the network module 302. The microphone 3042 can receive sound, and can process such sound into audio data. The processed audio data can be converted into a format that can be sent to the mobile communication base station via the radio frequency unit 301 for output in the case of a telephone call mode.
移动终端300还包括至少一种传感器305,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板3061的亮度,接近传感器可在移动终端300移动到耳边时,关闭显示面板3061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别移动终端姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器305还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。The mobile terminal 300 also includes at least one sensor 305, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 3061 according to the brightness of the ambient light. The proximity sensor can close the display panel 3061 and the display panel 3061 when the mobile terminal 300 is moved to the ear. / Or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three-axis), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the mobile terminal (such as horizontal and vertical screen switching, related games , Magnetometer attitude calibration), vibration recognition related functions (such as pedometer, percussion), etc.; the sensor 305 can also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, Infrared sensors, etc., will not be repeated here.
显示单元306用于显示由用户输入的信息或提供给用户的信息。显示单元306可包括显示面板3061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板3061。The display unit 306 is used to display information input by the user or information provided to the user. The display unit 306 may include a display panel 3061, and the display panel 3061 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
用户输入单元307可用于接收输入的数字或字符信息,以及产生与移动终端的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元307包括触控面板3071以及其他输入设备3072。触控面板3071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板3071上或在触控面板3071附近的操作)。触控面板3071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器310,接收处理器310发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板3071。除了触 控面板3071,用户输入单元307还可以包括其他输入设备3072。具体地,其他输入设备3072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 307 can be used to receive inputted numeric or character information, and generate key signal input related to user settings and function control of the mobile terminal. Specifically, the user input unit 307 includes a touch panel 3071 and other input devices 3072. The touch panel 3071, also called a touch screen, can collect the user's touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 3071 or near the touch panel 3071. operating). The touch panel 3071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 310, the command sent by the processor 310 is received and executed. In addition, the touch panel 3071 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 3071, the user input unit 307 may also include other input devices 3072. Specifically, other input devices 3072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, and joystick, which will not be repeated here.
进一步地,触控面板3071可覆盖在显示面板3061上,当触控面板3071检测到在其上或附近的触摸操作后,传送给处理器310以确定触摸事件的类型,随后处理器310根据触摸事件的类型在显示面板3061上提供相应的视觉输出。虽然在图4中,触控面板3071与显示面板3061是作为两个独立的部件来实现移动终端的输入和输出功能,但是在某些实施例中,可以将触控面板3071与显示面板3061集成而实现移动终端的输入和输出功能,具体此处不做限定。Further, the touch panel 3071 can be overlaid on the display panel 3061. When the touch panel 3071 detects a touch operation on or near it, it is transmitted to the processor 310 to determine the type of the touch event, and then the processor 310 responds to the touch The type of event provides corresponding visual output on the display panel 3061. Although in FIG. 4, the touch panel 3071 and the display panel 3061 are used as two independent components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 3071 and the display panel 3061 can be integrated The implementation of the input and output functions of the mobile terminal is not specifically limited here.
接口单元308为外部装置与移动终端300连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元308可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到移动终端300内的一个或多个元件或者可以用于在移动终端300和外部装置之间传输数据。The interface unit 308 is an interface for connecting an external device with the mobile terminal 300. For example, the external device may include a wired or wireless headset port, an external power source (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, audio input/output (I/O) port, video I/O port, headphone port, etc. The interface unit 308 can be used to receive input (for example, data information, power, etc.) from an external device and transmit the received input to one or more elements in the mobile terminal 300 or can be used to connect to the mobile terminal 300 and external Transfer data between devices.
存储器309可用于存储软件程序以及各种数据。存储器309可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器309可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 309 can be used to store software programs and various data. The memory 309 may mainly include a storage program area and a storage data area. The storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data (such as audio data, phone book, etc.) created by the use of mobile phones. In addition, the memory 309 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
处理器310是移动终端的控制中心,利用各种接口和线路连接整个移动终端的各个部分,通过运行或执行存储在存储器309内的软件程序和/或模块,以及调用存储在存储器309内的数据,执行移动终端的各种功能和处理数据,从而对移动终端进行整体监控。处理器310可包括一个或多个处理单元;可选地,处理器310可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线 通信。可以理解的是,上述调制解调处理器也可以不集成到处理器310中。The processor 310 is the control center of the mobile terminal. It uses various interfaces and lines to connect the various parts of the entire mobile terminal, runs or executes software programs and/or modules stored in the memory 309, and calls data stored in the memory 309 , Perform various functions of the mobile terminal and process data, so as to monitor the mobile terminal as a whole. The processor 310 may include one or more processing units; optionally, the processor 310 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, and application programs, etc. The adjustment processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 310.
移动终端300还可以包括给各个部件供电的电源311(比如电池),可选地,电源311可以通过电源管理系统与处理器310逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile terminal 300 may also include a power source 311 (such as a battery) for supplying power to various components. Optionally, the power source 311 may be logically connected to the processor 310 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. Management and other functions.
另外,移动终端300包括一些未示出的功能模块,在此不再赘述。In addition, the mobile terminal 300 includes some functional modules not shown, which will not be repeated here.
可选地,本公开实施例还提供一种移动终端,包括处理器310,存储器309,存储在存储器309上并可在所述处理器310上运行的计算机程序,该计算机程序被处理器310执行时实现上述步进电机的控制方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, an embodiment of the present disclosure also provides a mobile terminal, including a processor 310, a memory 309, a computer program stored in the memory 309 and capable of running on the processor 310, and the computer program is executed by the processor 310 The various processes of the above-mentioned stepping motor control method embodiment are realized at a time, and the same technical effect can be achieved. To avoid repetition, details are not described here.
本公开实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述步进电机的控制方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。The embodiments of the present disclosure also provide a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, each process of the above-mentioned stepper motor control method embodiment is realized, and can achieve The same technical effect is not repeated here in order to avoid repetition. Wherein, the computer-readable storage medium, such as read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, It also includes other elements not explicitly listed, or elements inherent to the process, method, article, or device. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article or device that includes the element.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本公开各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of the present disclosure essentially or the part that contributes to the related technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk). ) Includes several instructions to make a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present disclosure.
上面结合附图对本公开的实施例进行了描述,但是本公开并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的, 本领域的普通技术人员在本公开的启示下,在不脱离本公开宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本公开的保护之内。The embodiments of the present disclosure have been described above with reference to the accompanying drawings, but the present disclosure is not limited to the above-mentioned specific embodiments. The above-mentioned specific embodiments are only illustrative and not restrictive. Those of ordinary skill in the art are Under the enlightenment of the present disclosure, many forms can be made without departing from the purpose of the present disclosure and the scope of protection of the claims, all of which fall within the protection of the present disclosure.

Claims (12)

  1. 一种步进电机的控制方法,包括:A control method of a stepping motor includes:
    在步进电机推动滑块由第一限位向第二限位移动的过程中,确定所述滑块的当前位置;Determining the current position of the slider during the process of pushing the slider from the first limit to the second limit by the stepping motor;
    若所述当前位置与所述第二限位间的距离大于预设阈值,则按照第一电流驱动所述步进电机;If the distance between the current position and the second limit is greater than a preset threshold, drive the stepping motor according to the first current;
    若所述距离小于所述预设阈值,则按照第二电流驱动所述步进电机,所述第二电流小于所述第一电流。If the distance is less than the preset threshold, the stepping motor is driven according to a second current, which is less than the first current.
  2. 根据权利要求1所述的方法,其中,所述第二电流为所述步进电机推动所述滑块移动所需的极限最小电流。The method according to claim 1, wherein the second current is a limit minimum current required by the stepper motor to push the slider to move.
  3. 根据权利要求2所述的方法,还包括:The method according to claim 2, further comprising:
    若检测到所述滑块移动至所述第二限位或按照所述第二电流持续驱动所述步进电机的时长达到时长阈值,则控制所述步进电机停止运行。If it is detected that the sliding block moves to the second limit or the duration of continuously driving the stepping motor according to the second current reaches a duration threshold, the stepping motor is controlled to stop running.
  4. 根据权利要求2所述的方法,其中,所述步进电机在按所述第一电流和所述第二电流运行时的转速为第一转速;3. The method according to claim 2, wherein the rotation speed of the stepping motor when operating at the first current and the second current is the first rotation speed;
    其中,在所述确定所述滑块的当前位置之前,所述方法还包括:Wherein, before the determining the current position of the slider, the method further includes:
    从所述步进电机的启动时刻开始,按照第二转速和第三电流驱动所述步进电机;Starting from the moment of starting the stepping motor, driving the stepping motor according to the second rotational speed and the third current;
    在按照所述第二转速和所述第三电流驱动所述步进电机第一时长时,按照第三转速和所述第三电流驱动所述步进电机,其中,所述第二转速小于所述第三转速,所述第三转速大于所述第一转速,所述第三电流大于所述第二电流;When the stepping motor is driven for the first time period according to the second rotation speed and the third current, the stepping motor is driven according to the third rotation speed and the third current, wherein the second rotation speed is less than The third rotational speed, the third rotational speed is greater than the first rotational speed, and the third current is greater than the second current;
    所述确定所述滑块的当前位置,包括:The determining the current position of the slider includes:
    在按照所述第三转速和所述第三电流驱动所述步进电机第二时长后,确定所述当前位置。After the stepping motor is driven for a second duration according to the third rotational speed and the third current, the current position is determined.
  5. 根据权利要求1~4中任一项所述的方法,其中,所述滑块上设置有磁铁;The method according to any one of claims 1 to 4, wherein a magnet is provided on the slider;
    其中,所述确定所述滑块的当前位置,包括:Wherein, the determining the current position of the slider includes:
    获取第一霍尔传感器对所述磁铁的第一检测值,所述第一霍尔传感器靠近所述第一限位设置;Acquiring a first detection value of the magnet by a first hall sensor, and the first hall sensor is arranged close to the first limit;
    获取第二霍尔传感器对所述磁铁的第二检测值,所述第二霍尔传感器靠近所述第二限位设置;Acquiring a second detection value of the magnet by a second Hall sensor, and the second Hall sensor is arranged close to the second limit;
    根据所述第一检测值和所述第二检测值,确定所述当前位置。The current position is determined according to the first detection value and the second detection value.
  6. 一种移动终端,包括:A mobile terminal, including:
    确定模块,用于在步进电机推动滑块由第一限位向第二限位移动的过程中,确定所述滑块的当前位置;The determining module is used for determining the current position of the slider when the stepper motor pushes the slider from the first limit to the second limit;
    控制模块,用于在所述当前位置与所述第二限位间的距离大于预设阈值的情况下,按照第一电流驱动所述步进电机;A control module, configured to drive the stepping motor according to a first current when the distance between the current position and the second limit is greater than a preset threshold;
    所述控制模块还用于:在所述距离小于所述预设阈值的情况下,按照第二电流驱动所述步进电机,所述第二电流小于所述第一电流。The control module is further configured to drive the stepping motor according to a second current when the distance is less than the preset threshold, and the second current is less than the first current.
  7. 根据权利要求6所述的移动终端,其中,所述第二电流为所述步进电机推动所述滑块移动所需的极限最小电流。The mobile terminal according to claim 6, wherein the second current is a limit minimum current required by the stepping motor to push the slider to move.
  8. 根据权利要求7所述的移动终端,其中,所述控制模块,还用于:The mobile terminal according to claim 7, wherein the control module is further used for:
    在检测到所述滑块移动至所述第二限位或按照所述第二电流持续驱动所述步进电机的时长达到时长阈值的情况下,控制所述步进电机停止运行。When it is detected that the slider moves to the second limit or the duration of continuously driving the stepping motor according to the second current reaches a duration threshold, the stepping motor is controlled to stop running.
  9. 根据权利要求7所述的移动终端,其中,所述步进电机在按所述第一电流和所述第二电流运行时的转速为第一转速;8. The mobile terminal according to claim 7, wherein the rotation speed of the stepping motor when operating at the first current and the second current is the first rotation speed;
    其中,所述控制模块在所述确定所述滑块的当前位置之前,还用于:Wherein, the control module is further configured to: before determining the current position of the slider:
    从所述步进电机的启动时刻开始,按照第二转速和第三电流驱动所述步进电机;Starting from the moment of starting the stepping motor, driving the stepping motor according to the second rotational speed and the third current;
    在按照所述第二转速和所述第三电流驱动所述步进电机第一时长时,按照第三转速和所述第三电流驱动所述步进电机,其中,所述第二转速小于所述第三转速,所述第三转速大于所述第一转速,所述第三电流大于所述第二电流;When the stepping motor is driven for the first time period according to the second rotation speed and the third current, the stepping motor is driven according to the third rotation speed and the third current, wherein the second rotation speed is less than The third rotational speed, the third rotational speed is greater than the first rotational speed, and the third current is greater than the second current;
    所述确定模块,具体用于:The determining module is specifically used for:
    在按照所述第三转速和所述第三电流驱动所述步进电机第二时长后,确定所述当前位置。After the stepping motor is driven for a second duration according to the third rotational speed and the third current, the current position is determined.
  10. 根据权利要求6~9中任一项所述的移动终端,其中,所述滑块上设置有磁铁;The mobile terminal according to any one of claims 6-9, wherein a magnet is provided on the slider;
    其中,所述确定模块,包括:Wherein, the determining module includes:
    第一获取子模块,用于获取第一霍尔传感器对所述磁铁的第一检测值,所述第一霍尔传感器靠近所述第一限位设置;The first acquisition sub-module is configured to acquire the first detection value of the magnet by the first Hall sensor, and the first Hall sensor is arranged close to the first limit;
    第二获取子模块,用于获取第二霍尔传感器对所述磁铁的第二检测值,所述第二霍尔传感器靠近所述第二限位设置;A second acquisition sub-module, configured to acquire a second detection value of the magnet by a second Hall sensor, the second Hall sensor being arranged close to the second limit;
    确定子模块,用于根据所述第一检测值和所述第二检测值,确定所述当前位置。The determining sub-module is configured to determine the current position according to the first detection value and the second detection value.
  11. 一种移动终端,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至5中任一项所述的方法的步骤。A mobile terminal, comprising: a memory, a processor, and a computer program stored on the memory and capable of running on the processor, the computer program being executed by the processor is implemented as in claims 1 to 5 Any of the steps of the method.
  12. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至5中任一项所述的方法的步骤。A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are realized.
PCT/CN2020/085669 2019-04-28 2020-04-20 Control method for step motor and mobile terminal WO2020221044A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910348649.5A CN109981009B (en) 2019-04-28 2019-04-28 Control method of stepping motor and mobile terminal
CN201910348649.5 2019-04-28

Publications (1)

Publication Number Publication Date
WO2020221044A1 true WO2020221044A1 (en) 2020-11-05

Family

ID=67086716

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/085669 WO2020221044A1 (en) 2019-04-28 2020-04-20 Control method for step motor and mobile terminal

Country Status (2)

Country Link
CN (1) CN109981009B (en)
WO (1) WO2020221044A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114719799A (en) * 2022-03-04 2022-07-08 武汉海微科技有限公司 Soft material boundary detection method and device and storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981009B (en) * 2019-04-28 2021-12-07 维沃移动通信有限公司 Control method of stepping motor and mobile terminal
CN110410955B (en) * 2019-07-22 2021-03-19 广东美的制冷设备有限公司 Control method and device of stepping motor, air conditioner and storage medium
CN112492127B (en) * 2019-09-12 2022-06-17 北京小米移动软件有限公司 Camera positioning method and device, electronic equipment and readable storage medium
CN110581952A (en) * 2019-09-17 2019-12-17 深圳市万普拉斯科技有限公司 Camera lifting control method and device and mobile terminal
CN110602399A (en) * 2019-09-17 2019-12-20 深圳市万普拉斯科技有限公司 Processing method and device for lifting obstacle of camera and mobile terminal
CN111243481B (en) * 2020-01-21 2024-04-26 维沃移动通信有限公司 Electronic equipment and driving method
CN113471805A (en) * 2020-03-31 2021-10-01 北京科益虹源光电技术有限公司 Control method and device for improving wavelength stability of laser
CN112558525B (en) * 2020-12-14 2022-03-18 广州极飞科技股份有限公司 Motion control method, motion control device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03217805A (en) * 1990-01-24 1991-09-25 Hitachi Ltd Automatic focusing device for video camera
CN105657258A (en) * 2015-12-30 2016-06-08 青岛海信移动通信技术股份有限公司 Method and device for controlling motor in zoom camera module
CN107499375A (en) * 2017-07-12 2017-12-22 北京汽车股份有限公司 Electric boosting steering system, control method and automobile
CN109639185A (en) * 2018-12-05 2019-04-16 维沃移动通信有限公司 A kind of motor control method and terminal device
CN109981009A (en) * 2019-04-28 2019-07-05 维沃移动通信有限公司 A kind of control method and mobile terminal of stepper motor

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102118128B (en) * 2009-12-31 2013-03-13 北大方正集团有限公司 Control method and device for accurate positioning on stepping motor
CN106849786A (en) * 2016-12-28 2017-06-13 江苏博权医疗科技有限公司 A kind of medical stepper motor acceleration and deceleration travel control device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03217805A (en) * 1990-01-24 1991-09-25 Hitachi Ltd Automatic focusing device for video camera
CN105657258A (en) * 2015-12-30 2016-06-08 青岛海信移动通信技术股份有限公司 Method and device for controlling motor in zoom camera module
CN107499375A (en) * 2017-07-12 2017-12-22 北京汽车股份有限公司 Electric boosting steering system, control method and automobile
CN109639185A (en) * 2018-12-05 2019-04-16 维沃移动通信有限公司 A kind of motor control method and terminal device
CN109981009A (en) * 2019-04-28 2019-07-05 维沃移动通信有限公司 A kind of control method and mobile terminal of stepper motor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114719799A (en) * 2022-03-04 2022-07-08 武汉海微科技有限公司 Soft material boundary detection method and device and storage medium
CN114719799B (en) * 2022-03-04 2024-04-26 武汉海微科技股份有限公司 Soft material boundary detection method, device and storage medium

Also Published As

Publication number Publication date
CN109981009A (en) 2019-07-05
CN109981009B (en) 2021-12-07

Similar Documents

Publication Publication Date Title
WO2020221044A1 (en) Control method for step motor and mobile terminal
US11463566B2 (en) Camera control method and mobile terminal
WO2021098678A1 (en) Screencast control method and electronic device
WO2021139694A1 (en) Control method and device, and electronic apparatus
WO2020216002A1 (en) Detection method and mobile terminal
US11297239B2 (en) Lens control method and mobile terminal
US20200257433A1 (en) Display method and mobile terminal
WO2019120087A1 (en) Processing method for reducing power consumption and mobile terminal
WO2020143663A1 (en) Display method and mobile terminal
WO2021098672A1 (en) Display method and electronic device
WO2021013009A1 (en) Photographing method and terminal device
WO2020042838A1 (en) Camera control method and terminal
WO2020233323A1 (en) Display control method, terminal device, and computer-readable storage medium
WO2020238497A1 (en) Icon moving method and terminal device
WO2020207379A1 (en) Screen splitting method and terminal device
CA3092598C (en) Display method and mobile terminal
WO2019184947A1 (en) Image viewing method and mobile terminal
WO2021036603A1 (en) Application program control method and terminal
WO2020156444A1 (en) Electronic device and control method therefor
WO2021036659A1 (en) Video recording method and electronic apparatus
WO2021129732A1 (en) Display processing method and electronic device
WO2021147911A1 (en) Mobile terminal, method for detecting image capturing mode, and storage medium
WO2020135092A1 (en) Permission management method and terminal device
WO2020238582A1 (en) Stepper motor detection method, apparatus and system
CN110784575A (en) Electronic equipment and shooting method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20799388

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20799388

Country of ref document: EP

Kind code of ref document: A1