Two VFDs on one RS-485 line: driving a linear motor with Modbus RTU
Controlling the two Delta MS300 drives that power the Spectraloop pod's linear motor over a single RS-485 line, with an STM32 as the Modbus RTU master — and validating it in the field.
Context
For three seasons I have led the software team of Spectraloop, which competes at TEKNOFEST Hyperloop. The pod is propelled by a linear motor, and the motor is powered by two Delta MS300 variable-frequency drives (VFDs). My job was the firmware that controls these two drives reliably.
Why Modbus RTU, and why a single line
Modbus RTU is a simple master/slave protocol widely used in industry between drives and PLCs. RS-485 is the noise-resistant differential line that carries it. Multiple devices can share a single RS-485 line, each identified by its own slave address.
The setup I built:
- The STM32 is the line's Modbus RTU master.
- The two MS300s are slave 1 and slave 2 on the same line.
- Communication runs at 9600 baud, 8N1.
What gets controlled
The firmware sends the drives forward / reverse / stop control words and a frequency setpoint of up to 150 Hz. I wrote the code on an STM32F407 and later ported it to a Nucleo-F401RE.
Validation in the field
Code that works on the bench does nothing in the field if the drive isn't configured correctly. I verified the VFD parameters — setting the frequency and run-command source to RS-485, and the upper frequency limit — by testing them one by one on site.
For testing and observation, I also added a Python serial↔WebSocket bridge and a live control panel: we can monitor the pod's drive and send commands from the browser.
The rest of the pod
The motor drive is part of a larger architecture: the master and slave STM32s communicate over CAN Bus, and we used twisted-pair cabling and 120 Ω termination to cope with high EMI. Position is cross-checked between the BNO055 IMU and dual optical sensors using hardware interrupts, and a hardware Watchdog completes the fail-safe design.
At the end of this work, our team took 1st place in Türkiye in the Technology Demonstration category at TEKNOFEST 2026.