AC.motion

June 22, 2008

Simulating the environment

My current thoughts on the subject.

The simulated ship has a definite
  • position
  • heading
  • velocity vector (speed and direction, which might not be along the heading!)
The environment acts on these parameters:
  • Inertia (linear and rotational). When you turn an engine or thruster on or off, the ship won't start or stop moving/ rotating at once.
  • Resistance (linear and rotational). Velocity and form (it makes a difference to push the ship forward or sideways) creates drag which slows down movement.
  • Wind. Wind might push the ship through the water. The speed of the water moving could be measured.
  • Current. Currents take the ship along though the speed relative to the water may even be zero. Can be measured only by GPS.
  • Waves. Waves probably cause effects similar to wind and current: they push the ship around a bit.
There may be other influences such as hitting an immobile obstacle, pushing around floating objects, or pulling a snagged line.

Sensors such as a compass and GPS are mounted on the ship. In an ideal world the compass gives us the heading of the ship, and the GPS the location. In reality, sensors produce jittery data since measurements carry a certain error, and individual measurements will "jump around" even if nothing changes. GPS for civil use even has a built-in inaccuracy as demanded by the US military.

A compass might provide false readings due to electromagnetic interference. The GPS position sometimes jumps around erratically, shows movement when stopped of the other way round, or provides no data at all due to bad reception. The ship will have to make sense of all that.

The simulators for compass and GPS will take the heading and position of the simulated ship and introduce typical errors by configuration or on request.

On the other side there are actuators such as the engine of the ship, the rudder, and the bow and stern thrusters. In an ideal world the effects of actuator settings leads to a certain behavior of the ship (accelerate, turn). In the real world there are small waves and turbulences which influence the actual performance.

The simulated acceleration and speed of linear and rotational movement will be slightly "uneven". More massive problems can be simulated as well, such as obstruction of movement (the ship is immobilized by external influences), loss of actuator power or control (stuck rudder, lost or stuck propeller, power controller not working at all, "misbehaving", or "stuck" in a specific position).

The simulated actuators act on the simulated ship.

In example, if the engine is producing a certain thrust the ship will accelerate depending of the force provided, mass of the ship, and resistance of the water. The movement will change the position of the simulated ship which in turn will change the position delivered by the simulated GPS.

As another example, the rudder or thruster setting will turn the ship depeding on force provided, rotational inertia of the ship, and resitance of the water. The rotation will change the heading of the simulated ship which in turn will change the heading delivered by the simulated compass.

Once the ship has been built actual performance data such as acceleration and speed for certain power and rudder/ thruster settings can be measured, and likewise sensor behavior.

0 Comments:

Post a Comment

<< Home