CNC Servo Stepper: which driver with current sensing

first, many thanks for launching this great project!
A potential solution for an affordable servo stepper having current sensing control loop is a big thing! This was simply made of “Unaffordium” up to now.

I’d like to upgrade my 1/8 microstepping 3 axis CNC-mill to servo stepper to 1. improve accuracy and 2. maximize the (lousy) 1.8deg NEMA17 torque of ~0,5Nm. Phase current is 2.5A, power supply has 36V.
After checking chips/boards from Trinamic and I came to the conclusion that this road leads to nowhere, thanks to industrial prices for dev kits etc.
Then I checked some open solutions like ustepper or Mechaduino or the kickstarter project Ananasstepper, which are quite cool in terms of being retrofits for NEMA motors , even including the mag encoders.
But the software is somewhat limited - you brought yours up to an amazing level in short time with future potential, especially as it includes the current sensing. I also like the professional discussion level about hardware details and pros/cons of certain chips for new boards.
I’d like to give SimpleFOC a try, based on STM32 MCU probably, as I use this already for the grbl controller. For the mag encoder I think about e.g. AEAT8800-Q24, as it gives me 4096CPR now and 16bit resolution when you will support SSI.
Going through your recommendations for the drivers, I am not sure what the candidates would be. What would you recommend in terms of having the in-line current sensing stuff like TSC2010 included?

Best Regards

Hey Husky, and welcome!

It sounds like you have a cool project with a clear goal…

If you’re looking to design your own hardware, and you can wait a little for the new DRV8316 to come into full production, this driver from TI looks very nice - current sensing fully integrated. But that’s a BLDC driver, probably not what you need for the steppers?
The EVM is already available, and I have it working with SimpleFOC (though not yet the current sensing, that’s next).

The AEAT8800-Q24 is a cool chip, nice find, I had not come across it yet. However, take a look at the AS5048A or AS5147 from AMS - these are already well supported in SimpleFOC, and their SPI speeds are up to 10x faster. The price is not that different.

Welcome @husky. Very interesting project.

Before you go all in with a custom PC design it might be worth seeing how far you can go with off the shelf components and a bread board. For example you could pair a blue pill (stm32f1) or esp32 with a l298n motor driver board connected via bread board. Throw a 14bit magnetic sensor on as well.

Antun has tested L289 and done a few videos.

I suspect the above setup would run hot at 36v and 2.5A but might be ok. More importantly you’d be able to learn a fair bit which may result in a better board.

I’ve also got dual steppers working with a storm32 gimbal controller (it is a 3axis bldc gimbal) but it’s a bit fiddly board to work with especially hooking up sensors. I’ve done a video on that. I don’t think it’ll go to 36v so there would be a loss of speed. Schematics might be worth looking at.

Do you need your solution to provide step/dir interface? If so you should check out Antun’s example

I can’t find information about DRV8316 besides a comment from Ti that the “hardware version” won’t be available before end of 2021. So is it a kind of engineering sample for insiders currently ? As it is a 3-phase thing, I am not sure how I can safely mod this into 2-phase operation. Is there a source (ANs or so) to learn about the caveats of using 2 out of 3 bridges ?

In general I find tons of 3-phase stuff but not so much advanced ICs for steppers. This is a little bit surprising, as the whole FOC and sensing for a stepper is just a subset of the full 3 phase stuff.

Regarding the AEAT8800-Q24: the SPI with its 1MHz is for programming, not readout. On SSI you have 10MHz. SSI and PWM have 16bit abs. resolution, ABI has 4096 CPR.
Drawback is that I can’t find a breakout board and soldering QFN is tricky.
So you are right that AS5047 is more in reach currently.

That’s what I have in mind - checking out in breadboard and BOB style with the components which could make it into a NEMA17/23 piggy back or into a dedicated 3-axis board, maybe as Arduino/STM-Nucleo shield. If I could buy anything which meets my specs I would be happy - knowing how long the way can be to a fully working system and its PCB. I did projects in KiCAD and Diptrace before with PCB ordering in China and Kapton stencils from USA.
I was surprised reading in the Forum that ordering fully assembled PCBs isn’t that exotic anymore. What is the minimum lot size and the fabrication costs roughly ?

The STEP/DIR interface is mandatory so not to break the grbl controller also. There is an Trinamic application note what must be modified in such a controller to switch for S/D to SPI, offloading ramp calculation to a motion controller. But that’s overkill currently. I will check Antuns example.

Yeah, like you say, many don’t have convenient breakout boards.

The TI chip will arrive in production later this year… until then it is sample quantities and the evaluation board. The evaluation board is a good option for prototyping on the bench top, but you may want something smaller (and cheaper) for the final build.

