Fix X-Axis Movement on Ender-3 Pro 3D Printer

Are the wires plugged in?

Posted by admin on March 28, 2020


One day, the x-axis of my Creality Ender-3 Pro 3D printer started to violently shake and vibrate while moving along the rail.

I fixed this problem by securing a loose wire in the connector to the x-axis motor's endstop.

This endstop mechanism automatically halts movement of the stepper to avoid damaging the 3D printer.

When this endstop mechanism misfires too early, and the 3D printer is continously trying to move the stepper, a violent shaking and juttering of the stepper occurs because the printer is trying to move the stepper forward while the endstop is trying to move it back.

The solution and problem were not immediately obvious to me. I found very little content on the web about how to troubleshoot this stepper shaking symptom. After a couple of failed solution attempts, and after a stroke of luck/inspiration, I was able to resolve the issue and continue to use my Ender-3 Pro.

This article details the steps taken to identify the root cause of the problem and ultimately the solution.


A couple of years ago, I received a Creality Ender-3 Pro 3D printer as a gift. Since then, 3D printing has become a very enjoyable hobby for me.

Although I am just a beginner, I wanted to about a problem I had in order to help my future self and others. I recently experienced a problem with the x-axis movement on my Ender-3 Pro and it took some time to understand the issue and some unexpected help to fix it.


The heavy rattling of the x-axis first occurred when starting a new print. The printer head moved very rapidly back and forth along a very short distance (4 or 5 mm) up and down the x-axis rail of my Ender-3 Pro.

Another way to describe the movement was the printer head was jerking back and forth along the rail.

When I pressed autohome, the printer head made the same heavy rattling sound while it moved along the x-axis. The printer head did eventually return to the origin at the bottom (front) left of the heating bed so I didn't think much of it.

I did, however, realize something was very wrong when I started a new print and the printer head seemed to be stuck between zero and ten mm along the x-axis. It was obvious something was not correct.

The x-axis was binding, jerking violently from left to right. I quickly stopped the print and did an autohome, but the printer head now randomly moved along the axis.

I then disabled the steppers, moved the print head to the middle of the x-axis, but an autohome still exhibited a heavy rattling sound and did not return the print head to the origin.

Initial Thoughts and Bad Assumptions

To put this section into context, I was doing a lot of new and different things with my 3D printer. So I naturally assumed that one of my recent changes was the root cause of the problem.

  • I had attached a RaspberryPi to my 3D printer running OctoPi and OctoLapse.
  • I changed the gcode start and end instructions in my slicer program (Ultimaker Cura) to 3D print timelapse videos.

It seemed obvious that these changes were the cause of the problem, so I started there.

My first instinct was that my changes to the gcode start and end instructions were to blame.

I changed the gcode start block to include the M90 ;aboslute positioning and M83 ;relative extrusion commands which is part of the configuration in setting up OctoLapse.

I thought, "Oh, this makes sense, I've screwed up how my Ender-3 positioning works. No wonder my printer head is broken".

Working backwards, I disconnected the RaspberryPi and did a factory reset of my Ender-3 Pro 3D printer, but this did not help.

I tried printing the original model test print that came with the Ender-3 and the x-axis movement was still broken.

Worried that I had permanently damaged my printer, I was about to give up and look into replacing it when I considered the possibility that my initial assumption about the root cause might be wrong.

But I had no idea what else it could be.

Turns out that my assumptions were wrong and it was pure coincidence that the violent shaking started at the same time I made these changes.

Small Bundle of Inspiration

My kid was young when I encountered this issue with the x-axis of my Ender-3 Pro 3D printer.

They, like daddy, love understanding how things work, and is fascinated by this 3D printer. Any chance my kid would get, they'd ask to go see and turn on the 3D printer just to watch it move.

They would also say, "3D Printer...make go".

When this axis movement problem started (but before I fixed it), I had to tell my kid that the printer was broken and we couldn't turn it on. I also had to tell them that daddy didn't know how to fix it. Still though, they persisted with asking to "make go" the printer.

After a short back and forth, I gave in and decided to demonstrate that the printer was indeed broken. My kid was excited to see they won the argument as I switched the printer on to make it go but was thoroughly startled by the heavy rattling sound of the broken x-axis movement when I did an autohome.

So to avoid scaring them, I decided to stop the autohome and manually move the axis using the control panel of the printer, just so they could see that I did "make go" the printer.

Why am I telling you this story?

It turns out that when I would manually step the printer head, the x-axis stick, bind and not move correctly. This drew my attention to the fact that the issue might be mechanical instead related to firmware or gcode changes.

This lead to a few different web searches that ultimtaely described how the endstop mechanism in a 3D printer can breakdown if a wire comes loose, which happened to be my problem.

If it weren't for my kid, I may never have realized my Ender-3 Pro 3D printer had a simple wiring problem with it's x-axis endstop sensor.


But before my kid and I had this moment of inspiration, I tried a couple of other different things thinking I must've screwed something up. The two 3D printer modifications I made were 1) connecting a RaspberryPi running OctoPrint/Octolapse for cpaturing timelapse videos; and 2) modifying the start gcode of my Cura slicing software to work better with OctoLapse.

Honestly, there was no doubt in my mind that the root cause was the start gcode change I made, because the specific change was to add a gcode statement to declare absolute positioning of the printer head and relative positioning of the extruder nozzle. If you're unfamiliar with these, let me explain.

The Ender-3 Pro (and numerous other) 3D printers work by processing a series of commands written in a language called G-Code which is a computer numerical control (CNC) programming language variant for controlling 3D printers. When printing something with a 3D printer, the process is generally as follows:

  1. obtain a 3d model is some format, stuch as a .stl format file
  2. run that .stl model through a computer program called a "slicer" which will turn that .stl model into a series of G-Code commands to create the model one layer at a time
  3. take the produced (or "sliced") file (.gcode) and upload it or send it to the printer for printing
  4. the 3D printer follows the .gcode file, command by command to print your 3D model

The slicer program is responsible for producing the set of G-Code statements that the 3D printer follows to print the actual widget from the model. I use a free product by Ultimaker called Cura, which handles slicing my 3D models and preparing them to print on my Ender-3 Pro 3D printer. Part of my initial setup of the 3D printer was to configure a "machine profile" in Cura for my Ender-3 printer. This machine profile allows Cura to produce .gcode file for my Ender-3 which results in a higher quality print.

Starting with the printer modifications I made, I tried to isolate the root cause.

Attempted Solution #1

After I installed OctoPrint software and OctoLapse plugin on the RaspberryPi, the next step was to configure OctoLapse to match the settings in the Cura slicing software. The reason for this is because OctoLapse monitors gcode command execution to determine when to start taking timelapse snapshots. Then during the printing process, OctoLapse will inject gcode commands to move the printer head to a specific location, wait for it to stop, snap a picture, return it to the previous location and then continue printing the next layer. In order to do this effectively, OctoLapse needs to closely match your slicer settings and also requires your slicer settings to issue explicit commands it can use as a signal. By default, OctoLapse expects your .gcode file to issue a G90 ;absolute coordinates command so OctoLapse knows when to start taking time lapse photos.

Given that my Ender-3 Pro had an x-axis problem, I figured it was because the coordinate system was corrupted. So I changed the slicer program back to its original values and tried printing again.

To my surprise, the x-axis problem continued, so my next thought was that I permanently corrupted my printer's axis calibration.

Attempted Solution #2

Thinking that I had corrupted my Ender-3 Pro printer settings, I set out to restore the factory defaults. This was less straightforward than I expected, but did find an option for Restore failsafe which, according to a few Reddit posts was how I should restore defaults. I did this restore failsafe. I then tried to print a known good print model and still the x-axis strongly vibrated.

I turned the printer off, unplugged for five (5) minutes (recommended in a few posts on reddit) and turned back on. The x-axis still vibrated.

Attempted Solution #3 (sort of)

At this point, I started down the path to putting the latest firmware version onto my Ender-3 Pro just to see if that fixed it. I also started looking at the cost of replacing the machine which I, subconsciously, knew was crazy, so I really just shut down the printer and walked away for several days. I didn't want to proceed with flashing the firmware or purchasing a new printer, so really I was just avoiding the problem because I was out of ideas.


If you are not familar with the story of Archimedes and the Golden Crown, I recommend looking it up as it is relevent to my story here. A quick synopsis is that the Greek mathematician Archimedes was tasked by the king to determine if a gold crown he received as a gift was made of pure gold. The only condition is that Archimedes cannot melt or cut the crown. Archimedes agonized over the problem for so long that his wife yelled at him to take a bath and forget about the problem. Concentrated in thought about the problem as the tub filled nearly full with water, Archimedes strikes the problem from his thoughts and he drops himself into the bath which overflowed with water displaced by his body. It was at this moment, forgeting about the problem, that Archimedes jumps up shouting Eureka! having solved his problem.

The point of the story is that there is value in forgetting about a problem and focusing on something else to give your subconscious time to work on it.

In a similar manner, I had given up on the problem of the x-axis vibration and chose to play with my kid, who really wanted to play with the 3D printer asking me to turn it on, but I said I could not because it was broken. They started crying and shouting to turn it on, so I decided to quickly show them how it was broken. And rather than starting a model print, I simply used the LCD screen to manually move the stepper axis' and when I went to move the x-axis, I was shocked to see that the x-axis shook violently when increasing or decreasing the x value. This was my Eureka moment that the problem may be physical rather than software.

Problem Solved

After a little bit of searching on the internet, I found a few posts describing that the jerking vibration of an axis may be due to a bad connector to the axis' endstop mechanism causing the printer to continuously think that the stepper had reached the end of the rail.

Sure enough, I pulled out the connector on the x-axis endstop and noticed that one of the terminal probes had dislodged from the end cap and was likely not correctly seated to the stepper. I reseated the wire in the connector and reconnected to the x-axis, after which I was able to successfully move the x-axis without issue.

With the help of my kid, I successfully fixed the violent shaking of the x-axis not moving correctly on my Ender-3 Pro.

If you found value in this post, consider following me on X @davidpuplava for more valuable information about Game Dev, OrchardCore, C#/.NET and other topics.