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):
Attractor
Motor 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. Geared Motor 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. Servo Motor 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. Spring Motor 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. Thruster
Motor 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. Destroying
Motors 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