Close

Prototyping and FOC

A project log for Open FFBoard

A modular and open source force feedback steering wheel interface and motor driver for racing simulators and robotics

Yannick (Gigawipf)Yannick (Gigawipf) 02/15/2019 at 19:470 Comments

My prototype consists of a stm32f4 discovery board and a powerstep01 shield.
The goal of this stage is to implement a stable FOC control loop using this standard stepper driver. I chose this driver because it allows for up to 10A of current in current and sine voltage mode and can be controlled via spi quickly and stepped in stepclock mode.

The field oriented control like approach works by keeping track of the step positions and aligning bursts of microsteps less than one electrical rotation to the current position and making sure the stepper never skips a full step.

This needs a high resolution encoder with sub microstep resolution. I chose a 10k count E6B2CWZ6C (clone) encoder for this prototype.
Microstepping is set to 1/16 because this is the highest setting the driver supports in both current and voltage mode and current mode allows for higher holding power between steps.

Perfect alignment of the shafts is crucial for smooth stepping so a sturdy adapter was printed.

Yes it is messy but there is no other option to get the driver connected to this board. The end result will feature a custom pcb :)

The FOC loop is pretty much working right now and can turn heavy loads at stall conditions without cogging and the feeling of skipped steps.

This video was made with <0.4A of current and a Nema 24 motor. Imagine a Nema 36 or 42 at up to 10A.
The feeling is smooth as butter when forcing the load away. Very unlike an open loop stepper.

At the moment the position holding is done using a PID loop which has to be tuned for the specific load and torque profile needed. This creates some overshoot which has to be reduced for accurate applications. Of course in this video the overshoot is extremely exaggerated because of the heavy load but even with small loads about 1-5 microsteps of overshoot and offset can be observed when the loop is reasonably tuned but not perfect.

Later a step/dir interface to use this closed loop controller as a replacement for open loop stepper drivers will be implemented and this will need at least near microstep accuracy to be usable but the main goal is to provide smooth torque at stalls for applications that would traditionally need servo motors like linear actuators, force feedback and robots.

Discussions