Skip to content
Snippets Groups Projects
Commit a3c62973 authored by Torben Petersen's avatar Torben Petersen
Browse files

Extended the README

parent 2246a89f
No related branches found
No related tags found
No related merge requests found
......@@ -55,11 +55,11 @@ The following section describe the most important modules and what their respect
#### Sensor
The sensor modules are basically drivers. They read out the temperature data on a regular basis and post it under their respective topic (check the drivers for more details). These are then requested by other modules in order to get the current temperature of the chamber. Currently their are modules for the SHT21 and the DS18B20.
#### Chamber
The chamber module is the core component of the controller. It requests the current temperature and adjusts the power supply voltage and current direction in order to reach the target temperature. This requires some input data, e.g. which sensor provides the temperature inside the chamber. Thos data is stored inside the *modules.cfg* file which needs to be located in the same directory as the module_loader with the chamber module is executed. If you follow the steps as explained in the tutorial this should not be a problem.
#### Chambercontroller
The chambercontroller module is the core component of the chamber. It requests the current temperature and adjusts the power supply voltage and current direction in order to reach the target temperature. This requires some input data, e.g. which sensor provides the temperature inside the chamber. Thos data is stored inside the *modules.cfg* file which needs to be located in the same directory as the module_loader with the chambercontroller module is executed. If you follow the steps as explained in the tutorial this should not be a problem.
### How to use
The chamber module provides one topic which is called *chamber/<HOSTNAME>/temp*. Transmitting a message to this topic causes the target temperature for the chamber to change. The script *examples/chamber.py* provides an example on how to send and request data from the chambers. It should work without a problem when run on the Raspi that has been set up as the chamber controller. When running on another device to control the chamber remotely it may require some changes, e.g. changing the MQTT topics respectively.
The chambercontroller module provides one topic which is called *chamber/<HOSTNAME>/temp*. Transmitting a message to this topic causes the target temperature for the chamber to change. The script *examples/chamber.py* provides an example on how to send and request data from the chambers. It should work without a problem when run on the Raspi that has been set up as the chamber controller. When running on another device to control the chamber remotely it may require some changes, e.g. changing the MQTT topics respectively.
The chamber temperature is provided by the topic that is descirbed in the config file. If you followed the tutorial this file should be */home/pi/lctc-software/modules.cfg*. The parameters should be called **ChamberTemperatureTopic**.
## FAQ
......@@ -77,14 +77,19 @@ The script was designed to only work for the **SHT21** and **DS18B20** sensors.
### How do I start additional or different modules
For this you need to modify the config file of the demon, which is stored at */etc/supervisor/lctc.conf*.
## Implementing own modules
### The temperature changes very slowly
Make sure that there are no current limitations from the power supply. The shield uses transistors, which allow the chamber module to tune the current that flows into the peltier elements. We usually run the chambers with 5.1A maximum current.
TODO
## Implementing code for different hardware
This section should allow you a quicker start when implementing code for own hardware.
### Sensors
If you wish to use another sensor for temperature detection, you need to implement your own driver as a module, which needs to be located in the *modules* folder. Use the existing modules, i.e. *DS18B20* and *SHT21* as reference. Basically the driver needs to read the temperature value on a regular basis, which is then published on a dedicated MQTT topic. If the chamber should use this sensor, the topic of the sensor needs to be handed over to the chamber via the *modules.cfg* file! Don't forget to restart the demon after changing the file, since it's only read once on system start.
### Power supplies
Implementing a new power supply is different compared to sensors. The communication with the power supplies is not handled by individual modules, but rather the chambercontroller module. Inside this module, a protocoll class needs to be implemented for every power supply. These classes handle the communication with the power supply and allow for the chambercontroller to change the voltage. Use *MansonSerialProtocol* or *KoradSerialProtocol* as reference when implementing code for a different voltage supply. Make sure that all these functions are implemented.
Afterwards you need to write code that enables the chambercontroller to find the power supply. The function *get_powersupply_proto* seatches for available power supplies and returns a reference to the protocol class, which would allow communication with the first available power supply. You need to extend the existing function to detect the power supply you wish to implement. For this purpose you need to make sure, that the power supply is listed under */dev/power/* when plugged into the PI via USB. This will propably require a new UDEV rule, but you can use our custom rules for reference when implementing your own.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment