Z-axis encoder connection diagnosis

I’ve been making the first few cuts with my new build and am running into some issues with the z-axis apparently losing encoder feedback and driving the z-axis to the extent of it’s travel.

Details of my build:

  • Latest EastBaySource kit (1.5b control board)
  • Meticulous-style z-axis setup - currently just hacked together with bits of scrap ply, I’m working towards cutting a less janky version of the sled
  • Cheap air-cooled Chinese “spindle” (link)
  • Using the EBS firmware and EBS distributed version of GroundControl.

Everything works fine when just moving the sled around the board and manually positioning the z-axis from GroundControl. When I run the spindle and start making some cuts it will work for a while, then at some point GroundControl will lose track of the z-position - it continues reading a steady value while it drives the z-axis up or down, until I hit the emergency stop.

The 2 likely culprits seem to be:

  • A poor connection on the z-axis motor, triggered by vibration from the spindle. Disconnecting and reconnecting the cable at the sled does seem to rectify the issue which makes this seem likely. I’ve tried pulling the individual pins from the connector and pinching them slightly to tighten up the connection, without any lasting success.
  • Electrical noise from the spindle interfering with the encoder - I’ve read that excessive noise can be an issue with these spindles. I’m not sure where I’d begin to tackle this one, the cabling isn’t currently running particularly closely together, but… shielding? Power filters? Ferrite beads? I only vaguely understand that side of things.

It’s worth noting I have popped the encoder cap off the motor and everything looks to be intact under there. I’ve wondered whether the connector on the encoder board itself might have a bad solder joint, such that the movement of connection generally makes it good again, but I’m not sure how to get to the underside of that PCB to inspect it.

Any thoughts what my next step should be? How best to narrow down the possibilities? I have a few days to think about it while I wait on a replacement for the motor coupler I damaged today.

1 Like

Have you zip tied the cable at the sled to something to strain relieve any pull from the sled movement? The most likely culprit is the poor connection at the z motor. The encoder pulses a certain number of times per rotation of the motor shaft and the system just counts those pulses to know the mill height. If the encoder loses connection, the motor will continue to spin, but the controller gets no step feedback to count saying it is moving, so it will keep going until it gets enough steps to stop or it hits the end stop or limit.

This is my bet. Electrical noise tends to make the z-axis position move when the motor isn’t actually turning which is sort of the opposite of what you are seeing. You are seeing the signal not getting to the controller which I bet is a connection issue.

Have you zip tied the cable at the sled to something to strain relieve any pull from the sled movement?

I have done this, but only after I first encountered the problem - it was part of my first round of troubleshooting. I’m increasingly thinking I might have damaged the PCB connection by running it with the cable hanging off it for a while.

I don’t have my parts in yet, but considering next steps - I’m still suspicious of the encoder PCB, since the plug itself seems to seat pretty firmly.

Any thoughts on whether removing the encoder PCB is a reasonable option? Would it perhaps be a better idea to try to reflow the joints by heating the pins directly?

I wouldn’t be afraid to resolder the pins, but I’d be very careful about not messing with anything else. Verify that nothing on that encoder is mechanically damaged if you are inspecting it.

1 Like

I’m still fighting this problem. Unplugging and re-plugging at the z-axis always makes it spring back to life, so in an attempt to narrow down the connection issue I dug out a multi-meter and had a probe around on the encoder board. Helpfully, there is an unpopulated sensor footprint that gives a probe point for 3 of the wires of interest - here’s what I found:

So then I ran the machine until the z-axis stopped working again, turned off the spindle, and verified that the z-axis was still moving without reporting position with a manual request. Then I pulled the plug at the shield end, being careful not to disturb the connection at the z-axis motor. Theory being that I could thus determine which of these wires no longer had a good connection by checking continuity.

But… they all had good continuity with minimal resistance. And when I plugged the cable back in at the shield, it again came back to life. As far as I can tell, breaking and re-making the connection temporarily fixes the issue, but the connection itself seems to be fine.

Is there any known failure mode for the sensors where power-cycling them would make them work again? It does seem to me that the failure seems to occur when there is some load on the spindle/axis, vibration-related perhaps, or related to current draw to the z-axis motor?

Not that I can think of. That is super strange.

Is it possible that unplugging it and re-plugging it is just giving us a new and good connection?

just a thought, but to check your vibration making the connection come loose theory, you can slap some hot glue onto the plugs to holt them in place (very much like I have seen on my 3d printer boards). It is relatively cheap, and if you still have the problem, you could just pull the hot glue off and keep on truckin’!

Again, just a thought!

1 Like

no, the sensors are pretty trival optical or magnetic sensors, no brains to get

Some progress today. It failed again a couple of times and I made sure to be very methodical about checking things. First step was to turn off the spindle but leave everything else in place for 10 minutes. After that the encoder was still not responding, which I would theorize rules out temperature-related connection issues.

Then, without unplugging anything, and with the aid of my dear wife, I checked continuity on the 4 relevant wires between the points illustrated on the encoder PCB in the post above and the back of the connector on the shield - indicated here in red:

Continuity seemed good, and I then re-checked and verified that the encoder was still not reporting movement. Then, leaving all other connections alone and leaving the shield powered up, I unplugged the USB connection to my control computer, waited a short time and re-plugged it, at which point the encoder came good again.

If we accept that nothing at the encoder itself has any saved state that could be reset by a power cycle, then I suppose the reset must be happening at the controller/shield, but it’s curious then that it responds equally well to re-plugging the encoder as it does to a power cycle.

I ran the machine through a long routine (2.5 hours!) with the spindle off as a sanity check at this point, and it ran without any fault - much longer than anything I’ve seen when making actual cuts.

The last thing I tried was I think the most indicative, which was to turn the spindle on, no tooling attached, and then run the z-axis up and down on the spot while pulsing the speed control for the spindle. This did trigger the issue pretty reliably, despite the vibration being fairly minimal.

My working theory is that what I’m seeing is power supply noise playing havoc with the control electronics. Unfortunately I only have a single power circuit in the garage, so I’ll have to look at filtering options rather than simply isolating it. Any suggestions gratefully received.

Sorry for the long-winded update, I feel a bit like a war correspondent! Maybe it will be of use to someone.


Happy to hear that you have been able to trace down the issue. Something I’ve seen here on the forum about noise from the router/spindle is to ensure you power cables are running separated from the Z-axis cable. Some like to keep it nice and tidy and run them down to the sled together, which in turn, introduces noise into the Z cable. not sure if this is your set up, but keeping them as far from each other as possible may help on this.

I run my Z-cable from the top of the machine, while I have the power cord for my router running to the bottom and underneath. I have a power strip attached to the bottom 2x4 so there is plenty of room for the cord to reach all points of the work area.

Just a thought for you.

Nice technique for tracking it down. And thanks for the update :grinning: I don’t have much in the way of helpful ideas, but I’m enjoying following along.

I think that the evidence saying the issue is in the controller and probably related to electrical noise seems convincing…but how that could be happening I have no idea. That the other two motors are still working means the firmware is running. Why it would stop reading pulses from only the z-axis is a mystery to me.

We’re sorry for this issue. Let’s see if we can help :slight_smile:

From what i can read from your troubleshooting, the spindle may very well be the source of this issue.

  • 100v DC brushed 12.000 rpm spindle = Lots of EMI

Knowing the z-motor is failing due to not reporting position and only while the spindle is on, suggests that spindle EMF interference could be somehow messing with the encoder pulses. (Interference can make a controller to miscount or lose track of the encoder).

The z-motor is also the only one close enough to the spindle to be affected from its EMI - this might explain why it’s the only one failing (EMI present near the controller would be messing with all three motors instead just one)

Try shielding the wires and grounding it

If this doesn’t help, please let us know - will mail you a new z-motor (a bad capacitor in the encoder board could make it more susceptible to emi)


I think I can declare this problem solved! I went and bought a basic powerboard-style UPS, thinking that if it didn’t resolve the issue it would be a worthwhile thing to have around anyhow. With the controller and my laptop plugged into the UPS and the spindle plugged into a regular outlet, the Maslow has run for 5 hours now without any repeat of the issue.

Thanks Roy. The only reason I didn’t contact you directly before posting is that I had my suspicions about the spindle - and as it turns out all the hardware you supplied is working fine. I agree that shielding the z-axis controller wiring would be a worthwhile upgrade to prevent future troubles. I have only good things to say about EBS.

Thanks to everyone for their input, really helped clarify my thinking and stopped me chasing my tail too much.


Fantastic news! Nice solution :grinning: