Skip to main content

Quickstart

Prerequisites

  • Miniconda: Download and install Miniconda for your operating system.

Installation

  1. Clone the Winder repository:

    git clone https://github.com/aotenjo-xyz/winder.git
    cd winder
  2. Create a new conda environment and install the required dependencies:

    conda env create -f environment.yml
  3. Activate the conda environment and set the PYTHONPATH environment variable to the current directory:

    conda activate winding
    export PYTHONPATH=$PWD
  4. Create a settings file Copy settings.yml.example to settings.yml.

    cp settings-example.yml settings.yml

Power on the machine

Turn on your winding machine and connect it to your computer.
All motors will automatically run their calibration routine and move to their zero positions.

Move the motors with calib.py

Run the calibration script to move the motors:

python scripts/calib.py

In the calibration console, you can manually move each motor by entering the motor number followed by the target position.

For example:

  • Enter 01 to move M0 to position 1.0
  • Enter 2-0.4 to move M2 to position –0.4

calib.py output example

Check the motor direction

Depending on the magnet orientation on each motor shaft, the reported angle may be reversed. Before calibrating parameters, verify the motor direction and set the direction value for each motor in settings.yml accordingly.

  1. Check M0 direction:
    Move M0 from 0 to 1.0 using calib.py.

    • If the M0 unit moves in the same direction as the green arrow in the image, set direction: true.
    • If it moves in the opposite direction, set direction: false.
  2. Check M1 and M2 direction:
    Move M1 and M2 from 0 to 1.0 using calib.py.

    • If the M1 and M2 units move in the same direction as the arrows in the image, set direction: true.
    • If they move in the opposite direction, set direction: false.
  3. Check M3 direction:
    Hold the M3 motor firmly, then apply a small voltage (0 → 0.05).

    • If the spool rotates in the same direction as the image, set direction: true.
    • If it rotates opposite, set direction: false.

Motor direction

Calibrate the parameters

M2 Calibration

Find the M2 position when the winding arm is exactly at the 12 o’clock position (as shown below). Set this value as the zero parameter for M2 in settings.yml.

M2 zero position

M1 Calibration

Find the M1 position where the stator is perfectly aligned with the stator holder (see image). Set this value as the zero parameter for M1 in settings.yml.

The machine always starts winding from the aligned tooth, so choose the tooth you want to wind first, align it with the holder, and use that position as the M1 zero.

M1 zero position

M0 Calibration

wind_range_end

  1. Move M1 to its zero position.

  2. Move M0 until the stator holder just touches the tip of the first tooth (see image). Set this position as wind_range_end for M0 in settings.yml.

    M0 wind_range_end

wind_range_start

  1. Keep moving the M0 motor all the way (as shown below). Set this position as the wind_range_start parameter for M0 in settings.yml.

    M0 wind_range_start

Change the winding configuration

turns

Set the number of turns as turns in settings.yml.

winding_config

Change winding_config to match your motor’s winding configuration. For more about the winding configuration, see Winding Configuration.

Run the winding script

  1. After completing calibration, run the winding script:

    python scripts/main.py

    winder CLI output example

  2. Select adjust motor positions -> Initialize the motor positions to move the motors to their starting positions.

  3. Go back to the main menu and select wire wires -> wind wire 0 to start the winding process.

    winding menu

  4. Tighten the nut at the top and secure the wire as instructed.

    If the prompt says "Please place the wire on the right side...", place the wire as shown below and press Enter.

    wire on the right

    If the prompt says "Please place the wire on the left side...", place the wire as shown below and press Enter.

    wire on the left

  5. Hit Enter to start winding. The machine will automatically wind the wire according to the parameters you set. winding start menu