[SOLVED] Stepper motors stutter in place

Hello!

I’ve started putting together the electronics part for the MPCNC, and I’m almost there, except for the part where the steppers move, but by very small steps and quite erratically.

PROBLEM

Everything turns on properly, I’m able to control everything with the LCD or with Repetier. However, whenever I try to move the steppers manually (either LCD or Repetier-Host), they react (slight jerk+sound), but do not move as they are supposed to.

HARDWARE

  • Nema 17 1.5A 12V (link)
  • Einsy Rambo 1.1b (link)
  • LCD Display (link) (works fine)
  • Power Supply 24V 10A (link)
SOFTWARE
  • Flashed the MPCNC_Rambo_T8_16T_LCD from the Github repo. Should it be the MiniRambo firmware instead?
  • Changes I've made to Configuration.h
    • #define MOTHERBOARD BOARD_EINSY_RAMBO
    • #define SPI_SPEED SPI_HALF_SPEED
    • #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER #define ST7920_DELAY_1 DELAY_NS(0) #define ST7920_DELAY_2 DELAY_NS(500) #define ST7920_DELAY_3 DELAY_NS(0)
  • Changes I've made to Configuration_adv.h
    • #define R_SENSE 0.22
    • (i'm not using SPI for the TMC2130 drivers, which are the ones in the board I have)
  • Whenever I send M119 through Repetier, it responds with "Testing X Connection... OK" (for X, Y and Z)
 

QUESTIONS

  • Does it have to do with the power supply? I'm outputting 24V to the Einsy Rambo, and I'm assuming that it's only sending 12V to the steppers.
  • Does it have to do with the firmware? There's only prepared firmware for the Rambo and MiniRambo, and none for the Einsy. I've tried both, and had more success with the Rambo firmware (then again this is my first time in the world of CNCs, but not in the world of electronics).
  • Does it have to do with the wiring of the motors themselves?
  • Does it have to do with enabling SPI drivers for the TMC2130? Whenever I enable it and define the pins based on the schematic I've found for the 1.1a (I have the 1.1b)
 

Please let me know if there is anything I’m missing in the process, or if you need more information! And I appreciate all the help :slight_smile:

No, it will send 24V to the motors, but that’s a good thing.

You’ll want to rewire the Z to be series wiring. The plugs on the board are wired for parallel.

I think this is the problem. I don’t think the einsy can be used without spi, so I don’t know what the settings are on the drivers. You should need to change the drivers to TMC2130 here:

https://github.com/Allted/Marlin/blob/MPCNC_Rambo_T8_16T_LCD/Marlin/Configuration.h#L662

You can also enable TMC_DEBUG here:

https://github.com/Allted/Marlin/blob/MPCNC_Rambo_T8_16T_LCD/Marlin/Configuration_adv.h#L2089

And then use M122 to get a bunch of info about what Marlin thinks is happening on the drivers. If you paste that output here, I might be able to see more.

This also looks suspicious. Maybe this shouls be on:

https://github.com/Allted/Marlin/blob/MPCNC_Rambo_T8_16T_LCD/Marlin/Configuration_adv.h#L1984

Lastly, disable steathchop. Since our machines need full torque at low speeds, it should be turned off:

https://github.com/Allted/Marlin/blob/MPCNC_Rambo_T8_16T_LCD/Marlin/Configuration_adv.h#L1974

As far as mini rambo vs. Rambo. They are both equally far off, so I don’t think it matters which you start with.

Unless you have a special board, it should be defined already in the pins.h file.

I’m assuming you’ve done this for all axis?

I don’t see anything obvious to cause the stuttering but a few things I’ll point out:

  1. You will want to run z motors in series, not parallel. Even though there are two plugs, you need to connect them in series on one plug or else the current and torque will be half.
  2. You are fine with 24V supply and the motors you got. The board drives the motors with controlled current and the "voltage" of a stepper motors is somewhat of a BS number: sometimes it reflects the max DC voltage you could connect without burning up the motor, but on your motors with 2.3 ohms, a constant 12V would produce 5.2 Amps and 60 watts that would quickly cook the motor. But fortunately your controller will limit the current and the 12V number is meaningless.
  3. I'm guessing you got the R_SENSE value from here? https://reprap.org/wiki/EinsyRambo I'm not sure about setting up the TMC2130 drivers but perhaps you need to at least set up #define X_DRIVER_TYPE (and Y and Z). There is magic in Marlin to handle different drivers properly.
 

Thanks for all your advice and helping me rule out some basic stuff!

 

@Jeffeb, here is the output of M122 after making the changes that you’ve suggested (it looks like the drivers are properly recognized, but I’m concerned about the fact that the motors are not enabled…):

14:59:57.671 : N17 M122*20
14:59:57.677 : X Y Z E
14:59:57.677 : Enabled false false false false
14:59:57.679 : Set current 800 800 800 800
14:59:57.679 : RMS current 795 795 795 795
14:59:57.683 : MAX current 1121 1121 1121 1121
14:59:57.683 : Run current 25/31 25/31 25/31 25/31
14:59:57.683 : Hold current 12/31 12/31 12/31 12/31
14:59:57.688 : CS actual 12/31 12/31 12/31 12/31
14:59:57.688 : PWM scale 0 0 0 0
14:59:57.688 : vsense 1=.18 1=.18 1=.18 1=.18
14:59:57.692 : stealthChop false false false false
14:59:57.692 : msteps 16 16 16 16
14:59:57.692 : tstep max max max max
14:59:57.692 : pwm
14:59:57.692 : threshold
14:59:57.696 : [mm/s]
14:59:57.696 : OT prewarn false false false false
14:59:57.697 : off time 4 4 4 4
14:59:57.697 : blank time 24 24 24 24
14:59:57.701 : hysteresis
14:59:57.701 : -end 2 2 2 2
14:59:57.701 : -start 1 1 1 1
14:59:57.701 : Stallguard thrs 0 0 0 0
14:59:57.701 : DRVSTATUS X Y Z E
14:59:57.705 : stallguard
14:59:57.705 : sg_result 0 0 0 0
14:59:57.706 : fsactive
14:59:57.706 : stst * * * *
14:59:57.706 : olb * * * *
14:59:57.706 : ola * * * *
14:59:57.706 : s2gb
14:59:57.708 : s2ga
14:59:57.708 : otpw
14:59:57.708 : ot
14:59:57.709 : Driver registers:
14:59:57.709 : X 0xE0:0C:00:00
14:59:57.709 : Y 0xE0:0C:00:00
14:59:57.713 : Z 0xE0:0C:00:00
14:59:57.713 : E 0xE0:0C:00:00
14:59:57.713 : Testing X connection… OK
14:59:57.713 : Testing Y connection… OK
14:59:57.713 : Testing Z connection… OK
14:59:57.718 : Testing E connection… OK

 

I forgot to mention that I actually did enable SPI at some point:

#define TMC_USE_SW_SPI
#define TMC_SW_MOSI 21 //51
#define TMC_SW_MISO 22 //50
#define TMC_SW_SCK 20 //52

However, this configuration compiles properly but on restart, the LCD displays “TMC CONNECTION ERROR”. The commented numbers (50, 51, 52) are the arduino pins vs. digital pins.

 

Now that I’m trying to compile it with just #define TMC_USE_SW_SPI, it throws a bunch of errors, essentially all variants of sketch/src/module/stepper/trinamic.cpp:47:111: error: ‘TMC_SW_MOSI’ was not declared in this scope

I’ve looked in pins/rambo/pins_EINSY_RAMBO.h and those pins aren’t actually defined! So I’m going back to read schematics and seeing if I can find out which number it actually is. I’ve tried the ones specified here, but to no avail. Here is the log that I get:

15:57:25.879 : N17 M122*20
15:57:25.884 : X Y Z E
15:57:25.888 : Enabled false false false false
15:57:25.889 : Set current 800 800 800 800
15:57:25.893 : RMS current 430 430 430 430
15:57:25.897 : MAX current 606 606 606 606
15:57:25.897 : Run current 25/31 25/31 25/31 25/31
15:57:25.901 : Hold current 12/31 12/31 12/31 12/31
15:57:25.904 : CS actual 31/31 31/31 31/31 31/31
15:57:25.908 : PWM scale 255 255 255 255
15:57:25.908 : vsense 1=.18 1=.18 1=.18 1=.18
15:57:25.912 : stealthChop true true true true
15:57:25.917 : msteps 0 0 0 0
15:57:25.921 : tstep 4294967295 4294967295 4294967295 4294967295
15:57:25.921 : pwm
15:57:25.921 : threshold
15:57:25.921 : [mm/s]
15:57:25.926 : OT prewarn true true true true
15:57:25.930 : off time 15 15 15 15
15:57:25.932 : blank time 54 54 54 54
15:57:25.932 : hysteresis
15:57:25.936 : -end 12 12 12 12
15:57:25.937 : -start 8 8 8 8
15:57:25.941 : Stallguard thrs 0 0 0 0
15:57:25.941 : DRVSTATUS X Y Z E
15:57:25.941 : stallguard * * * *
15:57:25.945 : sg_result 1023 1023 1023 1023
15:57:25.950 : fsactive * * * *
15:57:25.954 : stst * * * *
15:57:25.954 : olb * * * *
15:57:25.959 : ola * * * *
15:57:25.961 : s2gb * * * *
15:57:25.961 : s2ga * * * *
15:57:25.966 : otpw * * * *
15:57:25.966 : ot * * * *
15:57:25.970 : Driver registers:
15:57:25.971 : X 0xFF:FF:FF:FF Bad response!
15:57:25.971 : Y 0xFF:FF:FF:FF Bad response!
15:57:25.975 : Z 0xFF:FF:FF:FF Bad response!
15:57:25.975 : E 0xFF:FF:FF:FF Bad response!
15:57:25.978 : Testing X connection… Error: All HIGH
15:57:25.978 : Testing Y connection… Error: All HIGH
15:57:25.983 : Testing Z connection… Error: All HIGH
15:57:25.983 : Testing E connection… Error: All HIGH

 

I’ve also added #define SOFTWARE_DRIVER_ENABLEin Configuration_adv.h, but no changes either. I’ll keep on looking/trying different combinations!

This part is promising.

I think this is telling you that there are “open loops” on all the coils. Did you have the motors connected?

This is wrong. It’s not communicating and getting junk from spi.

I also think the TMC_USE_SW_SPI isn’t saying use SPI, it’s saying “use software for spi”. Which, if you can use hardware SPI, it will be better. That’s probably why it wasn’t defined in the pins file. I would try backing the SW features out and go back to whatever they were set at in github. Although, whatever you did to get the first M122 looks like it was working.

Yep, I did have all the motors connected when it signaled an open loop. So that’s making me think that the problem is with the steppers themselves, then.

 

I started with a fresh flash of the Github firmware, and now the motors react (i.e. jerk) when I move them in a direction with Repetier or the LCD, but then each axis completely stops reacting after I’ve moved further than 20mm in any direction. Here’s the latest log.

15:12:09.834 : N17 M122*20
15:12:09.840 : X Y Z E
15:12:09.841 : Enabled false false false false
15:12:09.843 : Set current 800 800 800 800
15:12:09.843 : RMS current 795 795 795 795
15:12:09.847 : MAX current 1121 1121 1121 1121
15:12:09.847 : Run current 25/31 25/31 25/31 25/31
15:12:09.847 : Hold current 12/31 12/31 12/31 12/31
15:12:09.851 : CS actual 12/31 12/31 12/31 12/31
15:12:09.852 : PWM scale 0 0 0 0
15:12:09.852 : vsense 1=.18 1=.18 1=.18 1=.18
15:12:09.856 : stealthChop true true true true
15:12:09.856 : msteps 16 16 16 16
15:12:09.856 : tstep max max max max
15:12:09.856 : pwm
15:12:09.856 : threshold
15:12:09.856 : [mm/s]
15:12:09.861 : OT prewarn false false false false
15:12:09.861 : off time 3 3 3 3
15:12:09.861 : blank time 24 24 24 24
15:12:09.861 : hysteresis
15:12:09.865 : -end -1 -1 -1 -1
15:12:09.865 : -start 1 1 1 1
15:12:09.865 : Stallguard thrs 0 0 0 0
15:12:09.866 : DRVSTATUS X Y Z E
15:12:09.866 : stallguard
15:12:09.868 : sg_result 0 0 0 0
15:12:09.868 : fsactive
15:12:09.868 : stst * * * *
15:12:09.868 : olb * *
15:12:09.868 : ola *
15:12:09.868 : s2gb
15:12:09.868 : s2ga
15:12:09.873 : otpw
15:12:09.873 : ot
15:12:09.873 : Driver registers:
15:12:09.873 : X 0xC0:0C:00:00
15:12:09.873 : Y 0xA0:0C:00:00
15:12:09.873 : Z 0xC0:0C:00:00
15:12:09.876 : E 0x80:0C:00:00
15:12:09.876 : Testing X connection… OK
15:12:09.876 : Testing Y connection… OK
15:12:09.876 : Testing Z connection… OK
15:12:09.880 : Testing E connection… OK

This is the latest log I get (it seems there are less loops open??). I’m wondering if there’s any motor-specific setting that I’m missing, or if I should check a possible wiring problem with the steppers?

 

Edit: I’m also investigating timer options in Configuration_adv.h for the stepper motors.

 

Double-edit: do i actually need to wire the Z motors in parallel for any motor to work properly? Working on it now.

UPDATE

 

The wires on the steppers were incorrectly wired. It says on the spec from Amazon that they’re AABB, but it works perfectly with ABAB. So I think I’ve got this part figured out!

 

Maybe note for the documentation (https://www.v1engineering.com/assembly/wiring-the-steppers/): I can’t seem to remember having seen anywhere what the wiring of the steppers should be. Would it be worth adding it to that page? Or is this the kind of thing that should instead belong on the RepRap wiki for instance?

 

Thanks!

 

PS: I’ll rewire all of them and then mark the topic as resolved if there are no other problems.

That is great info but there are no standards. Wire colors and even plugged steppers use different pin positions. 99% of the time they work as is, when it doesn’t nothing gets ruined it just takes some poking around.

Or can you think of a good way to convey this info?

I think if you add a single post page (like the one on reversing the plugs: https://www.v1engineering.com/reversing-the-axis-direction/), this could help a lot (either a newcomer, or someone who didn’t think that this could be the origin of the problem they’re having)

The post could be very much the same:

  • Mention that stepper motors are usually wired either as AABB or ABAB, and that while colors sometimes mean something, they aren't canonical (even though most of the time, black will be ground and red vcc).
  • If the motors are stuttering (which should have caught my attention at the beginning on the process), it probably indicates a that the wiring doesn't match that of the board, in which case the easiest fix is to swap the position of the two middle wires.
If you think that could work, I'm happy to take pictures of AABB, ABAB (I have them right in front of me haha) and upload them.

FWIW, you can tell which wires are part of the same coil. If you disconnect the motor from anything else, and short two of the wires, if the motor gets harder to turn, then those two wires are part of a pair.

I don’t have many steppers, but I’ve never seen an ABAB motor.

Oh yeah, definitely, but then again I haven’t seen specified on the RepRap wiki or on the v1 website that one should also think about the order of the coil wired, so I’m wondering if it would be worth mentioning?

 

Then again, I just have gotten a rip-off board of the Einsy (don’t think so) where the motor plugs where improperly wired?

 

 

Or I guess people can also look in the forum and find the solution in this post :slight_smile:

I don’t know how common it is. I’m all for sharing information that’s helpful, but if it’s 1/10,000, then it might confuse more people than it helps.

The M122 feedback is my favorite part of the SPI drivers. I had a long job fail and I ran M122, and it showed me exactly which coil was broken and if it was open or closed, and I think it tells you if it skipped steps too. That’s pretty helpful.

Got it!

 

For further reference, I guess the conclusion is: if M122 shows that you have open coils and your motors are plugged in, then double check if they have the correct wiring!

I’ve never seen a motor ABAB. Can you confirm its the motor and not the board, and also see if maybe the extension wire is messed up, i.e. is it ABAB at the motor or is the wire crossed?

Oh, this must be the same issue with the import mini rambos as well, why everyone could not get them too work. Either they made them wrong or there is a “funky” file that is leading them to make it wrong. Import Clone trap, interesting?

 

The motor wires are not crossed, so it’s probably the board then. Do you guys have an idea of how I could test it to confirm?

You would have to know which pins on the tmc are for A1,A2 and test continuity. But I dont think you’ll even be able to get a probe to the right pin on a tmc. You could try connecting only the A coil and look at the output of M122. I assume with it wired abab, your M122 is clean, so that’s basically the test.

Yep, the motor was indeed wired ABAB. Definitely an issue with the knock-off board, then.

 

Thanks for the help!

1 Like