> 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/learn/how-to-train-nitinol/electric.md).

# Electric

Shape-set Nitinol with the ThermoFlex Node using controlled Joule heating for fast, repeatable results using resistance feedback, an experimental workflow

The **ThermoFlex Node** shape-sets Nitinol by passing current through the wire to heat it (Joule heating), instead of relying on an external torch or oven. The Node is a current controller built for Nitinol "muscle" wires, so the hardware that drives a muscle can also train one. You get precise, localized heating, simple monitoring, and a process you can automate through the Node's Python API.

{% hint style="info" %}
This page gives the guidelines. To try it yourself, [**reach out to Mark**](mailto:mark@deltaroboticsinc.com) for the actual code and recommendations.
{% endhint %}

{% hint style="danger" %}
**Work safely: this process involves high heat and electrical current.** Working with Nitinol involves high-temperature processes and equipment that carry inherent risks. Always:

* Wear appropriate protective gear, including heat-resistant gloves, safety glasses, and protective clothing.
* Ensure proper ventilation when heating materials.
* Maintain ready access to fire safety equipment, including fire extinguishers.
* Handle all heated materials and equipment cautiously, using appropriate tools.
  {% endhint %}

<details>

<summary>Disclaimer and liability</summary>

Delta Robotics provides these guidelines for educational and informational purposes only. It is your responsibility to exercise caution, follow all provided safety instructions, and take appropriate safety measures.

Delta Robotics shall **NOT** be held responsible for any injury, damage, or loss incurred through improper or unsafe handling of materials, equipment, or processes described in our guides. Prioritize safety at all times and perform these procedures at your own risk.

</details>

<details>

<summary>Coming soon: preconfigured shape-set profiles</summary>

Delta Robotics is developing built-in shape training routines for the ThermoFlex Node. These will be available via firmware updates or the API, providing one-command execution of common training cycles (with recommended currents, durations, and ramping). Once available, you'll be able to select a profile (for example, "Standard 550°C 20min shape-set for 0.5 mm wire") and the Node will automatically run that sequence. This will simplify the process and help you apply proven parameters. Keep an eye on the ThermoFlex Node documentation for these updates.

</details>

## Why electrical shape-setting

Electrical (resistance) heating gives Nitinol training several advantages:

* **Precise, localized heating:** The wire is its own heating element, so you heat exactly the section you need without wasting energy on the air or fixtures. High current reaches 500 to 550 °C in seconds, and cutting the current cools it fast. That short time at temperature helps avoid over-aging and preserves the wire's properties \[1].
* **Control by current and feedback:** The ThermoFlex Node regulates current and reads the wire's resistance for feedback. Because the resistance of Nitinol rises with temperature \[1], the Node can infer temperature from voltage and current, then hold a target: drive current until the wire is near 550 °C, hold for 20 minutes, then shut off. The controller also has two JST connector ports for external sensors, for even more control. This closed loop gives consistent, repeatable results \[1].
* **Minimal equipment:** Beyond the Node and a DC power source, you need no ovens or furnaces. A Node, a computer, a power supply, and your fixture are enough, which suits a small lab or field use and costs far less than an industrial furnace \[1].
* **Data monitoring and logging:** Because the process is electrical, you can log current, voltage, and estimated temperature through the API, live or after the run. When the logged resistance plateaus, the wire has reached steady state at the set temperature.
* **Cleaner and flame-free:** No open flame means less risk of fire or hot surfaces, and no combustion byproducts apart from a little oxide on the wire. The wire still gets extremely hot, so treat safety seriously.

The Node pairs the speed of a torch with the control of a furnace, and it suits the ThermoFlex system it was built for.

## Before you start

Before running a shape-set cycle with the ThermoFlex Node, get the following ready:

* **Wired fixture:** Constrain the wire in the shape you want, and make sure the fixture cannot short the circuit. Use a non-conductive fixture, or isolate the wire's ends so current only flows through the wire, not through the fixture. Ceramic or high-temp plastic pins, or a fiberglass or ceramic board with anchors, work well. If you clamp between metal plates, isolate the wire at least at one end so the current cannot bypass the segment you want to heat. The wire still reaches around 550 °C, so use heat-tolerant materials such as ceramic, stainless steel, or Nichrome hooks.
* **Node connection:** Attach the wire ends to the Node's output terminals, usually clamp or screw terminals. A solid connection matters: loose contacts spark or pass inconsistent current. Use leads rated for the current and heat, and keep them off the hot section of the wire.
* **Node settings:** Using the Python API, set the shape-setting parameters:
  * **Target resistance:** The Node holds a target resistance. In our experiments we measured a coil's resistance with a source meter (about 150 mOhm for a 2 mm ThermoFlex coil) and raised the level until the actuator behaved well. The 150 mOhm figure is that coil's resistance at room temperature, while the 170 mOhm setpoint used in the script below is the higher resistance the same coil reaches near 550 °C, since a Nitinol wire's resistance rises as it heats; use the room-temperature reading to characterize your wire and the elevated value as the control setpoint during the hold. Until we have a model for picking a level from wire diameter and length, repeat this process for your wire. The [further research section](/docs/learn/further-research.md) has good starting points from the literature.
  * **Hold time:** Set how long the current runs. About 20 minutes is a solid baseline for thorough shape-setting \[1]. Run this as a timed script that disables the muscle port when the experiment finishes.
  * **Ramp or pulse (optional):** Rather than applying full current instantly, you can ramp up over a few seconds to reduce thermal shock, which helps with thicker wires, though Nitinol tolerates rapid heating well. Ramping to the setpoint over about 30 seconds is typical.
  * **Monitoring:** If you use feedback, enable resistance-based control mode. Set a data-logging interval if you want to capture the run (logging setup is still in progress, so reach out for help enabling it).

