Stepper Drivers, MaxESP. A note of caution?


Robert Benward
 

Hi All,
A cautionary note:  I have been updating my construction notes on the MaxESP V3 assembly when I found an inconsistency in the motor wiring. The board was designed and labeled for the A4988 driver, but it can use many others.  The inconsistency is in the nomenclature of the motor windings.  The A4988 apparently uses winding 1 and winding 2, and on a particular winding, terminal A and terminal B.  The TMC5160, which is the driver I am using is the opposite.  The TMC uses winding A and winding B, and on a particular winding, terminal 1 and terminal 2.   So, the wiring remains the same regardless of the driver used, the top two terminals are are one winding, and the bottom two are another winding.  The problem comes when you go to make a cable and you use the TMC convention, the winding will be wired across two different coil drivers ("H" bridges).  I apparently wired mine correctly, but I am no longer sure how I did that (trial & error?).  The TMC agrees with the nomenclature of my stepper motor (StepperOnline).  Of course, to effect correct rotation, you can swap the terminals of one or both windings.

Bob

A4988   TMC5160
1A     =    B1
1B     =    B2
2A     =    A1
2B     =    A2


Khalid Baheyeldin
 

I have used two different boards (Blue Pill, and FYSETC S6) with three different
models of stepper drivers (LV8729, TMC2130 and TMC5160).

They all work.
Some will need you to reverse the direction vs. the others, which can easily be done
using AXISn_DRIVER_REVERSE ON. For some of us (me included) it is far easier and
more convenient to change it in the firmware configuration, than fiddle with wires
and introduce connectivity issues and instability.


Howard Dutton
 

On Thu, Nov 18, 2021 at 12:07 PM, Khalid Baheyeldin wrote:
Some will need you to reverse the direction vs. the others, which can easily be done
using AXISn_DRIVER_REVERSE ON.
Or, for Release-4.24 and later, reverse any axis in the SWS Website Configuration page without firmware upload, just a reboot.


Khalid Baheyeldin
 

On Thu, Nov 18, 2021 at 03:11 PM, Howard Dutton wrote:
Or, for Release-4.24 and later, reverse any axis in the SWS Website Configuration page without firmware upload, just a reboot.
That is awesome ...

I keep forgetting about the axis runtime configuration in SWS ...
Once wider adoption happens for SWS, things will be much easier for folks out there.
And maybe universal binaries will become a reality ...


Robert Benward
 

The nomenclature problem is about crossing windings, not reversing the wires on a winding to reverse direction.  Getting mislead by these difference will lead to a winding with one end on one H bridge, and the other end on the other H bridge.  Since I used the TMC5160, I followed that convention not realizing that was even a difference.  I suspect the way the stepper motor works, it may not make a difference, but it might affect the fault reporting.  Maybe the picture below clarifies my message:


Bob


Howard Dutton
 

I have TMC5160's that are NOT designed like that.

Perhaps this is specific to one model or brand of TMC5160's, but not the Watterot ones I have or any other StepStick driver I've ever seen.


Robert Benward
 

The deeper you dive, the murkier it gets.  We just need to be aware that there are two conventions out there.  If there are any other drivers that I should add, let me know.  I will put this up in the files section.


Howard Dutton
 

On Thu, Nov 18, 2021 at 03:49 PM, Robert Benward wrote:
The deeper you dive, the murkier it gets.
Being able to identify these poorly designed drivers is what matters.


kevin_kevin_kevin@...
 

if you are collecting driver details one of the issues in "Blue pill on astroberry" thread last week was caused by there being at least 2 diiferent LV8729 board layouts. one has the chip on the top , the other has the chip on the bottom so the motor wiring is reverse . not a big problem to fix but the back mounted ( as in the Bluepill  Wiki photo) one has the Vref pot at the other end to the front mounted chip so it had been plugged in reveresed. see messages  38641 and  38641 for photos, also the  LV8729 "ebay" ones are all front mounted but the pins are all black so not colour coded.


Robert Benward
 

Kevin,
Can you provide details or links to those two drivers?

In the mean time, can someone verify that all of the onstep variants (not the off the shelf CNC types) conform to the pinout below?

Bob

MaxESP V3


 

Only thing that can be different that should be payed attention and that is the direction in which driver's pins are be soldered. You have to check designations on driver PCB every time. Normal way goes like this: Put the driver on the table and look at it from the top, rotate it in such way that step/dir pins are located on bottom right corner, and then all pins (needles) should be pointing down (to the table). That's why newer 3D printer boards and drivers have colored headers (blue and black)...

