# How they work

The [first chambers](/the-chambers/original-prototypes.md) were developed at the [Seminar for Statistics](https://math.ethz.ch/sfs) of ETH Zurich, initially conceived as testbeds for causal inference algorithms. They were presented in an [open-access paper](https://www.nature.com/articles/s42256-024-00964-x) in Nature Machine Intelligence, together with their open-source [blueprints](https://github.com/juangamella/causal-chamber/tree/main/hardware) and a collection of [public datasets](https://github.com/juangamella/causal-chamber).

Since then, we have improved and expanded the [original prototypes](/the-chambers/original-prototypes.md) into the new Mk2 models, which you can operate through our [Remote Lab](/remote-lab/quickstart.md).

{% columns %}
{% column %}

<figure><img src="/files/AhcOTkjEDfnDXsS6jgVg" alt=""><figcaption></figcaption></figure>

{% content-ref url="/pages/Z8eYHzIcJtk5X0kfzXli" %}
[Wind Tunnel Mk2](/the-chambers/wind-tunnel-mk2.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}

<figure><img src="/files/13CXXYbFAbNHcDeETDsS" alt=""><figcaption></figcaption></figure>

{% content-ref url="/pages/nfKs9660N39HBagy17gT" %}
[Light Tunnel Mk2](/the-chambers/light-tunnel-mk2.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}

### What is a Chamber?

A Chamber contains a physical system and allows algorithms to control and measure its variables without human supervision. It provides validation tasks with a ground truth for a variety of algorithms from ML, AI, statistics, and engineering.

Because the physical system is well understood, we can provide a ground truth for tasks in causal inference and anomaly detection. We have also built [mechanistic models](https://arxiv.org/pdf/2404.11341#page=28) and [simulators](https://github.com/juangamella/causal-chamber-package/tree/main/causalchamber/simulators) of the physical phenomena inside the Chambers, which are particularly useful for studying problems in Sim2Real, Simulation-Based Inference, Hybrid Learning, and related fields. See the [case studies](https://docs.causalchamber.ai/case-studies/) for examples.

### Hardware configurations

A Chamber can operate under several configurations, exposing different variables of the underlying physical system. It can also set control inputs as functions of other sensor measurements, allowing for feedback mechanisms and tunable causal effects.

{% hint style="info" %}
Configurations are specified at the beginning of an experiment and loaded automatically by the Chamber.
{% endhint %}

<details>

<summary>Light Tunnel Mk2: hardware configurations</summary>

See the [hardware configurations](/the-chambers/light-tunnel-mk2.md#hardware-configurations) for the [Light Tunnel Mk2](/the-chambers/light-tunnel-mk2.md)

</details>

<details>

<summary>Wind Tunnel Mk2: hardware configurations</summary>

See the [hardware configurations](/the-chambers/wind-tunnel-mk2.md#hardware-configurations) for the [Wind Tunnel Mk2](/the-chambers/wind-tunnel-mk2.md)

</details>

### Chamber control language

<figure><img src="/files/ZW4H1y9fSLOalQuh4ASF" alt=""><figcaption></figcaption></figure>

The Chambers are controlled through a simple language with three instructions.

{% tabs %}
{% tab title="SET instruction" %}
{% code fullWidth="true" %}

```
set(target, value)
```

{% endcode %}

This sets the variable `target` to the given `value`, returning when the change has been made in the hardware.

See the [hardware configurations](#hardware-configurations) of each chamber for a list of variables and their valid and default values.
{% endtab %}

{% tab title="MEASURE instruction" %}
{% code overflow="wrap" %}

```
measure(n, delay)
```

{% endcode %}

The chamber returns `n` successive measurements of all variables, including images if it produces them. Setting `delay` (in milliseconds) adds a delay between measurements, allowing you to change the measurement frequency.

{% hint style="info" %}
The maximum measurement frequency, i.e., with `delay=0,` is approx. 12Hz for the [Wind Tunnel Mk2](/the-chambers/wind-tunnel-mk2.md) and 10Hz for the [Light Tunnel Mk2](/the-chambers/light-tunnel-mk2.md).
{% endhint %}
{% endtab %}

{% tab title="WAIT instruction" %}
{% code overflow="wrap" %}

```
wait(milliseconds)
```

{% endcode %}

The chamber acts as a precise clock and waits for the given `milliseconds` before executing the next instruction.
{% endtab %}
{% endtabs %}

Instructions can be sent synchronously (see [real-time experiments](/remote-lab/running-a-real-time-experiment.md)) or as an experiment protocol, which is placed on a [queue](/remote-lab/using-the-experiment-queue.md) and executed when a Chamber becomes available.

{% columns %}
{% column %}
{% content-ref url="/pages/eQKb9IRV2ljJzz3GaO9e" %}
[Running a real-time experiment](/remote-lab/running-a-real-time-experiment.md)
{% endcontent-ref %}
{% endcolumn %}

{% column %}
{% content-ref url="/pages/6ismfrBNj2HgguBeI1Yt" %}
[Using the experiment queue](/remote-lab/using-the-experiment-queue.md)
{% endcontent-ref %}
{% endcolumn %}
{% endcolumns %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.causalchamber.ai/the-chambers/how-they-work.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
