The Plant provides an abstraction of sensors and actuators to the FCS. It either communicates sensor and motor data with the real JAviator (Physical Plant), or else implements a simulation of the JAviator's dynamics (Simulated Plant). The Physical Plant is a program written in C that runs on the Robostix and implements device drivers for sensors and actuators. The Simulated Plant is a program written in Java that runs on any JVM.

Physical Plant

The Physical Plant on the Robostix periodically polls all sensors for new values and buffers them locally for remote requests by the FCS. The rotational speed of the four motors is controlled by generating individual PWM signals according to the motor signals received from the FCS. The physical connection between the Physical Plant and the FCS is via an RS232 serial line.

Simulated Plant

The Simulated Plant, also called the MockJAviator, is a simulation of the real JAviator. It receives the motor signals from the FCS and, in response, computes new sensor values according to an estimation of the real JAviator's behavior. To ensure compatibility with the FCS, the device-independent aspects of the Controller-Plant Interface implemented in the MockJAviator are the same as in the Physical Plant. However, instead of an RS232 serial line, the MockJAviator uses a TCP/IP connection to communicate with the FCS. Therefore, the FCS implements the device-dependent aspects of the Controller-Plant Interface not only on RS232 but also on Ethernet. An advantage of this design is that the MockJAviator can run either locally on the same machine as the FCS or remotely on some other machine.

Controller-Plant Interface

The Controller-Plant interface defines the communication protocol between the FCS and the Plant. Only the FCS initiates communication. The FCS requests new sensor values by sending a packet containing new motor signals to the Plant. In response to this packet, the Plant generates a packet containing the current sensor values and sends it back to the FCS. The Plant keeps track of the time when packets are received and slowly shuts down the motors for safety if packets have not been received for a certain amount of time (200ms in our current setting).