## Run the shape-set cycle

{% stepper %}
{% step %}

### Execute the shape-set cycle

Start the heating process. The Node drives current through the wire and heats it. If all goes well, the wire heats up quickly. **Do not leave it unattended.** Even though it's automated, always supervise in case of any issues (like a connection coming loose or an unexpected temperature overshoot). Under normal operation with correct settings, the wire should reach a steady glow (dull red) when the lights are off. The Node (with feedback in resistive mode) will adjust the current to maintain the target. If no feedback, the wire will find an equilibrium where heat loss equals heat input; that equilibrium should be at your target if the current was chosen correctly.

{% hint style="danger" %}
If you see the wire glowing bright or other concerning signs, stop the process using the left button on the Node (halts power output), or for drastic circumstances use the reset button or pull the power.
{% endhint %}
{% endstep %}

{% step %}

### Hold and monitor

Let the wire stay at the temperature for the configured duration. Use the Node's readings to monitor. For example, if the Node API provides real-time resistance, watch that it stays roughly constant, indicating steady-state. If you see a drift, that might mean the wire's resistance is changing (possibly annealing effects); a slight increase in resistance is normal as it fully austenitizes. The Node might compensate by lowering current slightly to hold temperature.
{% endstep %}

{% step %}

### Cool down

When the time is up, stop the current. The wire will begin cooling immediately. You can choose to **quench** it or just let it cool in the air (we hit it with a pressurized air hose). With the Node setup, a water quench is a bit tricky because the wire is wired up to the device. **Do not water quench while still connected to the Node.** First, disconnect power or open the circuit. You don't want to dunk the Node or live wires in water. The better approach in this case, if quenching is desired, is to quickly disconnect one end of the wire from the Node (using insulated tools) and then drop the wire (with fixture) into water. Alternatively, since electrical heating cools the wire quickly once the current is off (the wire is thin and loses heat fast to air), you might get away with just an air cool. If you do air-cool, you can accelerate it by blowing with pressurized air.
{% endstep %}

{% step %}

### Disconnect and inspect

Once the wire has cooled to a safe handling temperature, fully disconnect the wire from the Node leads. Inspect the wire. It should now hold the trained shape and experience a visible color change (our material did). Check your fixture and wire for any signs of overheating (for example, melted supports or char if you had tape or markers). If everything looks good, proceed to remove the wire from the fixture as described in the basic guide. The shape should be set.
{% endstep %}
{% endstepper %}

## Safety guidance

Using the Node removes the flame, but it adds electrical considerations:

* **Never exceed device limits:** Check the ThermoFlex Node's spec for maximum current and voltage, and do not set a current beyond what the Node or the wire can handle. (For example, if the Node supplies up to 30 A continuously, stay at or below that. Thin wires can fuse if over-currented.) Start low and raise the current while watching the wire's temperature.
* **Avoid short circuits:** Make sure the only path for current is through the full length of wire you want to heat. A shorter path (the wire touching a metal fixture that connects both ends) bypasses most of the wire, which can overheat the conducting section or damage the Node's output drivers. Use insulating spacers and mind the fixture design.
* **Monitor at all times:** As with a torch, don't leave the Node running unattended. The wire can overheat if the feedback fails or a parameter is wrong. Watch it, or set a software cutoff that stops output if measured temperature crosses a threshold.
* **Cooling period:** After the run, let everything cool before touching it. The wire will be extremely hot, and so may the Node's terminals connected to it. Power down the Node when done as an added safety step.
* **Ventilation:** There is no combustion, but any coating on the wire or paint on the fixture can burn off, and high temperatures oxidize the wire surface and release a little smoke. Work in a ventilated space.
* **Electrical safety:** The Node runs on DC power (battery or DC supply). Use a properly rated source with no exposed live wires. With a high-power battery, expect high current draw and keep the battery, cables, and connectors cool.

## Example: ThermoFlex Node API

