How do the Master Control Program and the reactor controllers communicate with each other?
Slave to Slave
If every reactor needs one USB port for itself, we will very fast run out of USB ports on normal lab computers. Therefore it is necessary that the reactors can communicate between each other that only one reactor has to be connected to the computer.
The communication system we invented works in principle as shown above. Every rector must be able to communicate with two others, so we use the normal serial port and the SoftwareSerial library to establish another serial connection via two digital pins. In our program we use pin 5 as receiver and pin 8 as transmitter. The first reactor is connected as usual to the computer with the USB port. Now, to connect a second reactor to this one, we connect pin 5 of the first with pin 0 (the TX pin) of the second and pin 8 with pin 1 (RX pin).
If now a message reaches one reactor from direction of the MCP the reactor program checks if the receiver ID in the message matches with the reactor ID. If so, the rest of the message is evaluated and the program reacts. If not, the message is forwarded to the next "deeper" reactor. This one checks again for the receiver ID and so on, until the targeted reactor is reached.
If a message goes in direction to the MCP it will be forwarded immediately, since every message towards the MCP contains measuring data because the reactors do not send messages to each other except to forward them from the MCP.
MCP to Slave
Using the protocol definition outlined on this page, multiple reactor controllers can communicate with the MCP to send online data, or receive new setpoints.
Messages consist of a three-byte header and a payload with data data.
- first byte is the Sender-ID
- second byte is the Receiver-ID
- third byte is the MessageType
- payload of tab-separated values
Parties in the communication are identified by ParticipantIDs. The MCP is identified with the ParticipantID = 0, a master-microcontroller is ParticipantID = 1 and slave controllers for the reactors start with ParticipantID = 2 for the first reactor.
To discriminate between measurements and commands, the protocol includes a MessageType parameter. Four different message types are supported, even though the current implementation uses just two of them.
MessageType |
integer value
|
Data |
0
|
Command |
1
|
DataFormat |
2
|
CommandFormat |
3
|
When two devices communicate about a certain parameter, they use standardized symbols. In the following table all supported dimension symbols are listed.
Parameter |
Symbol |
Unit
|
Dilution rate |
D |
1/h or sph
|
Agitation rate |
n |
rpm
|
Aeration rate |
q_g |
vvm or sph
|
Feed rate |
S_fin |
ml/h or sph
|
Harvest rate |
S_fout |
ml/h or sph
|
Temperature |
T |
°C
|
Biomass Signal |
Biomass |
interrupts per measurement interval
|
Turbidity |
OD |
-
|
Biomass_Concentration |
X |
gCDW/L
|
O2 saturation |
O2 |
%
|
CO2 saturation |
CO2 |
%
|
CHx saturation |
CHx |
%
|