OHSC Hybrid stepper motor controller

OHSC is an open source hybrid stepper motor controller and force feedback interface using FOC to apply smooth torque on a budget.

Public Chat
Similar projects worth following
The goal of this project is to develop a simple and comparably cheap interface for stepper motors as an alternative to expensive industrial servo motors.

Hybrid steppers bridge the gap between servo motors and open loop stepper motors.
Traditional stepper motors must be driven with high current without position feedback to avoid skipping steps and can not be driven in stall conditions to apply smooth torque like servo motors can.

In this project an open source hybrid stepper driver with traditional step/dir and serial interfaces is developed and an alternative force feedback firmware for simracers with standard HID gamepad interface.

Traditional stepper motors must be driven with high current without position feedback to avoid skipping steps and can not be driven in stall conditions to apply smooth torque like servo motors can.

The options of current hybrid stepper drivers are very limited and dated let alone open source.

Some use cases allow for a bit less precision and smoothness than a perfect servo for thousands of dollars could deliver and are out of reach for most hobbyists and diy projects.
This is where steppers come into play when paired with a sub microstep precision encoder and a smart foc based controller constantly monitoring the position and applying torque in the desired direction with a set power and electrical target angle.

By using a standard powerstep01 stepper driver a robust driver with precise power regulation is available without having to manage this in the main controller.
It can supply power up to 10A 80V and can be managed via spi and setting the electrical FOC angle is done by sending bursts of steps to correct the position via the stepclock interface.
It will be controlled by an stm32f4 which is also capable of usb HID communication and that opens the possibility for the main inspiration for this project: Force Feedback.

An interesting use case comes from the simracing community.

Force feedback racing enthusiasts often use industrial stepper motors with expensive controllers as direct drive wheels. While i researched the available options there were none that really satisfied my idea of a diy ffb wheel as most options were very expensive servo drives or commercial products with a premium price tag.

Stepper motors are much cheaper for comparable torques and make a hybrid stepper perfect for direct drive wheels.

  • 1 × Powerstep01 Power Management ICs / Motion, Motor and Servo Control
  • 1 × STM32F411RCT6
  • 1 × LD117AS33TR
  • 2 × DTSM-6 Switches and Relays / Switches
  • 1 × USB_MICRO-B Connector

View all 17 components

  • Designing a pcb prototype

    Yannick (Gigawipf)03/05/2019 at 16:28 0 comments

    While the current prototype shows promising results it is a mess of wires and many pins on the stm are already blocked by the discovery board. Other boards where the powerstep shield can be stacked onto often have no usb port or other issues.

    I spent quite a few days researching parts, designing a pcb and preparing the cubemx project for the new layout and chip.

    For the next prototype i chose the stm32f411RCT6. This processor has enough pins for 8 analog and 16 digital pins directly connected to the chip while still having usb, uart, internal spi for the powerstep and screw terminals for the encoder.

    Some space is available to allow for a larger heatsink if needed. In theory it should be able to handle 80V but in current mode the driver runs best at 12-20V and this is probably what most users will have available anyways. At higher voltages the driver get really hot. In voltage mode not that much but i find the torque reaction to be much smoother and quicker in current mode.

    Now i will wait for all the parts to arrive and hope that nothing blows up in the first test.

    One other thing still missing is a nice nema34 dual shaft motor. The 34HS59-5004D from stepperonline looks like a perfect match with pre cut keyway and smaller back shaft and mounting holes for the encoder. Sadly it is not available at the moment so i will need to wait more or find a different one.

    After a week my parts finally showed up except for the terminal blocks.
    Not the most pretty soldering but it was all hand soldered and that lqfp powerstep is a beast to hand solder. Cleanup will be done once the terminal blocks are here.

  • Prototyping and FOC

    Yannick (Gigawipf)02/15/2019 at 19:47 0 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.

View all 2 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates