Retech Motors

Motor-control firmware · Pilot series

Pilot FOC firmwareField-oriented control for BLDC and PMSM motors

FOC firmware for Pilot H1, M1 and M2, set up from the Spinner app.

  • 40 kHz current loop
  • Torque · velocity · position · impedance
  • EtherCAT · CAN FD · USB
  • A/B updates
Pilot M1 motor driver board, which runs the Pilot FOC firmware
current loop
40kHz
velocity loop
8kHz
position loop
4kHz
calibration jobs
25
control modes
4

Control loops

Pilot FOC control loopsA motion command from EtherCAT, CAN FD or USB feeds a 4 kHz position loop, an 8 kHz velocity loop and a 40 kHz d/q current loop, then space-vector PWM drives the power stage and the motor. Encoder angle, phase currents and bus voltage come back from the motor as feedback to all three loops. Impedance mode turns position, velocity, stiffness, damping and feed-forward torque into a torque command for the current loop.Impedance modeτ = τff + K·(θ* − θ) + D·(ω* − ω)Motion commandEtherCAT · CAN FD · USB32-byte, SI unitsPosition loop4 kHzVelocity loop8 kHzCurrent loopd/q PI, decoupling40 kHzSVM + PWMspace-vector40 kHzPower stagegate driver + FETsMotorBLDC · PMSMFeedbackencoder angle · phase currents · bus voltageLoop rates as set in the firmware: current loop every PWM period, velocity every 5th, position every 10th.

Field-oriented control

d/q PI with decoupling and SVM. Gains from the measured motor model.

Four modes

Torque, velocity, position and impedance, for legged-robot joints.

Motion functions

Profiled moves, homing, jog, streamed trajectories, step/direction.

One command over every link

32-byte command in SI units, 64-byte feedback.

Pilot network linksA robot controller drives Pilot drivers over an EtherCAT daisy chain or a CAN FD bus; a PC with the Spinner app connects to a driver over USB.Robot controllerEtherCAT or CAN FDPCSpinner appETHERCAT · DAISY CHAINPilot driver 1Pilot driver 2Pilot driver 3IN → OUT on each driveCAN FD · BUSnode 1node 2node 3node IDs 1 to 127USB · SETUPPilot drivermonitor, calibrate, configure, update
FieldMeaning
modetorque, velocity, position, impedance
enable · haltenable and quick stop
positiontarget or anchor, rad
velocitytarget or feed-forward, rad/s
torquetarget or feed-forward, N·m
stiffness · dampingimpedance K, D
current limitoptional, A
flagsfeed-forward, integrator, set zero
  • EtherCATLAN9252; cyclic PDOs, CoE SDO setup.
  • CAN FDCANopen-style NMT, SYNC, PDO, SDO, heartbeat; IDs 1–127.
  • USBFramed with CRC-16; used by the Spinner app.

25 calibration jobs

The drive measures the motor as installed and sets its own gains.

01

Electrical model

Current-sensor offsets, phase order and pole pairs. Resistance from several current plateaus with a least-squares fit, d/q inductance by sine injection, flux linkage from back-EMF while spinning.

02

Encoder

Offset and an error table over a full turn, measured in both directions, so FOC uses the true rotor angle.

03

Mechanics

Inertia from torque steps; viscous and Coulomb friction from a coast-down.

04

System identification

Frequency sweep, chirp and PRBS, open and closed loop, for Bode plots and loop tuning in the Spinner app.

05

Cogging

A cogging-torque map, measured holding position or turning at one or more speeds, applied as feed-forward.

06

Verification

Locked-rotor and spinning re-measurement of R, L and flux; current, speed, position and impedance step responses.

How results are checked

Physical limitsEvery identified value is checked against physical bounds before it is used.
Fit qualityLeast-squares fits are scored, not taken on trust.
Both directionsEncoder tables and cogging maps must agree forward and backward, or they are rejected.
Full coverageEncoder tables need a full turn of data and no jumps.
Cross-checkedVerify jobs re-measure the motor and test the closed loops.
Protected runsProtections stay on; a run stops in the same cycle a limit trips.

Encoders

Retech IPS2550 inductive ring encoder mounted under a Pilot M1 motor driver
IPS2550 ring encoder on Pilot M1

AS5047P / AS5147P

On-axis magnetic, H1 and M1.

MA600

On-axis magnetic, M2.

IPS2550 inductive

Magnet-free second sensor on M1 and M2, calibrated as a pair with the main encoder. Inductive encoder →

Protection

Overcurrent

Software trip on every board; DRV8353S monitor on H1, M1; analog watchdog on M2.

Voltage and temperature

Undervoltage detection and derating.

Watchdogs

Hardware watchdog, command-loss stop, EtherCAT SYNC watchdog.

Fault handling

Latched faults and a safe-hold state.

Guarded calibration

Calibration stops in the same cycle a limit trips.

Board ID

Firmware boots only on its own Pilot board.

Safe updates

Safe firmware update flowA new image arrives over EtherCAT, CAN FD or USB and is written to the inactive bank. At reset the bootloader checks CRC32 and the board ID, then runs the new image. If the image does not confirm itself within three boots, the bootloader rolls back to the previous bank. A write-protected factory image and USB recovery are always there.New firmwareEtherCAT · CAN FD · USBInactive bankA or BBootloader checkCRC32 · board IDNew image runsmust confirm itselfConfirmedwritten toat resetpassokPrevious bankrolled back3 failed bootsFactory imagewrite-protected · recovery over USB

New releases: Downloads.

Spinner app

Monitor

Live values, faults and traces.

Calibrate

Results, step metrics, Bode plots, cogging maps.

Configure and update

Settings, diagnostics, firmware updates.

Over USB. Available on request: Downloads · Enquire.

Runs on Pilot H1, M1 and M2

Pilot H1Pilot M1Pilot M2
EncoderAS5147PAS5047PMA600
IPS2550 port—yesyes
EtherCAT2 ports (option)2 ports2 ports
CAN FDisolated + second busisolatedisolated
USBMini-BUSB-CUSB-C
Step / directionyesyes—

Tell us about your motor

Motor, supply, control mode and link: we will suggest a setup.

Send an enquiry

info@retechmotors.com