Programming Model
The knee controller program follows the parallel programming model. Each "c" source file performing a given function is mapped to a process. A process is a mini-system, with its own set of input and output (channels). Processes can communicate simultaneously between themselves or directly to the external interface. For additional details, please refer to the Inmos Ansi C Toolset User Manual.
Software Structure Configuration
The configuration file is generally stored in the directory listed under the config file->path setting under the Resource Location page.
The config file provides the:
The knee controller consists of 4 processes:
and is mapped to the hardware in the way shown below. The current configuration file name and location can be found in the Resource Location page.
It is not necessary to go into the details like channel names since those may change in the near future.
Process Specification
user
This process interfaces with the user at the beginning to initialize the Sunnyside A/D and D/A converters. The actuator reference point will also be set and stored during this stage. After the initialization, this process will exit and leave the controller looping in the slave transputer.
from_adc
This process interacts with the Sunnyside A/D converter. It buffers the input at the synchronized signal issued by the to_dac process. The converted signals are then fed to the control process. This from_adc process will wait until the synchronized signal is triggered again.
to_dac
This process buffers the incoming data, does the conversion, sends the results to the Sunnyside D/A converter, and then triggers the synchronized signal to the from_adc process to get a new sample.
c_law
This is the core of the controller.
It continuously gets the input from the from_adc process, computes the
control signal for the actuator, and sends the output to the to_dac
process.