DIY CNC Router – Post 6: Stepper motor and driver upgrades

So the incy-wincy NEMA17 stepper motors and Pololu a4988 drivers I had did not cut the mustard – not enough torque to move my axes. I had had a nagging feeling from day 1 that the little NEMA17s were not going to be up to the job – kind of wish I had not invested time in fitting them to my machine. That’s what ‘winging it’ does for you, right?

So I upgraded, I bought three NEMA24 motors (3.1Nm, 3.5A) and four M542T drivers (one extra for the z-carriage I bought, which has an NEMA23 integrated into it) from I also bought a 36V 10A power supply. Amazing turnaround from that website – my order arrived in 3-4 days! And the way it was packed into the delivery box was a work of art, and/or the work of an autistic chinaman. I wish I had taken a photo.  The photos below show the before and after motor and driver-wise.

NEMA24 on the left, old NEMA17 on the right: a tractor vs a push lawn mower.

Little Pololu a4988 drivers in the foreground: the big black things the new M542T drivers.

As you can (kind of) see in the photo above, I have it all wired up. Unfortunately, the new drivers did not fit in my wine control box, so I had to mount them on top, like those cars where the engine sticks through the bonnet. The writing on the wood is my ‘reminder’ on how I connected everything because I inevitably come back to something 6 months on and cannot work out how I…well…worked it out the first time.

The Protoneer Arduino shield accepts the Pololu drivers, they mount neatly on the shield. Obviously, the M542Ts don’t plug in – they are little too grown up – so I had to work out how to get one talking to the other. I found a couple  of images on Instructables (here and here) which gave me enough clues to work it out:

  • Despite the 16 pins on the a4288 drivers, you only need four of them to connect to an M542T: Enable, Step (Pul on the M542Ts), Dir and Ground.
  • You put the motor power straight (in my case 36V) into the M542T drivers (so you don’t put any power into the CNC shield terminals), the CNC Shield gets the power it needs to do microcontroller stuff from the Arduino.

DIP settings for the M542T driver

There are 8 little DIP (dual in-line package…who knew!) switches on the M542T drivers. And the drivers are so big that they have tables on the side of them to tell you what they all do.

I found this table for the current output for the driver. I erred on the side of caution to start and equated the peak current with the rated current for my motors. I then threw that caution to the wind and matched the RMS current to the motor rated current. This decision was based entirely on me skimming the pictures on this website and thinking their logo looked legit and they (i) knew what they were on about, and (ii) it applied to my setup. Hum? So I am OFF-OFF-OFF for all my motors except the z-axis.

Peak Current RMS Current SW1 SW2 SW3
1.5A 1.0A ON ON ON
2.0A 1.4A OFF ON ON
2.4A 1.7A ON OFF ON
2.8A 2.0A OFF OFF ON
3.2A 2.3A ON ON OFF
3.7A 2.6A OFF ON OFF
4.2A 3.0A ON OFF OFF

I found this table too, for the micro stepping. I have mine at ‘8’.

Microstep Steps/rev.(for 1.8°motor) SW5 SW6 SW7 SW8
2 400 ON ON ON ON
4 800 ON OFF ON ON
8 1600 ON ON OFF ON
16 3200 ON OFF OFF ON
32 6400 ON ON ON OFF
64 12800 ON OFF ON OFF
128 25600 ON ON OFF OFF
256 51200 ON OFF OFF OFF
5 1000 OFF ON ON ON
10 2000 OFF OFF ON ON
25 5000 OFF ON OFF ON
50 10000 OFF OFF OFF ON
125 25000 OFF ON ON OFF
250 50000 OFF OFF ON OFF

Wiring Bugs

I read a blog post once about how bugs there are in computer code. I re-found the article here. He quotes someone else who do the same (and I am going to ‘re-tweet’ what the blogger said):

a) Industry Average: "about 15 - 50 errors per 1000 lines of delivered
(b) Microsoft Applications: "about 10 - 20 defects per 1000 lines of code
during in-house testing, and 0.5 defect per KLOC (KLOC IS CALLED AS 1000 lines of code) in released

Two observations: one bug every 2000 lines from Microsoft seems a lot. And statistic (a)…ouch.

Anyway, it’s a real bug-bear (no pun intended – is that a pun?). Bugs. Actually, I am not sure its ‘bugs’ per se, but more innocuous unintended I-knew-what-I-meant-to-type little errors. And it’s not just code – it’s when writing prose too. I HATE when I read typos in other people’s reports and stuff, BUT if I re-read one of mine a couple of days after it is riddled with them.

One might say they are due to sloppiness. I am not sure about that. When you re-read something you just wrote, your clever (but lazy) little brain just won’t see them.

I use Grammarly on this blog to try and squash some of them, but Grammarly is not really intended for that. I have a notion in my mind how I could do it a little better if I find the time. Anyhow.

Getting to my point. I was SUPER careful with my wiring. I spend a whole day on it, checking and rechecking. A day wasted (I thought at around 6 pm) because I had made one ‘little error’…I had connected (+) to (-) and vice-versa…I noticed after powering up the first time. Nothing. There were no green lights on my driver, just a little wisp of smoke from one – perhaps a little smoke signal saying “you F!*ked up”.

In the morning, grumpily having accepted that I was pretty sure I was going to have to order four new drivers I ignored reason, switched my (+) and (-). It worked. I am going to ignore the smoke.




Series Navigation

<< DIY CNC Router – Post 5: Electronics and SoftwareDIY CNC Router – Post 7: (Hot and Melting) Wires >>