HITI Motor Group

A HITI Motor Group is a variable which lets you synchronize the motions of several HITI Servos moving at the same time, which means they start and stop their motions at the same time.

 

1) 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:

  1. init(quantity) => empty the Group and specify the quantity of new Servos it will contain
  2. 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.

 

2) Setpoints

The position setpoint for each Servo is set individually. To set the Group motion time (s):

  • motionTime(motion time) =>  set motion time (float)

 

3) Max speed

The max speed set for each Servo is respected. This means that the Group Motion Time may be increased accordingly.

 

4) 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()

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*)

 

Was this article helpful?
0 out of 0 found this helpful