The listing below is illustrative pseudocode adapted to the current ThermoFlex Python API. It runs the resistance-mode cycle end to end: connect, hold at the target resistance, log the live readings, then release the hardware. Confirm the method names against your installed library version before running it.

```python
'''
Illustrative resistance-mode shape-set routine for the ThermoFlex Node.
Pseudocode adapted to the current ThermoFlex Python API. Confirm method
names against your installed library version before running.

The script holds a Nitinol coil at a target resistance (which tracks
temperature) for a set time, logging the live status fields so you can
review the cycle. Logic and parameters mirror the 170 mOhm, ~20 minute
experiment described above.
'''

import thermoflex as tf
import time

# Experiment parameters (kept from the original experiment)
HOLD_TIME = 1200.0    # main heating time in seconds (about 20 minutes)
COOL_TIME = 5.0       # post-run monitoring time in seconds
SETPOINT_MOHMS = 170  # resistance setpoint in milliohms (hot target, ~550 C)
LOG_INTERVAL = 1.0    # seconds between readings

# Logged data
resistance_data = []
current_data = []
vdrop_data = []
pwm_data = []

def log_reading(muscle):
    """Request a fresh status, then record the live status fields."""
    muscle.status("compact")                         # ask the Node for current readings
    resistance_data.append(muscle.get_resistance())  # live field: load_mohms
    current_data.append(muscle.get_current())        # live field: load_amps
    vdrop_data.append(muscle.get_voltage_drop())     # live field: load_vdrop
    pwm_data.append(muscle.get_output_pwm())         # live field: output_pwm
    # Note: r_sns_ohms is a dump-only field, so it is not read here.

def hold(duration, muscle):
    """Hold for a duration while logging at a fixed interval."""
    start = time.time()
    while time.time() - start < duration:
        log_reading(muscle)
        time.sleep(LOG_INTERVAL)

# Connect to the first Node over USB and attach the muscle on port 0 (M1)
node = tf.get_usb_node()
muscle = tf.Muscle(_port=0)
node.attachMuscle(muscle, 0)

# Configure resistance (ohms) control and set the hot target
muscle.setMode("ohms")
muscle.setSetpoint("ohms", SETPOINT_MOHMS)

# Start disabled for safety, then enable and run the heating hold
node.disableAll()
time.sleep(0.5)
muscle.setEnable(True)
hold(HOLD_TIME, muscle)

# Stop heating and watch the wire cool
node.disableAll()
hold(COOL_TIME, muscle)

# Review the logged cycle
print("Resistance (mOhm):", resistance_data)
print("Current (A):", current_data)
print("Voltage drop (V):", vdrop_data)
print("PWM:", pwm_data)

# Release the network
tf.endAll()
```

In the script, we:

* Connect to the first ThermoFlex Node over USB and attach the muscle on port 0.
* Set resistance (`ohms`) control mode.
* Set the target resistance to 170 mOhm (the hot value for about 550 °C) and a hold of about 20 minutes.
* Enable the muscle to start heating.
* Log resistance, current, voltage drop, and PWM at a fixed interval so we can review the cycle; a stable resistance means a steady temperature, while a slow rise can signal more heating or a structural change.
* Disable the muscle after the hold, then watch a short cool-down.
* Release the network with `tf.endAll()`.

## Limitations and notes

Electrical shape-setting works best for straightforward shapes: springs, straight actuators, and the like, which is what ThermoFlex muscles usually are. A very complex 3D shape that isn't a single continuous wire, or a wire already built into a larger assembly, may still need the oven. For most Delta Robotics ThermoFlex wires, though, the Node method is ideal.

A few things make it worth the setup:

* You reach target temperature fast, so the wire spends less time hot, which can preserve better material properties.
* You can repeat the exact thermal cycle in software: run the same script again for the next wire.
* You can fold shape-setting into an automated workflow, for example a script that trains a batch of wires and then runs test cycles on them using the Node and its sensors.
* For one or a few wires, it saves the time of heating a full furnace.

Logging builds a knowledge base: record the exact resistance at target temperature for each wire, and future runs get easier. Even with automated control, the fundamentals still matter. Keep the [Basic](/docs/learn/how-to-train-nitinol/basic.md) and [Advanced](/docs/learn/how-to-train-nitinol/advanced.md) guides in mind to read the data and fine-tune as you go.

## Related pages

* [Basic](/docs/learn/how-to-train-nitinol/basic.md): Quick and easy shape-setting for hobbyists and beginners.
* [Advanced](/docs/learn/how-to-train-nitinol/advanced.md): Precision shape-setting for engineers and researchers.
* [What is Nitinol?](/docs/learn/nitinol-faq.md): The materials science behind the shape memory effect.

## References

\[1] [Rapid, Reliable Shape Setting of Superelastic Nitinol for Prototyping Robots](https://pmc.ncbi.nlm.nih.gov/articles/PMC5026417/)
