Input Shaping with RRF

1,802 views
Skip to first unread message

LukeH

unread,
Feb 10, 2022, 1:13:31 AM2/10/22
to 3D Printing Tips and Tricks
So I acquired a Adafruit accelerometer, and wired it up to my Duet 2 Wifi running RRF V3.3. The accelerometer powers up (it has an on-board LED), and when I tell my firmware there is an accelerometer there it detects it without issue, and I get a cheerful green message (as opposed to when I neglected to plug in one of the CS pins and got a red “No accelerometer detected” error).

Happiness.

When I try to use the accelerometer to collect data however, I get a log file with a whole. Bunch of zeros then a “Failed to collect data from accelerometer” message.

Sadness.

There is a bunch of tricks on the Duet3D forums I am yet to try, such as isolating the CS wire, wrapping the entire cable in aluminium foil, or switching out the ribbon cable for shielded USB3 cable (awesome - more crimping. :P ). It is a big printer, so the cable is long (a little over a metre/somewhere between 3 and 4 feet).

Has anybody here had success? Would it be worth trying the release candidate for RRF V3.4? Any other ideas?


TobyCWood

unread,
Feb 10, 2022, 11:50:57 AM2/10/22
to 3D Printing Tips and Tricks
I’m waiting. Dc42 says there’s a bug in the boards driver.

LukeH

unread,
Apr 12, 2022, 1:14:23 AM4/12/22
to 3D Printing Tips and Tricks
I installed RRF 3.4 (release version), and the Beta Input Shaping Plugin (not the Accelerometer Plugin, but the one with the data collection wizard).

First couple of attempts, it was detecting that there was an accelerometer present, but couldn’t seem to collect any data (I’d get a file with all zeros). After thinking about it for a while, and checking/rechecking my hardware setup to no avail, I tried wrapping my 10-core, unshielded LED wire I was using to connect the accelerometer to the Duet 2 WiFi with copper tape (or “Faraday tape”, as I’ve heard it called - basically looks like shiny cloth tape, but the “cloth” is a fine copper wire mesh), and the accelerometer started working a treat. Seems interference on the long cable run was the issue.

I’ve collected some data and set up the input shaping. Just printing some before and after test pieces now to see if it works. I’ll post photos when they are done.

LukeH

unread,
Apr 12, 2022, 5:17:40 AM4/12/22
to 3D Printing Tips and Tricks
E5B7151B-A178-45D1-A16A-16E73E3B7A93.jpeg
Here’s some photos. 

These ones are PLA, printed at 120mm/s (on my large delta printer). Excuse the stringing, I had been playing with my fan settings and forgot to rest them in my slicer.

One photo is in the X-axis direction, and the other is in the Y-axis direction. In both photos, the top print is with EI3 Input shaping turned on, and the bottom is with Input shaping turned off.

Doesn’t seem to be a complete silver bullet for ringing, but it makes a massive difference.

CC43C7B9-7ED4-40B8-8CF1-53E036F4EDFF.jpeg

Alan B

unread,
Apr 12, 2022, 12:36:32 PM4/12/22
to 3D Printing Tips and Tricks
Twisted wires will help, perhaps enough to get the job done. I2C was not designed for long distances. You can twist the wires with a drill, or use wires from ethernet cable.

--
You received this message because you are subscribed to the Google Groups "3D Printing Tips and Tricks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 3d-printing-tips--...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/3d-printing-tips--tricks/474b1919-98ac-40b6-973b-24e6769b0646n%40googlegroups.com.

TobyCWood

unread,
Apr 12, 2022, 12:41:49 PM4/12/22
to 3D Printing Tips and Tricks
Again... the misunderstanding about twisted pair. It's not the twist of the wires that are the protection, it's the mag fields. The twisting is only to ensure equal lengths and distance for the leads. 

Mark Napier

unread,
Apr 12, 2022, 1:17:30 PM4/12/22
to 3D Printing Tips and Tricks
Sorry, I just can't help myself.

The twisting does more than that.  It's a way of providing some immunity to low-frequency H-fields.

To explain, EMI at higher frequencies is dominated by E-fields as radiated energy.  For those the best protection is provided by shields.  Lower frequencies are dominated mostly by H-fields that are local and produced by conducted current.  Shields don't help much because low frequency will penetrate them.

Twisting a wire pair (signal and return path) essentially averages out the time this wire loop faces towards and away from a source (or destination).  So thus for instrumentation you often see the twisted shielded pair.  For phone systems they are unshielded and there will be several pairs; each pair coupled together.  This works for emission as well.  At any distance from an active pair the effective H-field drops to zero.

So in all projects all my pairs are twisted.  For the 3D printer the pairs on the 2 stepper legs are twisted.  Wires to a switch or sensor are twisted.  Wires to my heaters are for sure twisted (AC load that is also switched).   Supply wires and ground return are twisted.  Heck, even wires to a light are twisted since the supply is essentially PWM too.

My 2 cents.

Mark Napier



Luke Hartfiel

unread,
Apr 12, 2022, 4:51:53 PM4/12/22
to Mark Napier, 3D Printing Tips and Tricks
For me, using shielded tape did the job - the accelerometer works and is providing good data, as can be seen by the results from turning on input shaping. 

Plus it only took a few minutes, and I could do it in place, rather than removing and replacing the installed wiring with twisted pairs, or some other shielded option. I didn’t even need to unplug anything.

My cable run is probably longer than 95% or more of printers out there (from bed to control board is a wiring distance of about 5 feet). People with smaller printers may not need shielding at all (there is about 12 inches of my cable length that I didn’t tape because cable routing made it inconvenient to do so quickly).

If you think that using shielded tape is a kludge, you’ll probably be dismayed to learn that my mounting solution for the accelerometer was to just hot glue it to the top of my effector… :)






On 13 Apr 2022, at 3:17 am, Mark Napier <napie...@gmail.com> wrote:


You received this message because you are subscribed to a topic in the Google Groups "3D Printing Tips and Tricks" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/3d-printing-tips--tricks/X9YnNJNE5io/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 3d-printing-tips--...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/3d-printing-tips--tricks/CAFS2mBc%2BG7q0SEY3ZBcyxegXJCAnVEf11D7jG%3DXFhcm5j%2BkP8Q%40mail.gmail.com.

Mark Napier

unread,
Apr 13, 2022, 4:22:34 AM4/13/22
to 3D Printing Tips and Tricks
Ha! Testing is the best way for sure.  No doubt if the wiring is in place ripping it out is a non-starter.

Glad it's working for you.

Luke Hartfiel

unread,
Apr 13, 2022, 7:19:27 AM4/13/22
to Mark Napier, 3D Printing Tips and Tricks
As I said in an earlier post, I’ve read that some people use shielded USB3 cables for their accelerometers. I’m sure that would be a great solution (shielding plus twisted pairs), but I just went with what was lying around the workshop, left over from other projects.

On 13 Apr 2022, at 6:22 pm, Mark Napier <napie...@gmail.com> wrote:



TobyCWood

unread,
Apr 14, 2022, 1:01:03 AM4/14/22
to 3D Printing Tips and Tricks
Yeah mark you CAN help yourself. Check my direct email to you and please stop posting misinformation. Simply twisting wires does not make the cable “twisted pair” per the IEEE standard nor does it in and of itself provide RFI protection. And it also does not prevent poorly balanced cables from emitting RF. Where’d you get that from?
Twisting the wires is done when the leads are separated and it ensures that they are equal length and always the same distance from each other to ensure the counter rotation of the EM fields work as protection from radiated interference. Conductive methods are usually at the connectors. The pre made CAT 5 cables used in connecting low cost lan devices are “twisted pair” yet there’s no physical twist in the wires. Why?   because the two leads are held side by side within the insulation.
I see a segment recording on this in my next recording session. Sigh…

Mark Napier

unread,
Apr 15, 2022, 9:31:02 PM4/15/22
to 3D Printing Tips and Tricks
Respectfully, a technical disagreement is not the same as misinformation.

I'll not argue the point anymore but if you ask where I get that it is from over 35 years as a practising EE with a background in geophysics and instrumentation.  The low frequency and high frequency methods of EMC came from my class in my masters degree program.  They can be read about in the textbook for that class:

C. R. Paul, Introduction to Electromagnetic Compatibility, John Wiley, 1992.

I will freely admit that there are other methods to achieve compliance and consumer electronics really do make this an artform and they do it subtly and very cheaply.

Best regards,

Mark Napier


TobyCWood

unread,
Apr 16, 2022, 11:34:14 AM4/16/22
to 3D Printing Tips and Tricks
Regardless… just twisting wires is not going to prevent EMI. If you’re going to tell people it will please do it on Facebook or YouTube.

Luke Hartfiel

unread,
Apr 16, 2022, 6:17:21 PM4/16/22
to TobyCWood, 3D Printing Tips and Tricks
If I could maybe just return the topic to input shaping briefly, one thing I have noticed is that in RRF 3.4, using the Input Shaping plugin, it doesn’t persist when the printer is turned off and turned back in again.

The settings persist, but I seem to have to manually go back in and turn it on.

It won’t be as convenient, but I’ll have to look at hard coding the settings into the configuration files, so they initialise on startup… 

On 17 Apr 2022, at 1:34 am, TobyCWood <andyc...@gmail.com> wrote:

Regardless… just twisting wires is not going to prevent EMI. If you’re going to tell people it will please do it on Facebook or YouTube.
You received this message because you are subscribed to a topic in the Google Groups "3D Printing Tips and Tricks" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/3d-printing-tips--tricks/X9YnNJNE5io/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 3d-printing-tips--...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/3d-printing-tips--tricks/28aca8c2-5aa0-44f6-8199-f1aefa8928f5n%40googlegroups.com.

TobyCWood

unread,
Apr 17, 2022, 12:19:00 PM4/17/22
to 3D Printing Tips and Tricks

So where and how did you mount the accelerometer board? Is it best to have it as close to the tip of the hot end or does it matter?

Luke Hartfiel

unread,
Apr 17, 2022, 5:27:44 PM4/17/22
to TobyCWood, 3D Printing Tips and Tricks
I mounted it on a clear, flat space on the top side of my Delta effector using hot glue. My aim was to get it on in the right orientation (you have to tell your printer how you have aligned the accelerometer with the printer’s X/Y/Z axis to get meaningful data) somewhere not too close to all of the rare earth magnets holding the effector to the rods.

While I guess mounting it a close to the nozzle is optimal, I’m not sure it matters too much, since the damping effect is not that exact (it is a general effect centred around one selected frequency), and any difference in resonance between where I mounted the accelerometer and the nozzle would have to be very low amplitude. Of course that assumes that everything attached to your effector (or X-carriage for a CoreXY) is already solid and the heat sink doesn’t wobble around independently - input shaping isn’t going to magically fix a broken printer.

Also obviously if you were using a Mendel, you can only do input shaping in the X-axis, since the accelerometer on the X-carriage isn’t going to detect movement of the bed :P. For CoreXY, you can simultaneously collect movement data in both X and Y, and for a Delta, it can measure data in all three directions.

On 18 Apr 2022, at 2:19 am, TobyCWood <andyc...@gmail.com> wrote:



TobyCWood

unread,
Apr 18, 2022, 11:59:52 AM4/18/22
to 3D Printing Tips and Tricks
Do you have a reference for how to connect up that board?

TobyCWood

unread,
Apr 18, 2022, 12:38:29 PM4/18/22
to 3D Printing Tips and Tricks
I have this...
seems to tell me what I need.

Luke Hartfiel

unread,
Apr 18, 2022, 5:20:20 PM4/18/22
to TobyCWood, 3D Printing Tips and Tricks

That’s what I used for the wiring, and for the Input Shaping Plugin, I used this:




On 19 Apr 2022, at 2:38 am, TobyCWood <andyc...@gmail.com> wrote:

I have this...

Luke Hartfiel

unread,
Apr 18, 2022, 5:21:50 PM4/18/22
to TobyCWood, 3D Printing Tips and Tricks
The updated version of the wiring documentation is here:




On 19 Apr 2022, at 7:20 am, Luke Hartfiel <lhar...@gmail.com> wrote:



TobyCWood

unread,
Apr 19, 2022, 4:16:09 PM4/19/22
to 3D Printing Tips and Tricks
Nine leads! Egads... Ribbon cable? Yeah grounded copper tape. or perhaps even better a shielded TP batch. The whole thing looks like rabbit hole extreme.

TobyCWood

unread,
Apr 19, 2022, 4:20:05 PM4/19/22
to 3D Printing Tips and Tricks

Luke Hartfiel

unread,
Apr 19, 2022, 5:30:12 PM4/19/22
to TobyCWood, 3D Printing Tips and Tricks
Like I said, I used ribbon cable, because that’s what I had, but if I was buying something, I would have used a USB3 cable - flexible, and with active, ground, and three pairs for data.

On 20 Apr 2022, at 6:20 am, TobyCWood <andyc...@gmail.com> wrote:

whoops no... thats seven leads and one of which is the ground. 

Hayden Pulley

unread,
May 14, 2022, 9:28:11 AM5/14/22
to 3D Printing Tips and Tricks
I've spent more time than I would care to admit wiring my accelerometer. My run is 4 feet. I have tried
-a ribbon cable, no success
-6 inch run of ribbon cable, success but not useful
-creating my own "twisted pairs", no success
-an ethernet cable, no success
-a USB 3.0 cable, works great!
I designed a fan shroud to mount the accelerometer to, not pretty but it works. I'm using RRF 3.3, which will probably change to RRF 3.4 today so I can try that input shaping plugin. I think adding a M593 command in your config.g should load the setting on startup. Thanks for sharing Luke!

Patrick Campbell

unread,
Jul 11, 2022, 11:16:52 AM7/11/22
to Hayden Pulley, 3D Printing Tips and Tricks
Lots of fuzzy info here and on the podcast (cat 5/6/7 requires twisted wires from RJ to RJ, and each wire pair has different twist count/length - using flat CAT is not compliant and may work over short distances, but I’d never trust it in a production environment).  Plus they don’t usually meet the AWG requirement. 

There are many modes of emi, not one answer can solve all of them. 


TobyCWood

unread,
Jul 11, 2022, 3:54:31 PM7/11/22
to 3D Printing Tips and Tricks
The company that put that out there just happens to be the competitor for the SW that I was involved with in it's development years ago! This SW was developed at what used to be HP. Now Keysight which produces some of the most popular Analyzers used in EMI measurement. 
Simply hand twisting cables doesn't do anything for EMI protection! 
Do I really have to go through it all again?
1. It's only for the receiving end (not mentioned in your link) so doing it to keep your motor cables from impacting your other cables is useless.
2. It's only for signal based conduction (i.e., CROSSTALK!) and NOT power (not mentioned in your link)
3. The twisting is only there to ensure the cables are all right up against each other (is mentioned) READ NUMBER 3
4. The twist and the lengths are critical to ensuring it protects against cross talk (kinda mentioned)
5. Flat Cat IS compliant but only practical is shorter lengths. Its WAY more practical to twist and shield in walls.... But these cables are produced is mass quantity by machines. The lengths are exact and the twists in the cables are exact.
The information you cite is not incorrect, it's INCOMPLETE.
Perhaps getting one of the Keysight Engineers who made a career of EMI test and measurement on the podcast is what I need to END THIS BS!!
Reply all
Reply to author
Forward
0 new messages