> For the complete documentation index, see [llms.txt](https://delta-robotics.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://delta-robotics.gitbook.io/docs/get-started/quickstart.md).

# Quickstart: your first flex

Install the ThermoFlex Python API, connect the Node over USB, and run a minimal script that heats a muscle into its first contraction in minutes

This is the shortest path from an unboxed kit to a muscle that moves. You will install the ThermoFlex Python API, connect the ThermoFlex Node Controller, and run a short script that heats a muscle until it contracts.

{% hint style="danger" %}
**The wire gets hot enough to burn.** Keep hands clear of the muscle while it is powered, and be ready to stop it with the Node's button or by cutting power. The basic script has no temperature or current limit, so an over-long run will overheat the muscle and can destroy it in seconds. Start low and short, then increase.
{% endhint %}

Read [Safety essentials](/docs/get-started/safety.md) before your first run.

{% stepper %}
{% step %}

### Gather what you need

You need the ThermoFlex evaluation kit, or the equivalent parts on their own:

* A ThermoFlex Node Controller
* A ThermoFlex muscle (or a trained Nitinol wire or spring)
* A power source, such as a 3S LiPo with an XT60 connector or a bench supply
* A USB-C cable that carries data, not power only
  {% endstep %}

{% step %}

### Install Python and the ThermoFlex API

Install Python 3 first if you do not have it, from [python.org](https://www.python.org/downloads/). Then install the library with pip:

```bash
pip install thermoflex
```

For the full install walkthrough, see the [ThermoFlex Python API](/docs/software/thermoflex-python-api.md) page.
{% endstep %}

{% step %}

### Connect the Node

Connect power to the Node's XT60 input, then plug the Node into your computer with the USB-C cable. The Node enumerates as a serial device at 115200 baud; the Python API finds it for you.

{% hint style="warning" %}
**Run the script once with no muscle attached first.** This confirms the Node responds before it pushes current. If the code misbehaves while a muscle is connected, the muscle can overheat before you react.
{% endhint %}
{% endstep %}

{% step %}

### Run the script

Save this as `first_flex.py` and run it with `python first_flex.py`.

```python
import thermoflex as tf
import time

node = tf.get_usb_node()            # find the first Node over USB
muscle = tf.Muscle(_port=0)         # 0 = M1, 1 = M2
node.attachMuscle(muscle, 0)        # attach the muscle to port 0

muscle.setMode("percent")           # control by percent power
muscle.setSetpoint("percent", 0.5)  # 0.5 = 50 percent
muscle.setEnable(True)              # start heating

time.sleep(2)                       # hold for 2 seconds

node.disableAll()                   # stop all outputs
time.sleep(0.1)                     # let the last message send
tf.endAll()                         # end the session cleanly
```

The setpoint is a fraction from 0.0 to 1.0. Lower it to 0.3 or less for a gentle first run, then raise it once you know how your muscle behaves.
{% endstep %}

{% step %}

### Watch it contract

With power connected, the muscle heats and pulls in over a second or two, then relaxes as it cools after `disableAll()`. That contraction is your first flex.

{% hint style="success" %}
The muscle moved and then relaxed? Your Node, muscle, and power path all work. You are ready to build.
{% endhint %}
{% endstep %}
{% endstepper %}

## Where to go next

* Calibrate a safe run time for your own hardware in [First time flexing your muscles](/docs/tutorials/thermoflex/getting-started-with-our-evaluation-kit/first-time-flexing-your-muscles.md).
* Learn what each control mode and setpoint does on the [TF Node Controller](/docs/hardware/thermoflex/tf-node-controller.md) page.

## Common failures

<details>

<summary>The API cannot find the Node</summary>

Check that the Node has power on its XT60 input and that the USB-C cable carries data. Close any other program holding the serial port, then run the script again. On Windows, confirm the Node shows up as a COM port.

</details>

<details>

<summary>The muscle does not move</summary>

Confirm the muscle is on port M1 and that the high-current power source is connected. If the setpoint is very low or the run is very short, the muscle may not reach its activation temperature. Raise the percent or extend the time slightly, and watch for heat.

</details>

<details>

<summary>The muscle got too hot</summary>

Lower the percent setpoint, shorten the `time.sleep` value, and wait 30 to 40 seconds between runs so the muscle can cool. The basic script does not limit temperature; that is your job until safer defaults ship.

</details>

## Related pages

* [Safety essentials](/docs/get-started/safety.md): The hazards to respect before you power anything.
* [ThermoFlex Python API](/docs/software/thermoflex-python-api.md): Install and go deeper with the control library.
* [TF Node Controller](/docs/hardware/thermoflex/tf-node-controller.md): Interfaces, control modes, and specs.
