简体   繁体   English

集首页 position 适用于步进电机STM32

[英]Set Home position for stepper motor STM32

I have a Nucleo-IHM01A1 motor driver to drive a motor mounted with a spindle.我有一个 Nucleo-IHM01A1 电机驱动器来驱动安装有主轴的电机。 The spindle has a limited length with an object in between.主轴长度有限,中间有一个 object。 As the motor spins, the object moves along the spindle.随着电机旋转,object 沿主轴移动。

How can I set the Home position of the motor such that every time I run the program on the MCU, the Home position is set when the object is at the center of the spindle.如何设置电机的 Home position,这样每次我在 MCU 上运行程序时,当 object 位于主轴中心时,就会设置 Home position。

Unfortunately, the mechanical and electrical setup you describe does not actually allow automatic home calibration in a proper way.不幸的是,您描述的机械和电气设置实际上并不能以适当的方式自动进行家庭校准。

Stepper Motors are used, as name suggests, to perform steps.顾名思义,步进电机用于执行步骤。 They are not capable of absolute positioning on their own.他们无法靠自己进行绝对定位。 If you need absolute positioning, you will have to either set your home point whenever the current position is unknown (eg. start-up or after losing steps), or add an absolute encoder to the system (then you always know the system state).如果您需要绝对定位,则必须在当前 position 未知时(例如启动或丢失步骤后)设置您的原点,或者在系统中添加绝对编码器(然后您始终知道系统状态) .

One solution for automatic home detection are limit switches , commonly used in many mechanical systems, especially 3D printers and other CNC machines.自动归位检测的一种解决方案是限位开关,通常用于许多机械系统,尤其是 3D 打印机和其他数控机床。 You might want to add one of these to your setup and drive towards the switch until it is pressed.您可能希望将其中之一添加到您的设置中,然后朝开关方向行驶,直到它被按下。 Then you move it the exact number of steps needed to move it to the center and you're done.然后你将它移动到将它移动到中心所需的确切步数,你就完成了。

However, if you can't change anything in the setup, you could just move the sled in one direction by the length of the spindle.但是,如果您无法更改设置中的任何内容,您可以将雪橇沿一个方向移动主轴的长度。 When the sled hits the end, the motor should stall and loose the remaining steps.当雪橇到达终点时,电机应该停止并松开剩余的台阶。 Then you move it back to the center (constant number of steps as previously) and you're centered.然后你把它移回中心(和以前一样,步数不变),你就居中了。 Consider that stalling motors can overheat the motor as well as the motor driver.考虑到电机失速会使电机和电机驱动器过热。 This will probably decrease their life-expectancy.这可能会降低他们的预期寿命。

There are other solutions like servos or absolute encoders but as far as I understand your goal, a limit switch should be fine.还有其他解决方案,例如伺服器或绝对编码器,但据我了解您的目标,限位开关应该没问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM