anyKode Marilou
ContentsIndexHome
PreviousUpNext
Using servos

Placing a servo in the model.

Servo rotational position behavior:

When using GoPositionXXX functions, the servo reach the desired position (if possible) according to the following rules: 

 

If the joint axis have defined limits:

  • The servo tries to reach the requested position ranged in [limitmin, limitmax]
  • The Maintain absolute angle property does not have any effect because servo always have an angle inside [-PI, +PI]

 

If the joint does not have any rotation limit AND Maintain absolute angle property is checked:

  • The servo accumulates every rotation and is able to produce an angle inside ]-inf, +inf[
  • The servo reach the requested absolute angular position by making all required 2PI rotations. For example, if the current servo angle is 0 rad and the requested position is 6PI+0.0001 rad : the servo will make 3 complete 2PI rotations + 0.0001 rad.
  • If the current position is -180.0° and the requested position is +180.0°, the servo will first go in 0° direction then in +180.0° direction.

 

If the joint does not have any rotation limit AND Maintain absolute angle property is NOT checked:

  • The servo angle is automatically ranged inside [-PI, +PI]
  • The desired position is automatically ranged inside [-PI, +PI]
  • The servo tries to reach the desired position by using the shortest way
  • If the current position is -180.0° and the requested position is +180.0°, the servo will not rotate.
  • If the current position is 0.0° (+-delta) and the requested position is +180.0°, the servo can choose to go to +180.0° or -180.0° according to numerical errors (delta)

 

Creating a servo:
Step 
Description 
(Samples/Devices/Servo).

  • Create a joint and select axis,
  • Show the Modify panel then select the Devices sub-panel.

 

 

  • Click on Choose Device icon to open the list of plugins that may be attached to this geometry.
  • Choose Servo


Mount As: represents the name of the device in the simulation.

Startup: Set it to 'On' to force servo to maintain position 0 (see below). 

 
Double-click on the sensor's reference in order to display/change its settings:

Max torque:
Servo motor's maximum torque.

Max speed:
Maximum rotation speed.

Min speed:
Minimum rotation speed.

Accuracy:
Acceptable angle error.

Min position index:
Value of the lowest index for calculating position.

Max position index:
Value of the highest index for calculating position.

Continuous Rotation enabled:
Enable/disable continuous rotations (as a simple motor speed command).

Maintain absolute angle:
Indicates if servo is able to remember all rotations and maintain an absolute global angle.

Resistant torques:
Static and viscous resistant torques. Set to 0 for disabling this feature. Those parameters override joint's axis: you can disable this behavior by checking the property do not override axis resistive torques (Instance panel). (See also axis settings)

Factor: Torque/speed factor:
Max Torque=Max Torque * Factor
Max speed=Max Speed / Factor 
 
In MODA programming, motors are accessible via the (or DeviceServoMotor class) class. The servo's full path, starting at PHX "/" is hinge0/a1/servo
 
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
What do you think about this topic? Send feedback!