Tutorial 4: Motors
A Motor applies forces/torques to Solids or Joints to achieve some desired effect. There are several types of Motors, including Attractor Motors, Geared Motors, Servo Motors, Spring Motors, and Thruster Motors.† This tutorial will show how to setup each type.† It will also give examples of how each type could be used.
Letís first create all the objects weíll need (and assume they will be initialized elsewhere):
Now weíll make an Attractor Motor and initialize it:
This Attractor Motor will constantly apply forces to the two Solids to make them gravitate toward one another.† This makes it easy to simulate planetary gravitation or magnetic attraction.
Next, letís make a Geared Motor:
The Geared Motorís throttle should now be updated as desired.† The Motor will have more torque available when its angular velocity is low.† As it approaches its max velocity, it will apply less and less torque.† This Motor is great for simulating automobile engines.
The next Motor is a Servo Motor:
The Servo will continually use up to its max torque to try to achieve its desired angle.† Servos are extremely stable controllers, similar to PD or PID controllers.† They make automatic adjustments to keep from overshoot their target angle.† Servos are really good for robot simulations: the robot can simply set its desired Joint angles, and the Servo automatically provides enough torque to reach that angle without overshooting.
A Spring Motor is a simple linear and/or torsional spring with damping that brings a Solid to a desired position and/or orientation:
Springs are good for all kinds of things.† In an application with 3D graphics you can connect a Spring to your camera and have it smoothly move from one desired position/orientation to the next.† They are also great for picking up objects: simply attach the selected object to a Spring with its desired position directly in front of the camera.
The final Motor is a Thruster:
Thrusters provide a constant amount of force or torque to a Solid.† This is different from the Geared Motor which runs out of torque when it reaches its max velocity.† Thrusters are naturally good as rocket engines.
When you are done with a Motor, tell the Simulator to destroy it:
OPAL is Copyright © 2004-2005 Alan Fischer, Andres Reinot, and Tyler Streeter