This repository contains a communication library for the power test bench of the Twist board converter developed by LAAS-CNRS.
This library is distributed under the terms of the GNU Lesser General Public License (LGPL) version 2.1 or later. See the LICENSE file for details.
The comm_protocol.h
file serves as the main entry point of the OwnTech Power API. It provides communication protocols and data structures for interacting with the power test bench.
The communication protocol consists of commands and messages exchanged between the test bench and external systems. These commands and messages are used to configure settings, send control signals, and receive measurements.
The Twist Board Protocol is a communication protocol used to control and configure the Twist board, a hardware device designed for various electrical control applications. This protocol allows users to send commands to the Twist board via serial communication to perform specific actions and configurations.
Once you have created your python twist object, in the example below considered as twistObject
,
you can use the following commands with the Twist Board Protocol:
-
IDLE
- Python-side command:
twistObject.sendCommand("IDLE")
- Serial-side output:
d_i
- Python-side command:
-
POWER_OFF
- Python-side command:
twistObject.sendCommand("POWER_OFF")
- Serial-side output:
d_f
- Python-side command:
-
POWER_ON
- Python-side command:
twistObject.sendCommand("POWER_ON")
- Serial-side output:
d_o
- Python-side command:
-
LEG
- Python-side command:
twistObject.sendCommand("LEG", "LEG_IDENTIFIER", "STATE")
- Possible "LEG_IDENTIFIER" =
"LEG1"
,"LEG2"
- Possible "STATE" =
"ON"
,"OFF"
- Serial-side output:
s_{LEG_IDENTIFIER}_l_{STATE}
- Python-side command:
-
CAPA
- Python-side command:
twistObject.sendCommand("CAPA", "LEG_IDENTIFIER", "STATE")
- Possible "LEG_IDENTIFIER" =
"LEG1"
,"LEG2"
- Possible "STATE" =
"ON"
,"OFF"
- Serial-side output:
s_{LEG_IDENTIFIER}_c_{STATE}
- Python-side command:
-
DRIVER
- Python-side command:
twistObject.sendCommand("DRIVER", "LEG_IDENTIFIER", "STATE")
- Possible "LEG_IDENTIFIER" =
"LEG1"
,"LEG2"
- Possible "STATE" =
"ON"
,"OFF"
- Serial-side output:
s_{LEG_IDENTIFIER}_v_{STATE}
- Python-side command:
-
BUCK
- Python-side command:
twistObject.sendCommand("BUCK", "LEG_IDENTIFIER", "STATE")
- Possible "LEG_IDENTIFIER" =
"LEG1"
,"LEG2"
- Possible "STATE" =
"ON"
,"OFF"
- Serial-side output:
s_{LEG_IDENTIFIER}_b_{STATE}
- Python-side command:
-
BOOST
- Python-side command:
twistObject.sendCommand("BOOST", "LEG_IDENTIFIER", "STATE")
- Possible "LEG_IDENTIFIER" =
"LEG1"
,"LEG2"
- Possible "STATE" =
"ON"
,"OFF"
- Serial-side output:
s_{LEG_IDENTIFIER}_t_{STATE}
- Python-side command:
-
REFERENCE
- Python-side command:
twistObject.sendCommand("REFERENCE", "LEG_IDENTIFIER", "VARIABLE", VALUE)
- Possible "LEG_IDENTIFIER" =
"LEG1"
,"LEG2"
- Possible "VARIABLE" =
"V1"
,"V2"
,"VH"
,"I1"
,"I2"
,"IH"
- Serial-side output:
s_{LEG_IDENTIFIER}_r_{VARIABLE}_{VALUE:.5f}
- Python-side command:
-
DUTY
- Python-side command:
twistObject.sendCommand("DUTY", "LEG_IDENTIFIER", VALUE)
- Possible "LEG_IDENTIFIER" =
"LEG1"
,"LEG2"
VALUE
= float up to 5 decimals- Serial-side output:
s_{LEG_IDENTIFIER}_d_{VALUE:.5f}
- Example:
s_LEG1_d_0.02233
- Python-side command:
-
CALIBRATE
- Python-side command:
twistObject.sendCommand("CALIBRATE", "VARIABLE", GAIN, OFFSET)
- Possible "VARIABLE" =
"V1"
,"V2"
,"VH"
,"I1"
,"I2"
,"IH"
GAIN
= float value up to 8 decimalsOFFSET
= float value up to 8 decimals- Serial-side output:
k_{VARIABLE}_g_{GAIN:.8f}_o_{OFFSET:.8f}
- Example:
k_V1_g_22.03409353_o_0.11349874
- Python-side command:
These are the Python-side commands that can be sent to the Twist board using the sendCommand
method along with their corresponding serial-side output formats. Use these commands to control and configure the Twist board via serial communication.