Stepping motor controller

文档序号:1469580 发布日期:2020-02-21 浏览:24次 中文

阅读说明:本技术 一种步进电机控制器 (Stepping motor controller ) 是由 疏达 申晓敏 李�远 于 2019-10-16 设计创作,主要内容包括:本申请涉及激光雷达校准领域,尤其涉及一种步进电机控制器。本申请步进电机控制器,包括驱动模块、电机驱动器、计数模块、中断模块,驱动模块分别与电机驱动器、计数模块、中断模块连接,计数模块还与中断模块连接,所述的驱动模块用于产生并输出驱动脉冲,驱动电机驱动器工作;所述的电机驱动器响应驱动脉冲,驱动步进电机工作;计数模块用于统计驱动模块产生的脉冲数,其存储有预设脉冲数量,当计数模块计数达到预设脉冲数量时,向中断模块发出中断信号;所述的中断模块响应中断信号,控制驱动模块停止输出驱动脉冲。本控制器中断次数少,驱动步进电机平稳,流畅的运行,提高系统响应速度,提高执行效率,而且避免了丢脉冲带来的误差,精确度高。(The application relates to the field of laser radar calibration, in particular to a stepping motor controller. The stepping motor controller comprises a driving module, a motor driver, a counting module and an interruption module, wherein the driving module is respectively connected with the motor driver, the counting module and the interruption module; the motor driver responds to the driving pulse to drive the stepping motor to work; the counting module is used for counting the pulse number generated by the driving module, storing the preset pulse number, and sending an interrupt signal to the interrupt module when the counting of the counting module reaches the preset pulse number; the interrupt module responds to the interrupt signal and controls the drive module to stop outputting the drive pulse. The controller has the advantages of less interruption times, stable and smooth operation of the driving stepping motor, improvement of the response speed of the system, improvement of the execution efficiency, avoidance of errors caused by pulse loss and high accuracy.)

1. A stepping motor controller is characterized by comprising a driving module, a motor driver, a counting module and an interruption module, wherein the driving module is respectively connected with the motor driver, the counting module and the interruption module, the counting module is also connected with the interruption module,

the driving module is used for generating and outputting driving pulses to drive the motor driver to work;

the motor driver responds to the driving pulse to drive the stepping motor to work;

the counting module is used for counting the pulse number generated by the driving module, storing the preset pulse number, calculating the real-time rotating angle of the stepping motor according to the subdivision parameters of the motor driver, and sending an interrupt signal to the interrupt module when the counting of the counting module reaches the preset pulse number, namely when the stepping motor rotates to the preset angle;

the interrupt module responds to the interrupt signal and controls the drive module to stop outputting the drive pulse.

2. The stepper motor controller as defined in claim 1, wherein the subdivision parameter of the motor driver is the number of drive pulses required for one rotation of the stepper motor.

3. The stepping motor controller as claimed in claim 2, wherein the predetermined number of pulses is 400 and 25600.

4. The stepping motor controller according to claim 3, wherein the predetermined number of pulses is 5000 and 6500.

5. The stepping motor controller according to any one of claims 1-4, wherein said driving module comprises a pulse unit, a start-stop unit, an acceleration and deceleration unit,

the pulse unit is used for generating driving pulses to drive the motor driver to work;

the start-stop unit is used for controlling the pulse unit and starting or stopping the pulse unit;

the acceleration and deceleration unit is used for controlling the frequency of the driving pulse generated by the pulse unit so as to control the rotating speed of the motor.

6. The stepper motor controller of claim 2, wherein the pulse unit is a timer; the start-stop unit starts or stops the pulse unit through an enable or disable timer; the acceleration and deceleration unit controls the pulse unit to generate the frequency of the driving pulse by modifying the register value of the counter of the timer.

7. The stepping motor controller according to claim 6, wherein the interrupt module is in information communication with the start-stop unit, and the interrupt module controls the pulse unit to stop outputting the driving pulse through the start-stop unit.

8. The stepper motor controller of claim 7, wherein the driving pulse frequency is 0-5000000HZ and the stepper motor speed is 0-2000 rpm.

9. The stepping motor controller according to claim 8, further comprising an input module and an output module, wherein the input module is used for inputting subdivision parameters and preset pulse number of the motor driver, and the output module is used for outputting driving pulse frequency and stepping motor rotating speed.

10. The stepper motor controller of claim 9, wherein the input module is an input keypad and the output module is a display.

Technical Field

The invention relates to the field of laser radar calibration, in particular to a stepping motor controller.

Background

At present, in the detection device for measuring and calibrating the distance of the optical radar in the market, a motor and a driver are used as a control system to control the detection device to move so as to test the distance. However, the motor is mostly realized based on the open loop of the self-development driving board in order to drive the detection device to walk stably, so that the good effect on the aspects of motor rotation fluency, accuracy and the like cannot be achieved, and the occupation of driving system resources is high.

Disclosure of Invention

The embodiment of the application provides a stepping motor controller, and solves the problems that in the prior art, the rotation smoothness and the accuracy cannot meet the requirements, and the occupied resources are high.

To achieve the purpose, the embodiment of the invention adopts the following technical scheme:

on one hand, the stepping motor controller comprises a driving module, a motor driver, a counting module and an interruption module, wherein the driving module is respectively connected with the motor driver, the counting module and the interruption module, the counting module is also connected with the interruption module,

the driving module is used for generating and outputting driving pulses to drive the motor driver to work;

the motor driver responds to the driving pulse to drive the stepping motor to work;

the counting module is used for counting the pulse number generated by the driving module, storing the preset pulse number, calculating the real-time rotating angle of the stepping motor according to the subdivision parameters of the motor driver, and sending an interrupt signal to the interrupt module when the counting of the counting module reaches the preset pulse number, namely when the stepping motor rotates to the preset angle;

the interrupt module responds to the interrupt signal and controls the drive module to stop outputting the drive pulse.

In a possible implementation manner, the subdivision parameter of the motor driver is the number of driving pulses required by the stepping motor to rotate for one circle.

In a possible implementation manner, the number of the preset pulses is 400 and 25600.

In a possible implementation manner, the preset number of pulses is 5000-.

In a possible implementation manner, the driving module comprises a pulse unit, a start-stop unit and an acceleration and deceleration unit,

the pulse unit is used for generating driving pulses to drive the motor driver to work;

the start-stop unit is used for controlling the pulse unit and starting or stopping the pulse unit;

the acceleration and deceleration unit is used for controlling the frequency of the driving pulse generated by the pulse unit so as to control the rotating speed of the motor.

In a possible implementation manner, the pulse unit is a timer; the start-stop unit starts or stops the pulse unit through an enable or disable timer; the acceleration and deceleration unit controls the pulse unit to generate the frequency of the driving pulse by modifying the register value of the counter of the timer.

In a possible implementation manner, the interruption module is in information communication with the start-stop unit, and the interruption module controls the pulse unit to stop outputting the driving pulse through the start-stop unit.

In one possible implementation, the driving pulse frequency is 0-5000000HZ, and the rotating speed of the stepping motor is 0-2000 r/s.

In a possible implementation manner, the stepping motor controller further includes an input module and an output module, the input module is used for inputting subdivision parameters and preset pulse number of the motor driver, and the output module is used for outputting driving pulse frequency and stepping motor rotating speed.

In a possible implementation manner, the input module is an input keyboard, and the output module is a display screen.

The embodiment of the application presets the pulse quantity, the counting module generates an interruption after counting the preset pulse, an interruption signal is sent to the interruption module, the interruption module controls the driving module to stop outputting the driving pulse, and the stepping motor rotates to the preset angle. Compared with the prior art, this embodiment does not need every pulse to break once, has reduced the number of times of breaking off like this, and drive step motor is steady, smooth operation, improves system response speed, improves instruction execution efficiency, has avoided every pulse to break once to lose the error that the pulse brought moreover, and the accuracy is high, and the dolly precision can be controlled at the millimeter level.

Drawings

Fig. 1 is a schematic diagram of module connection according to an embodiment of the present application.

Fig. 2 is a schematic diagram of cell connection according to an embodiment of the present application.

In the figure: 1. a drive module; 2. a motor driver; 3. a counting module; 4. an interrupt module; 5. a pulse unit; 6. a start-stop unit; 7. an acceleration/deceleration unit; 8. an input module; 9. and an output module.

Detailed Description

The technical scheme of the application is further explained by the specific implementation mode in combination with the attached drawings.

It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.

In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or device.

As shown in fig. 1, a stepping motor controller comprises a driving module 1, a motor driver 2, a counting module 3, and an interruption module 4, wherein the driving module 1 is respectively connected with the motor driver 2, the counting module 3, and the interruption module 4, the counting module 3 is further connected with the interruption module 4,

the driving module 1 is used for generating and outputting driving pulses to drive the motor driver 2 to work;

the motor driver 2 responds to the driving pulse to drive the stepping motor to work;

the counting module 3 is used for counting the number of pulses generated by the driving module 1, storing the preset number of pulses, calculating the real-time rotation angle of the stepping motor according to the subdivision parameters of the motor driver 2, and sending an interrupt signal to the interrupt module 4 when the counting of the counting module 3 reaches the preset number of pulses, namely when the stepping motor rotates to the preset angle;