All stepper drivers mentioned here follows the one same simple rule: top two pins are one winding and bottom two are the other one. Sometimes vendor choose letter to represent winding and number to resemble terminal, and sometimes is vice-versa, this do not affect anyting. 

And it is only up to you to take multimeter and confirm that is the same case with your motor, regardless of wire colors, letters and numbers. As I examined PCB design files, it is very same with their RJ terminals, which means that they cables/motors are interchangible. Once wired properly, one mount with one set of cables can be connected to any OnStep build, with any drivers sitting insde.



kevin_kevin_kevin@...
 

THe ones with the chip on the back of the boards are the  makerbase MKS LVLV8729 and maybe others,  i found the photo on amazon.co.uk https://www.amazon.co.uk/LV8729-Stepper-Printer-TMC2100-Alternative/dp/B077BCMKBM
but alliexpress do them https://fr.aliexpress.com/item/32804602628.html
or just google makerbase MKS LV8729
I think they are the ones in the Wiki photo . Kahlid  mentions them including the different motor pinout,  in https://onstep.groups.io/g/main/message/6769 but not the fact that the Vref pot is in the oposite position. however at least his ones , as opposed the the ebay ones, had coloured pins. we are obviously not alone in getting it confused . https://github.com/makerbase-mks/SGEN_L/issues/15
the ones on the front are from several ebay.co.uk sellers  . i bought a pair a couple of weeks ago but it looks like there are non in the uk at the moment. https://www.ebay.co.uk/itm/184118120655

another thing i came across when i pulled some old steppers from my parts box  of  reclaimed  3d printers bits was that although they mostly had a standard 6pin socket on the motor body there were some wired differently to others. i had some 6way connector to 4wy connectors leads  from ebay  and some motors gave the normal  1a,1b,2a,2b type of wiring but others ended up as a 1a,2a,2b,1b  sequence that not only didn't work the got the drivers verry hot. always worth checking with the mutlimeter.


 

Position of the chip is completly irrelevant. Same drivers can have chip on top or chip on bottom. For instance this are same LV8729 v1.0, MKS (chip on bottom) and Fysetc (chip on top), but their pinout is same. You can always check with multimeter location of GND pins to assure which side goes where. Also, usually EN pin is designated with circle around it or square around it. Vref potentiometer can be located on both sides too, there is usually a hole in PCB to access it from the top side if it's located on the bottom.




Motors with 6pin headers are hybrid steppers (so they can be used in both bipolar and unipolar configuration). You need to be specially carefull with these, and need to measure resistance in order to identify windings. Usually their coils are mapped to pins 6,3 and 1,4 with common pins in between (5 and 2) which normally should be left NC but there are exceptions ofc and that's why they need to be checked. If you connected driver to common pins, you will use only 1/2 of the coil and they will drain twice as much current and drivers will go very hot even can burn if they have poorly designed protection. Some advanced SPI/UART drivers can detect such thing and display fault in diag when something is shorted or left floating.



kevin_kevin_kevin@...
 

That could explain my motor issues as i they had no markings on them.  but i slightly disagree about the chip front /back issue.
I agree that the main pinout is the same however when they mount it on the " back " I think they rotate the chip to make the motor drive chip pins near the edge of the board where the board motor pins are to minimse the high current tracking. this has the effect of reversing the order of the pins connected to the motor which is why it has been noted that if you swap the makerbase MKS LV8729 ones for other drivers the motor is reversed. this can easily be corrected by rotating the 4 pin plug or in software.
However a side effect of rotating the chip is that the Vref chip pin is then at the oposite end of the board so thet put the Vref adjuster on the front surface at that end. this does not make any electrical difference but when you have people with little electroncs experience , eg in the  "Blue pill on astroberry" thread the " obvious" way to plug them in is the same as the photos of the others and the main distingushing feature in a photo is the Vref pot. When the manufactures don't even colour code the pins you can't even give a general guidline of " put the plack pins on the motor connector side".
there also appears to be an issue that some driver boards are built with 0.1 ohm sense resistors and some with 0.22 ohm and so have different Vref calculations.


George Cushing
 