I have to admit I don’t really use the steppers, so I can’t answer your questions there with cetainty. It sounds like something you can ask in the TI motor control forums - they might have some (TI specific :wink: tips for other chips to look at as well.

Others in this forum have driven the steppers using 3-phase drivers, or even also generic half bridge chips like the L298… I don’t know the disadvantages compared to using a real stepper driver, but I suspect that if you don’t want the step- and micro-step interfaces those offer, then the remaining part will be similar to the BLDC drivers or other inverters.

Minimum lot size is 1 piece, although your cost per PCB will come down significantly if you order a few more.
If you value your own time above 0, then I think going the fabrication route these days is very attractive. I use PCBWay, and for something like a encoder breakout or basic motor driver breakout I can get 20 PCBs, fully assembled with all the SMD parts, delivered to my door in Vienna, for about 300 EUR. About 80 EUR of that is shipping and EU taxes. The only annoying part is the waiting (about 30 days if everything goes well).

I’m currently trying to do something very similar to you; upgrade 1x 2-axis and 2x 3-axis cnc machines from open-loop stepper systems, to simpleFOC systems. I have a few of the pololu 36v4 boards which fit my voltage and current requirements nicely, and can be configured for 4xPWM control. They do already have some kind of current sensing on board but it’s not accessible that I know of - I’ve just posted a question about this to the Pololu forums, thinking it might be possible to get that data over SPI.

If not, I’d love to know if anyone has experience using the Pololu ACS711EX Current Sensor Carrier ( as an inline current sensor, with simpleFOC (and preferably with a stepper setup). If I understand it, a stepper setup would need two of these, one connected in line with each motor phase, with data output to the microcontroller running simpleFOC to enable current control. They’re nicely low cost at about £3-4 per board (nice if circuit board design is a bit beyond you, as it is for me).

Anyone tried this sensor?

I am afraid that chip is not the right one for inline-sensing, which is the only supported in SimpleFOC currently for understandable reasons, as I learned meanwhile - software complexity would explode and the solution would be more MCU type dependent.
I don’t see any mention of Common Mode Rejection in ASS711EX datasheet. Also bandwidth could be an issue.

My today’s candidates for in-line sensing are INA240 (same as in SimpleFOC shield v2), INA253 (has shunt included, 4 Gain variants, less flexible, needs thermal care) or AD8418ABRMZ, what Trinamic uses on their Universal Power Stage 10A EVAL board.
There is a eval board set INA240EVM available with 4 PCBs and all gain variants of INA240.
Price is 28€ at Mouser. You can solder a shunt (2510size??) onto it. That is the cheapest solution for an evaluation I could find up to now.
All stepper ICs having current sensing capabilities “only” do low-side sensing - at least I did not find anything else.

I checked the DRV8316 datasheet meanwhile. Having accessible lowside current sensing it clearly is a candidate for future BLDC FOC design. But missing the 4th half-bridge, I would need two drivers for one stepper. Could work if a I had to clue how to distribute controls for one motor over two chips. Not sure if current sensing would work at all.

Maybe @xcalplaxis can give a hint about upcoming TI products for steppers ?


While you can always use two DRV8316, you would be left with two 1/2-H unused (unless you have a separate need to drive a solenoid or something else).

An alternative would be to use two DRV8873, DRV8874, or DRV8876. These are H-bridges with integrated current sensing and current sense output.

Other dedicated stepper drivers in the portfolio today have integrated current sensing, but do not provide a current sense output (i.e. DRV8434E).


Hi Matt,
thanks for clarifying this. So it remains a challenge to minimize chip count for driving three steppers, each 2.5A and having current sensing for SimpleFOC. Looks more like using four BTN8982 and two INA240 per axis is the way to go…
Still undecided if I can piggy-back this onto NEMA17, including the encoder. Or I put the stuff for three axes onto one bigger board, minus the encoders. But then i might have EMI issues with the encoder wiring through the energy chains, needing differential drivers.


Hi Peter,

If you have three steppers on one board (3x4 = 12x 1/2-H channels), using four DRV8316 may be a good option: you would have exactly 12x 1/2-H to use.

It is going to depend on how you want to implement your current sensing that makes a difference. Most steppers that I have deal with have a single current sense resistor per two 1/2-H (just like a BDC motor), which makes using BDC motor drivers more simple in some cases.

Not to go overboard against the BTN8982TA, it does have an excellent RDS(ON). Each 1/2-H bridge is 15x10 mm, and you would need four per stepper. Even using two DRV8873 (H-bridge @ 7.8x6.4mm) would beat this in size by a wide margin. DRV8874 and DRV8316 are even smaller.


Hi Matt,
the board space is a valid argument. And the unit price also. I think about testing DRV8874. Just checked how TI does sample requests. It is 16€ for 8 pieces, as I don’t have a coupon. When ordering privately from Germany, would there be shipping costs and customs on top of that ? Can’t find this info at TI.


Hi Peter,

It looks like $6.99 shipping and $6.22 estimated taxes when I ring it up on (TI store). I entered a shipping address in Ludwigsburg.

There is the additional comment: “No Tax Identification number was provided with this order. By checking this box, I acknowledge that my order may be subject to the taxes of the country to which my order ships and such taxes are non-refundable. To add your Tax Identification, please change your shipping address type from “Other” to “Business.” If you do not know your Tax Identification number, work with your finance department or tax professional.”

DRV8874 looked to be not in stock, but the automotive variant DRV8874-Q1 is P2P.