Power noise filter/signal conditioning boards

427 views
Skip to first unread message

Ed Simmons

unread,
Aug 23, 2019, 2:06:41 PM8/23/19
to Smart Stepper
Hi all,

I have had quite a challenging time getting the smart steppers to work well in my machine, due to electrical noise susceptibility on the step/direction/enable signal inputs. My smart steppers showed more than the expected number of steps when checking "getsteps" on the motor cli and jogging the machine a known amount. Also with "debug 1" the motor regularly showed it was enabled and disabled when it should have been enabled all the time.

Currently available smart steppers are very susceptible to electrical noise and produce noise that is difficult to filter out. Problems with noise being present in the step/direction/enable signalling leads to loss of accurate step count and error in the commanded motor position, without this error in the step/direction signalling the position control of these is excellent. :)

One suggestion has been to use different pull up resistors on these inputs, but this is not a complete solution to the problem. The bigger problem is how much noise is coupled out onto the external wiring, including that for the signalling and this causes false step counts. It is far worse during motion with high currents and a heavy load on the smart stepper.

As a result I have come up with two designs of filter PCB to suit the smart steppers. One is already in use on my machine and the second is a later re-think of this design. Both designs overcome the problems with existing smart steppers where noise causes false steps/enable/direction state changes.

A vague spec follows:
  • Filtered motor and logic power
  • Passive power filtering removes high frequency noise instead of coupling it to the machine wiring
  • Opto-isolated signalling prevents power noise affecting signalling
  • Designed to be installed close to the motor
  • Approx 50mm x 50mm x 10mm 
Since there's been some interest in the "NOISE" thread, I thought I should start a dedicated thread to discuss the possibility of these boards and gauge how many people need them. If anyone likes the sound of these please let me know here and I'll try to make these available to purchase.

I hope these can help a few people out :)

Ed

Andrew Moody

unread,
Aug 28, 2019, 10:46:58 AM8/28/19
to Smart Stepper
I've been fighting all sorts of noise from the very beginning of my CNC adventures, even before discovering the smart steppers (even though I didn't realize that it was noise at the time).  I love the many benefits the smart steppers provide - but, primarily on-motor dedicated driver @ a whopping 3.2A.
I had hoped the smart steppers would solve all my problems, but noise seems to be the unstoppable force.  I've tried nearly every trick I could scrounge up online to address this - separating power runs from logic runs, shielding power and logic cables, grounding shielded cable only at controller end, oversized caps on each board's motor power connector, line filter on power, separating spindle on completely different breaker, running a ground rod to my electrical panel, noise filtering circuit breadboard for logic circuits, Faraday cage around entire machine; I even bought two of the new smart stepper boards with the enhanced noise filtering components.
After all of this, I'm still consistently missing steps on the Y axis.  The consistency leads me to believe that it's induced from the motion of the other axes somehow.  I just recently tore the whole machine down and rebuilt it, so I'm pretty confident this isn't a mechanical issue.  I 'flat spotted' both the motor shaft and the ball screw shaft to ensure the coupling set screws would prevent the coupling from spinning on either shaft.

Will your boards mount on top of the smart steppers?  I currently have fans attached for active cooling, not sure how this would affect mounting.  Any pics of how your boards look when connected up?  How much do expect them to cost?

Notice the 'stair step' on this cut post, which should be vertical:



Ed Simmons

unread,
Aug 29, 2019, 3:53:41 AM8/29/19
to Smart Stepper
Hi Andrew,

I agree and think the smart steppers are a brilliant advancement. I also feel the design has some catching up to do, but since clones already exist of the design with all the noise sensitivity issues having being cloned too, it's going to be a little while until the readily available smart steppers are reliable without extra work.

Can you access the cli of your Y axis motor? Checking "getsteps" in between manually jogging the machine a known and repeatable amount will show you if you're gaining steps (this is noise) or not counting enough steps (this is another separate problem that may have many causes).

Several possible manifestations of electrical noise on the signalling are apparent:

- Noise in the enable signal will cause the motor controller to cycle on and off, losing mechanical position because the motor controller stops holding position. (You can check whether this is happening with "debug 1" on the motor cli) 
- Noise in the direction signal may result in some steps being counted in the wrong direction (leading to an incorrect count from getsteps on the motor cli)
- Step signal noise will result in greater than expected change in count of steps (from getsteps on the motor cli)

If you see evidence of too few steps being counted, there is also the possibility that your signalling is too slow to rise and the pulses are too short to be registered - excess capacitance will slow the rise time of the signal and may require very aggressive pull up resistors to speed up the rise time. Your stair stepped post is similar to the noise issues I was seeing with my 3d printer using smart steppers. That looks like too many steps counted in one direction which could be direction line noise.

Everything you have done will help reduce noise but the signalling is so sensitive to noise in the current design it is difficult to eliminate all sources without getting the right filters on everything simultaneously, or addressing the issue more directly by reducing the size of the inductive loop which is picking up the noise.

The PCB I propose will include filters to limit the effects of the power noise from the smart stepper motor controller and it will reduce the physical length of the step/direction/enable input circuits to a very short loop which in turn will reduce the coupling of the power noise to these sensitive signals. Opto couplers will prevent the common mode noise on the machine wiring from affecting the signals.

I hadn't intended to stack the two PCBs as there isn't enough room on either of my affected machines but this is a possibility. I expect it can be made the right size to include holes to allow fitting to nema 17 motors. You may wish to this sort of board alongside larger motors on screw posts mounted to a panel of the machine.

I estimate the unit cost will be something like £20 per board initially, I'll work on getting a small number made. I'll get a photo of the current prototype and share it here too...

Thanks for feedback, I'm sure we can resolve these issues. :)

Ed

Andrew Moody

unread,
Aug 29, 2019, 7:32:51 AM8/29/19
to Smart Stepper
Grounding the enable pin was one of the other things I'm doing which I forgot to mention.  I set the enable pin to low and grounded it directly with a jumper wire.  This shouldn't be the issue for me.

It's a little embarrassing to admit, but I can't connect USB to this particular board because I accidentally ripped the USB connector off when I was first setting it up.  Should have done the setup before mounting the board. :/  Maybe I'll switch this board out with another axis so I can grab some debug info.  Problem is, though, I'm using GRBL for motion control and I don't know how many step/dir pulses were actually sent.  I don't seem to lose any steps while jogging, it's only while running a cut job, so I assumed one of the other axes is involved somehow.  I do need to do the whole 'mark and inspect' mechanical validation, to be honest.  While I did just reassemble the whole machine, I don't have any empirical evidence that there is no mechanical step loss.

The mounting isn't critical, just curious if it would follow the Arduino 'shield' custom or not.  I'm using NEMA 23 motors, which I think those boards have 40mm mounting (I use 40mm fans mounted to the board).  It is super convenient to keep everything together and not have to finagle some other mounting, but I see how clearance may be an issue.

I can't help but think that this must be a fairly common issue across any stepper application using this same step/dir control method.  How is it that others don't seem to be so overwhelmingly plagued with this?  So many DIY hobby CNC/3D Printers seem to be getting sold - surely they can't all be failing as miserably as I am.

Andrew Moody

unread,
Aug 29, 2019, 7:41:30 AM8/29/19
to Smart Stepper
Here's a pic of my current mounting, for reference, if you're interested:


I would have to rework the shrouds, maybe, or use angle brackets to mount the additional board over top of the motor.


Ed Simmons

unread,
Aug 29, 2019, 10:09:58 AM8/29/19
to Smart Stepper
It wouldn't be an arduino shield type of board. The purpose of this is to mount one as close to each motor as possible.

I can place 40mm mounting holes and some to fit NEMA 17 motors.

One of the biggest reasons noise is an issue with the smart steppers and not with other stepper drivers is the length of the signalling and lack of opto couplers. Most/all commercial stepper drives have opto couplers on the inputs which mean a significant current is required to activate the input digital 1 state, common mode noise on the cables cannot affect the opto couplers. They also do a good job of noise filtering the power in most cases.

Servos are dangerous when they remain enabled all the time - if you somehow accidentally command a position that's beyond the travel of the machine it will drive hard into the end of the travel (and with the integral set to non-zero, also gradually increase the current) or worse a person could be in the way. E-stop should disable servos. Just my 2 cents. 

I might look into an accompanying "line driver" board which provides signalling and ESD protection for the controller. This would go at the machine controller end of the wiring. This could be a shield, but I'm not sure how I'd lay this out to coexist with things like RAMPS boards. Let me know if this is also of interest.

Here's my prototype filter board - this one doesn't use opto isolators but I have almost completed the new design. It's been changed a lot.

IMG_20190829_150622_cropped.jpg


Andrew Moody

unread,
Aug 29, 2019, 10:34:37 AM8/29/19
to Smart Stepper
No disagreement on e-stop necessity, the problem is that your controller has to know that you've exceeded your machine limits, and that's not always the case with GRBL, as the machine position resets every time the power cycles and any software machine limit is meaningless if the spindle location is unknown.  This is why I don't bother with the enable pin, I just cut motor power if I do something dumb.

I wasn't asking for an Arduino shield specifically, I was referencing this concept for how I've been mounting components.  Sorry for any confusion here.  40mm mounting holes would solve my mounting needs.

I had trouble with noise and lost steps long before installing the smart steppers, with a gShield.  This is the primary reason I sought out smart steppers, as I thought I could solve my lost step issues.  It seems there's still a ways to go for a true win-win.  Your description of professional grade machines makes sense - knew there had to be some bullet proof method they used for eliminating the noise issue, but I'm not an EE, so I don't know all of these fancy methodologies for overcoming these drawbacks.

Is this model fairly common for professional grade machines, though?  Sending step and dir pulses naked to a driver?  Seems very antiquated and analog.  Do more high-end systems use a protocol with CRC and error checking like Ethernet/802.1?  I get that at the lowest level it's all electrical pulses, but seems like electronics have come a long way since pulses were being used as the top-layer data signal.

Ed Simmons

unread,
Aug 29, 2019, 12:02:27 PM8/29/19
to Smart Stepper
Cutting the power works too :)

Many ways exist to solve this communication problem. Several interfaces are used in industrial machines but it's mainly due to cost and ease of integration that step/dir/enable interface has lasted so long. Having a motion controller that outputs something widely compatible also has a lot of power keeping people offering the interface. It's certainly proven reliable when implemented correctly.

The chinese smart steppers are sold with a breakout board from the common A4988/DRV8825 driver PCBs to a 6 pin JST, and this module is common to RAMPS and other boards. The problem with this is it directly connects a microcontroller pin to the long wiring, so I made myself a driver board with a ULN2003 actually doing the work of driving the long signal lines low. This helps me avoid damaging pins of the controller.

Ordering a small batch of PCBs soon :)

Ed Simmons

unread,
Aug 29, 2019, 1:07:40 PM8/29/19
to Smart Stepper
I've just ordered PCBs and some parts. I'll test and share my results soon. :-)

Andrew Moody

unread,
Aug 30, 2019, 6:45:05 AM8/30/19
to Smart Stepper
Just clarifying that it's actually 32mm from center to center for the 40mm fan mount.

Ed Simmons

unread,
Aug 30, 2019, 12:27:41 PM8/30/19
to Smart Stepper
I've done more testing/tweaking and improved the signalling with a new prototype. Because of some changes I've ordered more PCBs. I guess my first lot get ignored/head straight to the bin. ;)

I opted to use a nema17 bolt pattern for mounting as this is 31mm between adjacent holes center to center. This should hopefully attach to your fan mounting location without too much trouble. I'm not sure what to suggest about the fan and this board fighting for the same space. In my machines i have so little space these will need to mount on the side of the motors to clear other parts of the machine. Probably different solutions for each axis, sadly.


Does your controller directly drive the signals (long cables) using a pin of the microcontroller? Ideally we should also have an easy to install open collector output board. I have fried a couple of re arm boards by accident while probing signals. Adding an output driver was a good move for me.

I should have PCBs in a week or so. I'll make some available as soon as I can.

Ed Simmons

unread,
Aug 31, 2019, 7:02:23 AM8/31/19
to Smart Stepper
The chinese smart steppers ship with the adaptor shown on the left (A4988 module on right), which takes the place of the stepper module(s) on boards like RAMPS.
stepper-modules.jpg
While these initially look really simple and useful, they are not ideal for use with long wiring connected directly to MCU pins. I've designed a better version of the break out board that fits in place of a stepper driver module. It seems this is a much needed addition to the options available to machine builders.

I have a couple of machines using RAMPS boards with a combination of smart steppers, A4988, DRV8825 etc stepper modules. The breakout to JST 6 way is a completely passive adaptor breaking out power and signalling, but what's needed for machines with long wiring to smart steppers is an active line driver with ESD protection.

To retain compatibility with the 6 pin JST output used in the chinese smart steppers, I've just made an active version of the adaptor. The adaptor can sink higher currents than a pin on the microprocessor and protects against damage to the microcontroller pins.

This new module is a plug in replacement for the chinese output adaptors and is ideal for driving optocoupler inputs. These will be available soon and are ideal to pair with the smart stepper noise filter board.

Ed Simmons

unread,
Sep 2, 2019, 4:28:58 AM9/2/19
to Smart Stepper
The PCB fab has just told me the PCBs are on the way to me. I hope to have a handful of opto isolated motor input boards available very soon.

My own prototype versions have been working very well on my pick and place machine for a couple of days testing. No detectable problems with signalling.

I found that I was able to get perfect performance with passive filters on the inputs and only operating a single axis, but combined moves of multiple axes was still causing a few extra steps to be counted by the smart steppers. This forced me to look again at optocouplers.

The optocoupler inputs have completely fixed noise issues. Re-referencing the signals to the local ground potential of the motor input is the only way to truly sort out problems caused by noise.

I'll experiment with different values of filters in the power supplies to the motors before I settle on the final values. I don't want to limit acceleration but I do want to address the nastiest high frequency noise on the power. I tried to test a few values but my prototype PCBs were beginning to suffer with all the reworking. It'll be easier on the commercially made PCBs.

:-)

Anthony Owens

unread,
Sep 8, 2019, 6:31:02 PM9/8/19
to Smart Stepper
Nice piece of work Ed, and I agree with you about the need for optoisolation and a more safety-oriented approach to servos like these.
I am interested in retrofitting Smart Steppers to a line of industrial FDM printers as part of a staged move away from RepRap origins to more appropriate machine build technology and Standards. I have been reluctant to invest time into Smart Stepper because the development does not appear to have been standards-driven, in areas like interfaces and safety. I assume that is because of the Mechaduino origins of the project as well as limited engineering time and cost pressures. In my case I am also interested in the potential of work to expand the high speed performance envelope of the drives.
In view of your work I will now trial a NEMA23 version of Smart Stepper. The printer line I'm working with use a RAMPS board but the latest DUET is to be adopted later. Socketing the connections to the SmartStepper/motor unit as you plan to do is definitely the way to go, and next time the Smart Stepper board is updated it would be sensible to add your optoisolation and other alterations at that time.
I'm still trying to assess the pro's and con's of closed-loop steppers like SmartStepper. If this approach can avoid the need for costly low backlash planetary gearboxes in upgrading machines from stepper to servo control. The low cost base and high torque output of steppers is preserved while much of the smoother, quieter, more power-efficient and more accurate motion control of servomotor/encoder/planetary gear units is delivered.
Hopefully Trampas will comment on this in due course.

Ed Simmons

unread,
Sep 9, 2019, 3:40:07 AM9/9/19
to Smart Stepper
Hi Anthony,

Thanks :)

I have smart steppers on a 3d printer (reprap like) and a pick and place machine. Both use RAMPS boards. Both using smoothieware on re-arm board. In both cases I have had to adapt the smart steppers to get reliable performance from the step/dir interfaces. In the case of the printer, it's got a normal Z axis and extruder stepper drivers, I was using the A4988 and switched to DRV2588 both showed the same problem, stepping when they shouldn't, in time with extruder retract/prime moves. I tried several things to fix this before giving up and wiring step/dir/enable for Z to a proper "black box" stepper driver with opto isolated inputs. Immediately the problem was gone.

Since at least two chinese outfits are producing the same general design of smart steppers for a low price, it seems that these will be here to stay for some time and a small add on PCB is ideal. Likewise, RAMPS and similar boards with removable stepper driver modules are here to stay and these don't offer a safe way to interface with long cables to any external drivers.

I'm inclined to agree that modifying the smart stepper is the way to go, long term, but I presume there's going to be a long delay in china catching up to any modifications that are made to the designs they're basing their work on. These are cheap and easily available... Regardless of how people feel about them in the community, there's always going to be a proportion of people who buy them without realising at the time that they're clones using Trampas' firmware. It's cruddy to leave issues that are insurmountable for anyone without EE experience and the test gear to track down the problems.

Bigtreetech/biqu were willing to talk about noise problems and sent me a replacement smart stepper when I was able to show them several videos of a problem with one motor board - the direction input was shorted to ground. During all my issues with noise, before I built my opto-isolator boards, I fried the input somehow. I explained the noise issues to them and they said the engineers would look into it. Just changing some resistor values on the current smart steppers is enough to stop noise issues on short 3d printer wiring where everything else is wired well and not making crazy noise. However, no amount of part swapping on the existing design will overcome the sensitivity to noise on long wiring that shares a route (eg cable chain) with other electrically noisy circuits. Adding parts was my only option.

There's probably loads of room to add to the nema23 PCB, but the nema17 is already quite densely populated. Making use of space on both sides of the PCB would make it feasible, but also doubles up on paste printing/pick and place/reflow work.

Now I'm suffering from this: https://xkcd.com/281/  hurry up shipping!

Ed Simmons

unread,
Sep 10, 2019, 12:07:48 PM9/10/19
to Smart Stepper
PCBs have been delivered. I built and bench tested one smart stepper inputs/power filter board. I'm very happy with the signalling performance. Tests show this is a totally workable solution.

I'm still waiting for more stock of opto-isolators to arrive.

Hopefully these will be available soon. :)





Anthony Owens

unread,
Sep 10, 2019, 5:48:36 PM9/10/19
to Smart Stepper
Fair enough Ed. I'd like to source six of them please, though only one initially. I will be using them on a mixture of NEMA 17 and 23 motors. If necessary I will design a 3D printable enclosure to mount the servo board and your board piggyback style and strain relieve the wiring.

On an unrelated topic, as a Smart Stepper and clone user, perhaps you can advise:
How do you find that the torque and speed performance of a given 'smart stepperised' motor compares with operation as a simple half-stepped or microstepped stepper, with a conventional driver? I know that is a broad question. What is in my mind is this:
I am trying to incrementally move towards 'classic' servo motion control for an industrial delta printer, which has unimpressive printing performance. It uses an Arduino Due/RADDS 1.6/Polulu Compact daughterboard controls setup, with NEMA 23 200 step/rev motors and twin extruders using NEMA 17 motors and planetary reducers. I will be substituting larger pitch precision timing belts for the GT2 belts in the Delta towers and making various other changes designed to add stiffness. One of these proposed changes is to substitute closed-loop steppers, hence my interest in Smart Stepper and Mechaduino.
It is hard to design these changes without knowledge of the effects of the conversion on the performance of common motor sizes.

I am hoping that the rotor positioning softness that is the tradeoff for using 64 microsteps would disappear and become 'servo-like', i.e. very stiff and capable of lower following error than I see with the present motor arrangement.
I am also hoping not to see reduced high speed performance compared with the current microstepped motors.
Finally, it would be nice to see some reduction of the motor noise that is characteristic of steppers and which, in my printer's case, is transmitted through the structure and I'm sure does print quality no favours.

Are you aware of any comparative performance data for Smart Stepper which reads on any of these concerns?
Ta very much.
Tony Owens

Ed Simmons

unread,
Sep 11, 2019, 2:30:07 AM9/11/19
to Smart Stepper
Thanks :) I'll post a link here when I've got these available to buy.

Ed Simmons

unread,
Sep 11, 2019, 2:46:48 AM9/11/19
to Smart Stepper
Speed/torque performance is tricky to directly determine, but you can incrementally try increasing the commanded speed of the moves while also messing around with PID tuning, maximum current etc. Make sure you're running off the highest possible voltage for your setup, this matters a lot.

You'll definitely get better performance than normal stepper drives, both in holding accuracy and top speed, by tuning the PID controller you can adjust this behaviour to suit your needs. When correctly tuned, the PID controller will resist even very small deflections from the commanded position and the motor will feel rigidly held in place.

I have a liteplacer with smart steppers which is pretty fast considering the tiny nema17 motors and the large machine loads. My process for getting good performance was something like this:

  1. Set max motor current to maximum allowed
  2. Set ctrlmode 3 (current mode) 
  3. Repeatedly move short distances at a fairly slow feed rate (eg G0 X10 F500, X0, X10 etc ) 
  4. Adjust the PID tuning for smooth operation (double or halve the settings to find range then fine tune)
  5. Repeat steps 3 & 4 until you are satisfied with the accuracy of the movements, then test again with larger motions and higher feed rate, continue to fine tune the PID values
  6. Find the maximum feed rate you can actually operate each axis by increasing the feedrate until error in moves becomes apparent. At this stage you may be able to get more performance by increasing P setting (and probably having to retune I and D to suit) but you'll also get more motor whine.
  7. Decide what your maximum axis feedrates should be based on what you discovered in the tuning process, update machine config
I hope that helps :)

Ed Simmons

unread,
Sep 11, 2019, 3:21:23 AM9/11/19
to Smart Stepper
Regarding mounting the boards.... My inputs/filter PCBs have a nema 17 hole pattern so it should be possible to make some combination of spacers and m3 bolts to mount both PCBs sharing the same set of bolts. The PCB is a little smaller than the smart stepper PCB. 

On Nema 23 smart stepper boards, as Andrew mentioned above, there's 32mm spaced holes that could be used for mounting this PCB. We'll have to see how this works in practice as I don't have a nema23 board here.

I'm still looking around for the right combination of connectors/cables to supply in order to suit a wide range of applications, but I hope all this is sorted soon.

Anthony Owens

unread,
Sep 11, 2019, 3:29:45 AM9/11/19
to Smart Stepper

Thank you Ed. That all sounds very similar to the manual tuning of multi-axis industrial servos. I’m glad to know that the underlying energisation of the windings is servomotor-like, and that the locked rotor stiffness is high enough to cut following error from what I’ve had to get used to with microstepped motors.

All in all, balancing cost per axis against performance, this Smart Stepper sounds a good way to proceed as the next step in a gradual evolution away from RepRap style motion solutions towards conventional servomotor/ballscrew.

 

One other thing I might investigate is to use rubber isolation mounts to attach the motors to the structure of the printer while suppressing structure-borne vibration: https://www.banggood.com/57576mm-Metal-57-Stepper-Motor-Vibration-Damper-Shock-Absorber-for-3D-Printer-Part-p-1416470.html?rmmds=detail-left-hotproducts__3&cur_warehouse=CN

I have found these very effective in a stepper-driven tracking telescope mount.

 

Tony

Anthony Owens

unread,
Sep 11, 2019, 3:32:13 AM9/11/19
to Smart Stepper
I'll buy a NEMA 23 setup and once your opto board is available I can design something neat and tidy and printable that offers some environmental protection too.
Tony

Ed Simmons

unread,
Sep 11, 2019, 3:39:50 AM9/11/19
to Smart Stepper
That sounds great :) thank you!

Ed Simmons

unread,
Sep 14, 2019, 8:57:13 AM9/14/19
to Smart Stepper
I've just built the first step/direction/enable line driver PCBs to test. These PCBs take the place of stepper modules on ramps and similar boards.

So far I've successfully tested that the signalling is able to drive the optocoupler inputs on the inputs/filter board up to 200khz and probably beyond that if the smart steppers have approximately 0.7v logic high threshold.

Length of cables of several metres won't be a problem when using both my new PCBs.

ESD protection for the machine controller is provided inside the IC used on these boards. The output is an open drain MOSFET and is much more robust than using a microcontroller pin directly attached to a long wire. This MOSFET can sink a greater current than the microcontroller pins, too.

All in all good news for machines with long wiring or any noise problems.

I'll test on a machine soon.

Michael Anton

unread,
Sep 14, 2019, 4:47:12 PM9/14/19
to Smart Stepper
Is the driver your using still a ULN2003 as you mentioned earlier?

Ed Simmons

unread,
Sep 15, 2019, 5:08:55 AM9/15/19
to Smart Stepper
I've swapped the ULN2003 for a different line driver/buffer IC in my new design. The ULN2003 has 7 outputs and is too large, also the maximum switching current is pretty excessive for the application. I had a few ULN2003 handy and it worked well in my prototype. The prototype is built on pad per hole board and is much larger than the existing stepper driver modules.

I wanted my design to fit on the same footprint as the existing stepper driver modules. This new version neatly coexists with any combination of modules, eg on a RAMPS board. The line driver/buffer IC provides similar ESD protection and has the correct number of outputs. The maximum sink current of 32mA per output is ample for fast signals to an opto-isolator.

The step/direction/enable signals are driven low by open drain mosfet outputs and broken out to the top connector. The motor power, logic power and ground are provided on the top connector too.

IMG_20190915_095101.jpg


Left to right:

 - My new line driver module (pin header instead of a JST connector, for ease of testing on the bench)

 - Big Tree Tech's passive stepper signals breakout module (my module is a better version of this)

 - A4988 stepper driver module


Ed Simmons

unread,
Sep 25, 2019, 12:31:07 PM9/25/19
to Smart Stepper
All the parts arrived yesterday and I got the first panel of the motor input/power filter boards made.

IMG_20190925_172007.jpg


The board on the left provides ESD protection to the signalling to the smart stepper. 
The board on the right fits onto the smart stepper and provides everything you need for noise free signalling.

I have a few sets available for those who are really keen and they'll be available for sale on my site very soon. We're also working on the docs for these. :)

Will Walk

unread,
Sep 25, 2019, 1:56:28 PM9/25/19
to Smart Stepper
Wow that looks great. I'd like to see how it mounts to the smart stepper. Did you say it would fit on the Nema 23 model?

Ed Simmons

unread,
Sep 26, 2019, 3:45:28 AM9/26/19
to Smart Stepper
Thanks :)

The mounting holes of NEMA 17 motors are 31mm between centres of adjacent holes. I made the isolation/filter board so it will piggy back on the motor. I think it should be possible to mount the PCB on the NEMA 23 smart stepper board as Andrew mentioned there are spare mounting holes with 32mm centres. I don't have a NEMA23 smart stepper available so I would like to clarify this and maybe route slots instead of holes to be more accommodating of alternative mounting arrangements.

Ed Simmons

unread,
Sep 27, 2019, 2:42:15 AM9/27/19
to Smart Stepper
Here's a picture of the board mounted on a NEMA 17 smart stepper.

I have just placed things together to take this photo, I didn't use all four mounting holes. The connectors are also not yet soldered on. 

IMG_20190927_073723.jpg


Ed Simmons

unread,
Sep 30, 2019, 5:23:58 AM9/30/19
to Smart Stepper
I now have the line driver modules fitted to my pick and place machine and they're working perfectly. The 5v, Gnd and motor V+ connections are elsewhere in my wiring - which is why three pins on the JST connectors are empty, to keep the higher currents away from the controller. This isn't necessary any more, but I prefer it this way and will keep it as-is.

Because of the ESD protection offered, I'm much less worried about blowing up controller outputs with accidental discharges when probing signals with a scope etc. :)

IMG_20190930_095840.jpg



I can ship the line drivers now, supplied with loose connectors to solder yourself. About £5 + p&p per unit, with some discount on bulk orders.

Ed Simmons

unread,
Oct 3, 2019, 3:36:39 AM10/3/19
to Smart Stepper
I've been operating my pick and place machine using these line driver boards to provide signalling to smart steppers (which are still fitted with my prototype opto-isolator & filter boards) for around 4-5 hours with no loss of precision. Before I fitted the line drivers to my controller and added the isolator/filter boards to the smart steppers I was seeing enough extra steps (noise) counted by the smart steppers to make the machine impossible to operate. Now that I have the smart steppers working without noise influencing the signalling, I am really happy with this machine setup. Sadly, I have now cost myself a load of pain by not clicking apply in a settings window and then having a machine crash.

The difference in top speed the machine can reach is amazing. Before my overhaul, using only basic stepper drives, I couldn't successfully move faster than 800mm/s on X axis and about 500mm/s on Y, now I have no problems setting both axes to over 2000mm/s top speed with 3000mm/s² acceleration. I'm sure with more patience tuning the PID controllers I will be able to push this further. Before the isolator/filter boards, I wasn't able to set speed too high, as the rapidly changing current caused a lot of noise that was in turn picked up by the step/direction signals of all my stepper drives and the smart steppers. On a couple of occasions during testing this was so bad it caused runaway motion as there was some sort of positive feedback loop happening.

I don't actually know the spec of the motors used before, or those used in my smart steppers. The motor housings of the smart steppers are slightly shorter than the original motors, so I actually expect the motors used in my smart steppers have a slightly lower torque figure. Clearly, the smart stepper control works wonders!

None of the loads that switch on and off in the machine affect the smart steppers, and the smart steppers operating at high speeds no longer causes Z to step occasionally, which I had seen early in my upgrade/overhaul.

I haven't done any comparison measurements with noise before/after because the difference was so great it didn't make much sense, but the 24v supply is now free from the high frequency noise that was prominent before. Wherever I measure for noise, it's massively improved.

Ed Simmons

unread,
Oct 19, 2019, 5:57:38 AM10/19/19
to Smart Stepper
We have now made both the PCBs described in this thread available to purchase from our site.


Thanks to everyone who supported the idea! :)

Ed

 



Ed Simmons

unread,
Oct 28, 2019, 1:25:18 PM10/28/19
to Smart Stepper
I spent some time making conducted noise measurements of a smart stepper today. I had two test setups for comparison.

Both setups attempt to be as equal as possible, using the same test leads, general wiring scheme etc and I aim to compare the smart stepper using the supplied connector breakout, vs the smart stepper + input isolation/power filter PCB and line driver PCB.

The smart stepper is an MKS Servo42A.
I have the 24v motor power supplied through the LISN and output to the scope (terminated in 50r feed-thru into scope) in all cases.
The smart stepper is grounded/earthed to the LISN.
There is a common connection where 5v gnd, 24v gnd and protective earth are all connected together.
All test leads are twisted where possible.
24v and 5v are supplied to the smart stepper from a quiet bench PSU.
A signal generator provides a 15khz step signal to move the motor.
No mechanical load on the motor.

Test setup 1:
Smart stepper, with supplied adaptor pcb

download_20191028_165458.jpg


Test setup 2:
Smart Stepper, using both our line driver PCB and the Smart Stepper Input Isolation and power filter PCB

IMG_20191028_162643.jpg


First, running the smart stepper without any power filtering gave results like so:


A prominent peak at roughly 95-96kHz.


ADS00004.png



Another peak at around 186kHz

ADS00003.png


The results of the second test setup have noticeably improved the situation.


ADS00002.png




ADS00003.png



As you can see from the scope screen grabs, the settings are the same in all captures.


Since the LISN is a DIY contraption, I'm not going to make any guess of how good it is compared to a commercial unit, but it does allow me to make decent comparisons and see that the filters work well to reduce the high frequency noise.

I'd like to have a more representative test setup where the motor is loaded and changing speed, but for a first pass at this the testing is encouraging.

I observed, but can't easily show here, that loading the motor when in motion increased the broadband noise over any measurement range of the scope/FFT plot, much more in the first test setup than the second setup. I am overall very pleased with the results.

I have a second DC LISN in progress, so I can see common mode vs differential mode noise separated - all the measurements above show a mixed signal of both. 



Christopher Brown

unread,
Oct 30, 2019, 6:33:45 PM10/30/19
to Smart Stepper
Hey Ed,

Just got my filter boards from you. They look awesome and I can't wait to start setting them up for my machine.

Couple of quick questions that I think all will benefit from the answers which is why I am asking here not in PM.

1) What is considered pin 1 on each board/connection? I didn't see it in the documentation or I missed it.

2) Can the line drive modules be stacked for dual Z motors?

Ed Simmons

unread,
Oct 31, 2019, 4:40:52 AM10/31/19
to Smart Stepper
Hi Chris,

Thanks!

Sorry pin 1 isn't clear on the line driver boards - I will definitely address this before the next batch of PCBs are made. The pin one markings of pin header seem to mostly/completely disappear with this fab. I'll make markings much clearer on the next iteration. I just updated the manuals to more clearly show this information, we will get these updated docs onto the site this morning. For convenience, I'll put the info here too...

Stepper signalling line driver board:

line-driver-connectors-labelled.png


Output connector
1Direction
2Step
3Enable
4Gnd
5Logic VCC
6Motor VCC
Module connector
Gnd116Direction
Logic VCC215Step
NC314NC
NC413NC
NC512NC
NC611NC
Gnd710NC
Motor VCC89Enable

Smart stepper input isolation/power filter board:

smart-stepper-input-pcb-connectors.png



Input connector (J1):

  1. Direction
  2. Step
  3. Enable
  4. Gnd
  5. 5V supply input
  6. Motor supply input

Motor connector (J2):

  1. Direction
  2. Step
  3. Enable
  4. Gnd
  5. 5V supply output
  6. Motor supply output

Both of these connectors have pin one marked by a silk screen arrow and a square copper pad.

I would not recommend stacking the line driver PCBs to drive two motors on an axis, just because of the awkward mounting of the output cable. You can wire two smart steppers to a single line driver if you add in a 220-330R resistor in series with each step/direction/enable signal to reduce the drive current into each opto isolator. Alternatively you could wire two line drivers side-by-side on some prototype board.

Many thanks,
Ed

Ed Simmons

unread,
Oct 31, 2019, 5:00:35 AM10/31/19
to Smart Stepper
Correction to the above:

The order of the input connector is actually:

Input connector (J1):

  1. Motor supply input
  2. 5V supply input
  3. Gnd
  4. Enable
  5. Step
  6. Direction

Ed Simmons

unread,
Nov 2, 2019, 7:32:12 AM11/2/19
to Smart Stepper
I wanted to improve on my comparison measurements because I had some parts arrive and could improve the test gear a bit, but I got sidetracked in an interesting way...

The new LISN I have made is a dual line DC version, so I can get two signals (eg the noise component from both the positive supply line and from returning negative line) and I also made a small signal transformer to obtain the common mode and differential mode noise signals from these two outputs.

When I started setting up the test, on the spectrum analyser I seemed to have significant noise that I hadn't seen the previous day. The noise persisted even with the power to my test setup switched off. To try and determine the source of the noise, I switched various things off in my surroundings and nothing much changed. However, my 3d printer was running and when it came to the end of the print job and I powered it off, the worst of the noise disappeared. As soon as I noticed the drop in the noise (a broadband reduction of background noise) I was pretty sure I had found the source of most of the measurement noise in my test setup. To be certain, I powered on and off the printer a couple of times and observed the noise floor shift up and down. The printer is to blame. Since this test setup is quite near to the 3d printer, it prevents any meaningful measurements while it is powered on.

The 3d printer uses two smart steppers (MKS Servo42) on X and Y axes and other stepper drivers for the extruder and Z axis. I had thought up until now that I had done quite well at ensuring the printer didn't make too much noise, but it seems I'm wrong. The printer has twisted power wiring, plenty of capacitors in strategic locations, avoids ground loops etc, but I have not yet fitted my power filter/isolation boards to it (don't fix what isn't broken)... However I'm certainly going to now.

I decided that I should have a loop antenna to see if I can locate problems in a non-invasive way. I 3d printed a loop antenna coil former and wound a coil onto it. Using the antenna I was able to see very similar looking FFT plots to the plots from the LISN and it also made me realise one of the persistent peaks I had been seeing (around 66kHz) was something external. Nothing I did seemed to affect the strength of this signal very much - in the end I googled "what transmits at 66khz" and found this: https://en.wikipedia.org/wiki/RBU_(radio_station) - I'm in the UK.... O_o 

So, from now on I will ignore the 66.666kHz peak in all my data, I'm not going to get rid of that easily, but weather conditions, orientation of antenna etc might make it more or less apparent in various measurements. I'm not going to build a faraday cage for the sake of some comparisons ;)

Other electronics in my immediate surroundings produce very little emissions across all the frequency range I was examining, I even went around the room with the antenna and approached all the computers and other devices to see if anything appeared - nothing interesting to report.

The pick and place machine I have been working on has my power filter/isolation boards fitted to the smart steppers (used on X and Y) where the 3d printer does not and I can really tell the difference.

Here's a comparison between background noise, the 3d printer powered on, and the pick and place machine powered on, all measured with the same settings and the loop antenna positioned roughly 1m away from each machine. The background and 3d printer screen grabs are both with the antenna in the same location.

Background noise for reference (left hand peak is 66.666kHz RBU, I think):

BG.png


3D printer (note RBU is drowned out):


3D.png


Pick and Place machine (barely any change from background):


PNP.png



I can clearly see the difference in the radiated noise from the 3d printer vs the pick and place. I have a hard time discerning much difference between the background and the pick and place measurement.

Although crude compared to real EMC testing, this has been very interesting and now I have accidentally tooled up with a load more DIY EMC testing equipment! :)

I intended just to produce some comparisons of the differential mode noise at the beginning of this, but as you can see it went a bit further than that. The differential noise is what the smart stepper board sees as varying ground potential at the inputs without anything to mitigate the effects this affects the signalling if the wiring is long. 

Here is the comparison I initially set out to make: 

Measuring conducted differential mode noise using the LISN on the 24v supply and GND caused by the smart stepper in operation compared to the same smart stepper with the same step rate but using the power filter/signal isolating board.

Again I need to include the background measurement for a proper comparison.

Background:

BG.png



Smart stepper:

DM_WOF.png


Smart stepper, with power filter/isolation board:


DM_WF.png



There's more than 10dB reduction in the worst part of the noise around 94-96khz. I am very happy with the performance and can finally confirm that the noise is attenuated enough that it's not radiating badly, thanks to this series of tests.


Ed Simmons

unread,
Nov 12, 2019, 5:34:21 AM11/12/19
to Smart Stepper
I've just run into a good reason to change component values on my isolation stage of the power filter/input isolation PCB...

After fitting the PCBs to the 3D printer that was causing the noise shown in my previous post, I had trouble with missed step pulses during very fast rapid moves and saw on the scope that the output pulses were quite stretched compared to input pulses, meaning too tightly spaced pulses would register as a single pulse not two. Seems I was over saturating the opto-coupler phototransistor and it's working much better with a lower drive current to the optocoupler IR LED inputs.

I will update my design so all future boards include this change, and anyone who is seeing similar issues using my boards should replace R1-R3 with 1k 0603 resistors.

Jeno Bozoki

unread,
Nov 12, 2019, 6:00:32 AM11/12/19
to Smart Stepper
Hi Ed,
Could you specify what the very fast rapid movement was? In terms of pulse/sec.
Tia,
Jeno
p.s.:I bought your current boards and just want to decide if I should change the components.

Ed Simmons

unread,
Nov 12, 2019, 6:15:08 AM11/12/19
to Smart Stepper
(reposting this message here, I replied directly by mistake)
Hi Jeno,

I was running into problems with 400 steps per mm motor settings and rapids exceeding 5500mm/min. I make this a step rate of roughly 36kHz. The downward slope of the outgoing pulse from the opto-isolator was too long and the next pulse would sometimes overlap and not be registered by the motor inputs.

Thanks,
Ed

Ed Simmons

unread,
Dec 8, 2019, 2:06:08 PM12/8/19
to Smart Stepper
I have found that the operating voltage of the mks smart steppers is very critical for good performance.

Today I was trying to diagnose some mysterious offset that was showing up gradually in my 3d printing. The offset was not constant per layer or predictable and I wasn't able to find any source of noise that would explain it.

I decided during tests that I should increase the voltage of my 5v nominal supply to the smart steppers. At around 5.8V all the issues I had been seeing stopped and the prints look better than I've ever seen before from this printer/setup!

Measuring the 5v supply voltage across the input to the smart stepper, I was actually seeing 5.6v after the power filters on my opto-isolated input/power filter board. All the ripples in my prints have vanished!

I hope this is helpful to someone :-)

Ed Simmons

unread,
Jan 5, 2020, 9:22:46 AM1/5/20
to Smart Stepper
A quick update to my previous post....

I have fixed the issues I was seeing with the 3d printer - the layer offset problem was very confusing and reappeared sporadically but I eventually tracked down bad calibration of the X motor, somehow I also had another smart stepper which was in a similar state which meant the same problem was apparent when I swapped out the whole smart stepper.

I found that varying the 5v supply voltage was affecting the motor with bad calibration very badly while not affecting another smart stepper at all. Eventually after several goes at calibrating the misbehaving smart stepper and using 'testcal' to check it, I got results like 0.107° max error. Finally the printer is not being cryptic!

While I haven't empirically determined a max frequency for the isolation boards yet, I know they work well up to 66kHz and probably some way beyond. I'm using the isolation boards up to this frequency in my pick and place machine with no issues.

Jeno Bozoki

unread,
Jan 28, 2020, 1:07:57 PM1/28/20
to Smart Stepper
Hi Ed,

Is it possible that your filter board changes the dir pin?
After I installed one, I had to invert the dir pin to get it working right.
And no, the motor connector was not touched.

Regards,
Jeno

On Friday, August 23, 2019 at 8:06:41 PM UTC+2, Ed Simmons wrote:
Hi all,

I have had quite a challenging time getting the smart steppers to work well in my machine, due to electrical noise susceptibility on the step/direction/enable signal inputs. My smart steppers showed more than the expected number of steps when checking "getsteps" on the motor cli and jogging the machine a known amount. Also with "debug 1" the motor regularly showed it was enabled and disabled when it should have been enabled all the time.

Currently available smart steppers are very susceptible to electrical noise and produce noise that is difficult to filter out. Problems with noise being present in the step/direction/enable signalling leads to loss of accurate step count and error in the commanded motor position, without this error in the step/direction signalling the position control of these is excellent. :)

One suggestion has been to use different pull up resistors on these inputs, but this is not a complete solution to the problem. The bigger problem is how much noise is coupled out onto the external wiring, including that for the signalling and this causes false step counts. It is far worse during motion with high currents and a heavy load on the smart stepper.

As a result I have come up with two designs of filter PCB to suit the smart steppers. One is already in use on my machine and the second is a later re-think of this design. Both designs overcome the problems with existing smart steppers where noise causes false steps/enable/direction state changes.

A vague spec follows:
  • Filtered motor and logic power
  • Passive power filtering removes high frequency noise instead of coupling it to the machine wiring
  • Opto-isolated signalling prevents power noise affecting signalling
  • Designed to be installed close to the motor
  • Approx 50mm x 50mm x 10mm 
Since there's been some interest in the "NOISE" thread, I thought I should start a dedicated thread to discuss the possibility of these boards and gauge how many people need them. If anyone likes the sound of these please let me know here and I'll try to make these available to purchase.

I hope these can help a few people out :)

Ed

Ed Simmons

unread,
Jan 29, 2020, 7:28:23 AM1/29/20
to Smart Stepper
(re-posting my direct reply to the list)

Hi Jeno,

Yes, the signal is inverted by the line drivers and again at the optocouplers. I will check our documents to make sure we're clear about logic level inversions.

You can change the direction pin polarity at either the motor or the machine control, but I feel it is more intuitive to have default behaviour at all the motors unless there's a special reason (such as opposing dual y motors, one would need reversing) and make any changes you need to your machine controller configuration.

I hope that helps.

Many thanks,
Ed

Reply all
Reply to author
Forward
0 new messages