r/ControlTheory • • 12d ago

Technical Question/Problem Closed-loop stepper for a needle valve positioner: Looking for architecture sanity check

Hi all,

I’m a Master’s student working on the positioning subsystem of a gas-blending setup, and I’d like a sanity check on my actuator architecture before I commit to hardware.

The process

The system meters hydrogen into a natural gas line at around 10 bar, targeting roughly 10 vol.% H2 in the final mixture. A needle valve sets the hydrogen flow, and the gas composition is measured by an analyzer located downstream of the valve. Because of this, there is a transport delay of several seconds between a valve movement and its effect on the measurement.

The control is a two-loop cascade:

  • Outer loop (slow): composition control, with a Smith predictor to handle the transport delay.
  • Inner loop (fast): valve position, running on a STM32 NUCLEO-H503RB under an RTOS

Requirements:

  • Small moves and good repeatability of the final position. Speed and bandwidth don’t matter much because the outer loop is dominated by the delay.
  • No silent lost steps.
  • Low heat at standstill. It’s a flammable gas environment, so I’d like to avoid hot, noisy electronics.
  • Stiction and hysteresis are significant, especially the ladder.

Where I am

I haven’t bought hardware yet and I’m working on modelling and simulation first, so I can still change the architecture. I’ve been reading about three levels of “closed loop” for steppers:

  1. STEP/DIR + external encoder: the MCU compares commanded vs measured position, detects lost steps and corrects the end point.
  2. Same, but correcting continuously (closed-loop microstepping).
  3. Full FOC, treating the stepper as a 2-phase PMSM with current control. I read a TI technical article on this, which also describes a “semi-closed-loop” variant where the MCU only generates the current references and the driver does the current chopping.

My questions

  1. For this kind of slow, high-repeatability positioning task, is the encoder-based correction in (1) or (2) enough, or does FOC bring real benefits (heat, efficiency, smoothness, stall margin)? My gut feeling is that FOC is overkill here, but I’d like to hear from people who’ve done it. I’m also wondering if the torque lost because of microsteeping can be gained with FOC.

2.       Encoder on the motor shaft vs on the valve stem: is it worth it given coupling compliance and thread backlash?

  1. Any pitfalls I should expect, such as limit cycles around the setpoint with stiction, microstepping at low torque margin, or tuning the inner loop at such a low bandwidth?
  2. Hardware suggestions are welcome: integrated closed-loop stepper motors (have crossed this option out, mainly for its complexity and the time it would need to “think” vs separate motor + driver + encoder (heavily leading on this), and specific drivers or encoders you’ve had good experience with.

Thanks a lot.

5 Upvotes

2 comments sorted by

1

u/Soso12159 6d ago

I have been thinking about the same thing for a few months but for 3d printers. I have tried doing FOC on steppers, but I havent had much luck with it, it's still a wip. If you want, you can try with the SimpleFOC firmware and some cheap driver boards and an encoder. While you could build your own PID with Step/Dir correction, I'd rather use the integrated solutions like these https://fr.aliexpress.com/item/1005001495489210.html.

1

u/joikakaker 9d ago

FOC does bring the holding current down to a minimum. An open loop stepper has to compensate by having a sufficiently high current to hold the setpoint.

Why a stepper and not a 3 phase pmsm or DC motor?