MultiStepper功能及函數功能

本文爲翻譯,歡迎糾錯。

MultiStepper Class Reference 多步進電機類引用

Operate multiple AccelSteppers in a co-ordinated fashion. More...

協調運行多個步進電機

#include <MultiStepper.h>

Public Member Functions 公共成員函數

  MultiStepper ()
  Constructor. 構造函數
 
boolean  addStepper (AccelStepper &stepper) 添加電機
 
void  moveTo (long absolute[]) 移動到指定位置(長整型 絕對位置)
 
boolean  run () 多電機運行
 
void  runSpeedToPosition () 多電機分別運行到設定的目標位置
 

Detailed Description 功能描述

Operate multiple AccelSteppers in a co-ordinated fashion.

協調操作多個步進電機

This class can manage multiple AccelSteppers (up to MULTISTEPPER_MAX_STEPPERS = 10), and cause them all to move to selected positions at such a (constant) speed that they all arrive at their target position at the same time. This can be used to support devices with multiple steppers on say multiple axes to cause linear diagonal motion. Suitable for use with X-Y plotters, flatbeds, 3D printers etc to get linear straight line movement between arbitrary 2d (or 3d or ...) positions.

這個類可以管理多個AccelSteppers(最多爲MULTISTEPPER_MAX_STEPPERS = 10),並使它們以(恆定的)一定的速度移動到選定的位置,從而使它們同時到達目標位置。這可以用來支持有多個步進電機,即多軸造成線性對角運動的設備。適用於X-Y繪圖儀,平板,3D打印機等,以獲得線性直線運動之間的任意2d(或3D或…)位置。

Caution: only constant speed stepper motion is supported: acceleration and deceleration is not supported All the steppers managed by MultiStepper will step at a constant speed to their target (albeit perhaps different speeds for each stepper).

注意:只支持恆速步進運動:不支持加減速。所有由MultiStepper管理的步進器都將以恆速步進到它們的目標(儘管每個步進器的速度可能不同)。

Member Function Documentation 成員函數

◆ addStepper() 添加電機

boolean MultiStepper::addStepper ( AccelStepper &  stepper )  

Add a stepper to the set of managed steppers There is an upper limit of MULTISTEPPER_MAX_STEPPERS = 10 to the number of steppers that can be managed

將一個步進電機添加到可管理的步進器集合中。MULTISTEPPER_MAX_STEPPERS可管理的步進電機數量的上限爲10。

Parameters 參數

[in] stepper 步進電機 Reference to a stepper to add to the managed list 引用要添加到託管列表中的步進電機

Returns

true if successful. false if the number of managed steppers would exceed MULTISTEPPER_MAX_STEPPERS

如果成功返回Ture。如果託管步進電機的數量超過MULTISTEPPER_MAX_STEPPERS,則爲false

◆ moveTo() 運行至

void MultiStepper::moveTo ( long  absolute[] 絕對位置 )  

Set the target positions of all managed steppers according to a coordinate array. New speeds will be computed for each stepper so they will all arrive at their respective targets at very close to the same time.

根據座標數組設置所有託管步進電機的目標位置。計算新的每一個步進電機同時完成的速度,使他們都將到達各自的目標在非常接近的時間。

Parameters 參數

[in] absolute

An array of desired absolute stepper positions. absolute[0] will be used to set the absolute position of the first stepper added by addStepper() etc. The array must be at least as long as the number of steppers that have been added by addStepper, else results are undefined.

一個數組裝所需的絕對步進位置。絕對[0]將用於設置addStepper()等添加的第一個步進器的絕對位置。數組必須至少與addStepper所添加的步進電機的數目一樣長,否則結果是未定義的。

References AccelStepper::currentPosition()AccelStepper::maxSpeed()AccelStepper::moveTo(), and AccelStepper::setSpeed().

◆ run()  運行

boolean MultiStepper::run (   )  

Calls runSpeed() on all the managed steppers that have not acheived their target position.

對所有沒有達到目標位置的託管的步進電機調用runSpeed()。

Returns 返回值

true if any stepper is still in the process of running to its target position.

如果任意一個步進電機仍然在運動到它目標位置的過程中則返回Ture.

References AccelStepper::runSpeed(), and AccelStepper::setCurrentPosition().

Referenced by runSpeedToPosition().

◆ runSpeedToPosition() 運行電機到指定位置

void MultiStepper::runSpeedToPosition (   )  

Runs all managed steppers until they acheived their target position. Blocks until all that position is acheived. If you dont want blocking consider using run() instead.

運行所有管理的步進電機,直到他們達到他們的目標位置。直到所有的位置被完成前是不能退出的。如果您不想使用不受控,可以考慮使用run()。

References run().

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章