In 2007 Pololu Electronics put the Allegro A4988 IC on a break out PCB. There is no particular characteristic if the IC that dictated the output pin orientation., but the order they used, B-, B+, A+ & A- from the VMot end of the PCB down was copied with the TI DVR8825 driver was placed on the "Pololu" carrier.  

As far as the Sanyo LV8729 goes the layout of the carrier outputs follows the IC's pin assignments  Pin 1 is at the upper left when the IC is on the top of the carrier. Going across the IC we find pin 44. Pins 44 and 43 are A+ and pins 35 and 34 are A-. The b coil pin pairs are 33 & 32 (B+) and 24 &23 (B-). If you are using the Pololu output designations, coming down the right side of the IC the order is A1, A2, B1 & B2. Here the letter indicates the IC's output channel, i.e. Channel A and the number the pole of the channel. I prefer the "+" sign as I find it less confusing.

OK, some bright light decides that the Sanyo IC should be mounted on the bottom of the carrier's PBC for better heat sinking, forgetting that the LV8729 rarely has a heat problem. Now the IC's pin 1 is  in the lower left of the carrier as viewed with the VMot in still in the upper right. That also means that the IC's pins 44 & 43 (A+ or 1A, if you prefer) are in the lower right. Now if we read the outputs down from the VMot pin we get B2, B1, A1 & A2. Now if that sounds familiar, it's because that's the same order as you will find on the A1988, DVR8825, TMC2130 2208 & 2209. Here the TMC5160 deviates from this pattern with its A2, A1, B1 & B2 ordering, which puts the channels in the right sequence if reading down from Vmot. What about the ST820 with its outputs ordered, from the top, 1B, 2B, 2A & 1A? With any of the drivers mentioned above if you connect the motor cables in the order shown on the controller PCB's silk-screening it will run. So to with the ST820. It's output pins are ordered, from the top, 1B, 2B, 2A & 1A. But a glance a the datasheet shows the silk-screen got it wrong. It should have read B1, B2, A2 & A1. Basically the Pololu order with the channel poles reversed. 

In summary, if you connect any of these drivers with the assumption that the upper two outputs are for one driver channel that is to be connected to one stepper coil and the other channel to the remaining coil it should run. Maybe not in the right direction, but that's easily fixed by changing the rotation direction in the Config.h. The secret is to properly identify your motors coils.


kevin_kevin_kevin@...
 

I have had a look at the LV8729 drivers i have had in the last mont or so . there are 2 sorts. one with a large blue heatsink marked underneath FYS and has blue data pins and the top has a white square painted on the enable pin. traditionally in PCB design pin 1 is square and the rerstb round so as not to rely on the silk screen.
the second sort i have cpme with a smaller black heatsink and are labeled Bigtreetech.  they have only black pins and do not apear to have any markings top or bottom. the Enable pin is , i think square pad but also i think is the Vm pin. I actually checked the orientation was correct by measuring that the two GND pins were connected.


kevin_kevin_kevin@...
 

both lots were bought from uk ebay sellers. i though ihad attached photos but the have disapeared so i will try again.


Khalid Baheyeldin
 

I did not use any LV8729 drivers from Bigtreetech.

But I did use the MKS orange ones with a small heatsink, and the FYS black modules with the large blue heatsinks.

Both work well, without any issues.

Whatever the module is from, it has to have two sides: one side with VMOT, and the A/B 1/2 pins, and the other
with the MS0/MS1/MS2 as well as SLP and RST keys (names vary, but some of these will be one one side and
not the other).

Regardless, the VMOT A/B 1/2 side goes towards the motor connectors. This side usually have black pins on
most drivers. The other side goes towards the microcontroller, and is usually is in another colour on most
drivers (but not always).

Remember that the 3D and CNC communities are much larger than OnStep, and they use lots of drivers too.
And that is why vendors make sure that cables and such work, even if the direction is reversed.

We have never seen a case where the motor wiring makes the motor "not work". Reversed, yes, sometimes.
But always always works, unless the problem is elsewhere (e.g. a user inserted the drivers backwards recently
and motors would not move).


kevin_kevin_kevin@...
 

I agree , i am just adding the general information that the bigtreetech ones have no obvious markings or coloured pins which could cause confusion to less experienced users.


Khalid Baheyeldin
 

Agree ...

As I was looking at the pictures you posted, it was very confusing.
No clue whatsoever on which way the module goes: no labels on the pins, no coloured pins.

The other two (MKS and FYST) have a different colour on the pins of the logic side.