Skip to main content

Simulation with Godot

How to Run the BLDC Motor Winding Machine Simulation with Godot

How to Run the BLDC Motor Winding Machine Simulation with Godot

Godot is used to simulate the winding process and visualize the winding results. The simulation helps in understanding how the winding machine operates and allows for testing different winding configurations before actual implementation.

info

What is Godot?

Godot is a free and open-source game engine used for creating 2D and 3D games and simulations. It provides a comprehensive set of tools for game development, including a visual editor and a scripting language called GDScript.

Prerequisites

  • Miniconda: Download and install Miniconda for your operating system.
  • Godot: Download and install the latest stable version of Godot.

Quickstart

  1. Follow the Quickstart guide to set up the Winder software and run the simulation in Godot.

  2. Export the Godot project to a standalone binary (no Godot editor required to run):

    make export-simulation

    This produces simulation/bin/simulation.x86_64. Export templates must be installed in Godot beforehand (Editor → Manage Export Templates).

  3. After building, run the interactive controller and simulation as separate processes.

    Terminal 1 (interactive controller):

    conda activate winding
    export PYTHONPATH=$PWD
    python scripts/main.py -s

    Terminal 2 (WebSocket bridge):

    conda activate winding
    export PYTHONPATH=$PWD
    python scripts/ws.py

    Terminal 3 (simulation):

    make simulate

    make simulate launches the exported simulation binary only. Use the terminal running main.py to select wind wires and continue through the interactive prompts.