the interrupt module 4 responds to the interrupt signal and controls the driving module 1 to stop outputting the driving pulse.

The embodiment of the application sets the pulse number for the counting module 3 in advance, the counting module 3 generates an interruption after counting the preset pulse, an interruption signal is sent to the interruption module 4, the interruption module 4 controls the driving module 1 to stop outputting the driving pulse, and the stepping motor rotates to the preset angle. Compared with the prior art, this embodiment does not need every pulse to break once, has reduced the number of times of breaking off like this, and drive step motor need not stop, can be steady, smooth operation improves system response speed, improves instruction execution efficiency, has avoided every pulse to break once to lose the error that the pulse brought moreover, and the accuracy is high, and the dolly precision can be controlled at mm level.

The subdivision parameter of the motor driver is the number of driving pulses required by the stepping motor to rotate for one circle.

The subdivision parameters are 800 minus 12800.

The number of the preset pulses is 400 and 25600.

The preset number of pulses is 400-. If the subdivision parameters are 800, and the preset pulse number is 400, the stepping motor rotates 400/800=0.5 circles, namely, the stepping motor is interrupted once; the subdivision parameters are 12800, the preset pulse number is 25600, the stepping motor rotates 25600/12800=2 circles, and the interruption is performed once. Each interruption may have an error, and the smaller the number of interruptions, the smaller the overall error.

The preset pulse number is 5000-.

The preset pulse number is 6500 5000-.

If the subdivision parameters are 800, and the preset pulse number is 5000, the stepping motor rotates 5000/800=6.25 circles, namely, the stepping motor is interrupted once; the subdivision parameters are 12800, the preset pulse number is 6500, and the stepping motor rotates 6500/12800 to be approximately equal to 0.51 circle, and the interruption is performed once.

As shown in fig. 2, the driving module includes a pulse unit 5, a start/stop unit 6, and an acceleration/deceleration unit 7,

the pulse unit 5 is used for generating a driving pulse to drive the motor driver 2 to work;

the start-stop unit 6 is used for controlling the pulse unit and starting or stopping the pulse unit 5;

the acceleration and deceleration unit 7 is used for controlling the frequency of the driving pulse generated by the pulse unit 5, and further controlling the rotating speed of the motor.

The acceleration and deceleration unit 7 controls the rotation speed of the motor by controlling the frequency of the driving pulse generated by the pulse unit 5, and further controls the speed distribution of the testing device.

The pulse unit 5 is a timer; the start-stop unit 6 starts or stops the pulse unit 5 by enabling or disabling the timer; the acceleration and deceleration unit 7 controls the pulse unit 5 to generate the frequency of the driving pulse by modifying the counter register value of the timer.

The timer is a programmable general timer, and the main part of the timer is a 16-bit counter and a register related to the counter. This counter can count up, down, or both count up and down to output pulses, the pulse length and waveform period being adjustable from microseconds to milliseconds.

The registers comprise an automatic loading register and a prescaler register, register values of the automatic loading register and the prescaler register can be read, written and modified by the acceleration and deceleration unit 7, and the registers can still be read and written when the counter runs. And further controls the frequency of the driving pulse generated by the pulse unit 5.

The start stop unit 6 starts or stops the timer by enabling or disabling the timer.

The interrupt module 4 is in information communication with the start-stop unit 6, and the interrupt module 4 controls the pulse unit 5 to stop outputting the driving pulse through the start-stop unit 6.

The driving pulse frequency is 0-5000000HZ, and the rotating speed of the stepping motor is 0-2000 r/s.

The stepping motor controller further comprises an input module 8 and an output module 9, wherein the input module 8 is used for inputting subdivision parameters and preset pulse quantity of the motor driver 2, and the output module is used for outputting driving pulse frequency and stepping motor rotating speed.

The operator can input the subdivision parameters and the preset pulse number of the motor driver to the stepping motor controller through the input module 8, and then the stepping motor controller is operated. Through the output module 9, the output driving pulse frequency and the rotating speed of the stepping motor can be observed in real time.

The input module 8 is an input keyboard, and the output module 9 is a display screen.

The technical principles of the present application have been described above in connection with specific embodiments. The description is made for the purpose of illustrating the principles of the present application and is not to be construed in any way as limiting the scope of the application. Based on the explanations herein, those skilled in the art will be able to conceive of other embodiments of the present application without inventive effort, which shall fall within the scope of the present application.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种开关磁阻发电机零位初始角的标定方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!