A HITI Motor Group is a variable which lets you synchronize the motions of several HITI Servos moving at the same time (they start and stop their motions at the same time).
How does it work ?
When you need to synchronize the motions of several Servos (for Finite Motions only), simply put them in the same Group:
- init(quantity) => empty the Group and specify the quantity of new Servos it will contain
- add(&servo) => add new Servos one by one (don’t forget the &)
Before starting the synchronized motion of a Group, you must configure several setpoints (Servos positions, Group motion time) to define the motion behavior.
Once this is done, you can start and stop the synchronized motion by several means:
- moveNow() and stopNow() => immediately start or stop the motion.
- moveOnTrigger(trigger) and stopOnTrigger(trigger) => start or stop the motion only if the trigger (bool) is activated. This trigger can be controlled from HITIPanel using a Digital Data.
Setpoints
The position setpoint for each Servo is set individually. To set the Group motion time (s):
- motionTime(motion time) => set motion time (float)
Max speed
The max speed set for each Servo is respected. This means that the Group Motion Time may be increased accordingly.
Motion monitoring
A HITI Motor Group can have 2 different states:
- Ready => ready to start a move
- Moving => being moving
Time indicators
To monitor the above states, use the following functions which return true if the Group is in the corresponding state:
- isReady()
- isMoving()
You can use these functions as time indicators to synchronize other tasks which are related to the Group motion. Simply test these functions in IF statement to trigger events or tasks at different times. In addition to the above functions which are ideal to trigger continuous tasks, the following functions are ideal for triggering Punctual tasks as they return true when the motion starts and ends:
- isStarting()
- isEnding() => (reading this time indicator also resets it)
Group Motion Time
To get the Group Motion Time (s):
- getMotionTime() => return the Group motion time (float)
HITI Servo
- getMotor() => return the HITI Servo variable (HC_Servo*)
Examples
Refer to this example : Synchronized Group
Refer to this example : Group Rearrangement
Refer to this example : Arrays of Setpoints
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article