The Idea of BIOE

Necessity is the mother of invention and so the BIOE system was developed at my diploma thesis with the view to develop a simple and low-cost hardware for control and automation tasks. The challenge was to close the gap between a common PC equipped with a real-time operating system (e.g. Linux with RTAI) and the plant with a piece of hardware, which can be build by a student within 2 hours using standard components.

The documentation of the Device Type Number (DTN) 106.

The result of this work is a mikrocontroller based module, which is connected to the PC's parallel port, a software for the purpose of testing the communication and a framework to use this system with common CACSD systems like Scilab/Scicos and the real-time operating system RTAI-Linux. Each element contains a choice of configurations, which can be activated with the corresponding DTN (Device-Type-Number). So the connection to sensor signals and the control of actuators will be done by the firmware of the BIOE. Only the final value of the sensor or actuator is transmitted using the PC's parallel port interface.

The DTN and Endpoint concept

The main idea of BIOE is to introduce a common interface for the communication with the PC. So each actor and sensor can be treated the same way and the software on PC side have not to be changed (and so not tested), if a new actor/sensor is connected to the system. The necessary modifications are done within the firmware for the BIOE mikrocontroller. Between the device function and the PC communication, the values are echanged with so-calld endpoints (EPs). This EPs, currently designed to treat 16bit values, can be accessed directly, e.g. with a SCICOS block, so that the data communication is quite transparent.

The documentation of the Device Type Number (DTN) 106.

The schematic at the right illustrates the concept of BIOE and the communication between the components. All this functions are still implemented an tested and availible for download here. To attend a new DTN configurations, only a view new lines have to be modified and the Init and Process function of the new DTN are implemented in a separate file. According to the illustration beside, the EP0 and EP1 are used for system functions like setting DTN, reading and writing the setting registers (S0, ..., S7) which can be used by the DTNs. In addition, EP15 echos all values back to the PC (host) and is used to determine, if there is a device availibe.

Availible DTN configurations and functions

At the moment, following I/O functions are published through differen DTN configurations:

  • digital I/O
  • 10bit and 8bit analog inputs
  • 10bit and 8bit PWM
  • RC5 infrared receiver
  • 2x-quadrature decoder, software based
  • 4x-quadrature decoder, with HCTL-2022
  • RC-servo PPM signal creator
  • WII Nunchuck interface (acceleration, joystick, buttons)
  • synchron seriel master/slave interface

The documentation of the Device Type Number (DTN) 106.

Interfaces for e.g. 4wire resistive touch-panels, stepper motor drivers, ultra sonic sensors still exist, but are currently not published. For example, the DTN106 configuration with the according EP allocation is shown in the left figure. This configuration can interact with 4 RC-servos, 4 10bit analog inputs, one DC motor (PWM1+OUT1A+OUT1B) and one 2x quadrature decoder.

BIOE software framework

Screenshot of BIOEGUI viewing the endpoints of a BIOE device with the address two.

For the purpose of testing BIOEs and the interconnection to the plant the tool BIOEGUI was developed, that is shown at the left. BIOEGUI can be executed on Linux and WIN32 and it allows to search all connected BIOEs, activate DTN configurations and to manipulate the EPs of the BIOEs. A similar command line based tool also exists and is called BIOEDUDE.

The BIOE blocks used in a scicos model.

The main application of BIOE are control tasks. So SCICOS blocks are availible to initialize BIOEs and to access the EPs of the BIOEs. The initialization can be done by the block BIOE_DEV. For the EPs the block BIOE_EP can be used. A sample application, where the temperature of a resistor is controlled through current for heating and a fan for cooling, is illustrated at the right that shows the corresponding SCICOS model and the used EP blocks.

BIOE master framework

More details about the BIOE master framework can be found here.

Example of application: inverted pendulum

A laboratory experiment with the target to stabilize the upper equilibrium of the pendulum by a adequate control of the car.

At the left an example laboratory setup of an inverted pendulum is illustrated. One BIOE is used to create the PWM signal for, e.g., the MOS-FET DC motor power stage. To decode the incremental encoder signals of the car position and the pendulum angle, two BIOEs with DTN101 are in use. This BIOEs are plugged into a target board, where the DC motor power stage and the power supply are placed. With the BIOE-LPT-Interface the BIOEs are connected to the PC equipped with the real-time operating system RTAI-Linux. There, e.g., Scilab/Scicos is used to develop the control law and to create the real-time task which perform the stabilization of the upper equilibrium of the pendulum. The BIOE-Scicos blocks are used to access the EP values of the BIOEs.