# HobbyCNC microstepping problem



## ZeptoBit (Feb 15, 2015)

I'm setting up my Taig mill using a HobbyCNC pro chopper driver and 23HS30-3006D steppers, 39V 11A PSU, LinuxCNC.

At first I thought it ran fine using 1/4 step, but then I checked the motion with a dial indicator and noticed that the motion was not smooth. I know the size of the microsteps will never be exactly the same, but this is much larger.

I did some testting and got these results:
Full step: move
1/2 step: move - stop
1/4 step: move - move - stop - stop
1/8 step: move - stop*7
1/16 step: move - stop*15

So regardless of the numbers of microstep set the stepper moves only once or twice per full step, resulting in correct motion only for full stepping. The result was the same for all 3 axis. For each microstep where there is no motion I can still hear the sound of the stepper changing. Current limit is set to 3A and I have disabled idle current reduction.

I don't think this can be caused by wirering the steppers incorrectly, as full stepping should not work either in that case.
I don't think it can be the motors, as I don't see how a faulty motor could produce these symptoms, and it in any case it should affect only one axis.
I don't think it's missing step pulses from the PC, as the pitch of the sound from the microstepper changes for each microstep even when there is no motion.
A faulty driver chip would be my first guess if it was only one axis, but all 3 seems very unlikely.

Anyone know what might be wrong?


Emil


----------



## bladehunter (Feb 15, 2015)

Does varying the feed rate have any effect ?
Are all your mechanical connections ok ?
Are the gibs too tight ?
I'd be looking at the pulse length to begin with, then I'd look at the speed\acceleration. Being a Mach 3 user this is what I'd check for.

If the board has been built from a kit I'd also check the construction. The board appears to be rated at 36V max not 39V (or is that a typo).

It may also be an idea testing a stepper whilst not connected to the machine, issue movement commands that should give you a full revolution,half or quarter with the required movement commands.

My apologies if you have tried any or all of these suggestions.


----------



## ZeptoBit (Feb 15, 2015)

bladehunter said:


> Does varying the feed rate have any effect ?
> Are all your mechanical connections ok ?
> Are the gibs too tight ?
> I'd be looking at the pulse length to begin with, then I'd look at the speed\acceleration. Being a Mach 3 user this is what I'd check for.
> ...




Thank you for your reply.

I don't think it's a mechanical problem, because then I would expect it to move erratically or stall, not move in a completely repeatable pattern like described in my first post. My descripton of the result may have been unclear/misleading: When I wrote "stop" I meant that it didn't move on that microstep, not that it stalled.

The board it rated for 42V. My power supply is nominally 36V, but adjustable +/-10%. I set it to 39V. 

The LinuxCNC stepper wizard set the pulse width automatically when I selected the board I'm using. I will check if the values used are correct.

You could be right about it being a construction error. I built this board many years ago and used it on another machine, so I assumed it to be working, but this problem is subtle enough that I may have missed it.

When looking at the steps I just used a dial indicator and jogging one step/half step/micro step at a time. So effects of acceleration and feed rates have been removed from the test.

The motors does give the expected movement when connected to the mill, as long as I use full stepping or using micro steps if the motion before reversing direction is a number of microsteps which adds up to a full step.


Emil


----------



## bladehunter (Feb 15, 2015)

Sounds like you maybe describing a backlash issue.


----------



## MarkStephen (Feb 15, 2015)

I'm a complete noob to LinuxCNC but I will ask, are your steps per revolution matching your microstepping settings on the driver? If you have your steps per revolution set at 200 and your board is set to 1/16 microstepping a 1.8* motor (3200 steps per revolution) your going to have problems.


----------



## ZeptoBit (Feb 15, 2015)

bladehunter said:


> Sounds like you maybe describing a backlash issue.



There is some backlash on the X and Y axis, ~40-50µm which I have not tried to do anything about yet.

But this is different.
For example if I jog the machine in one direction one 1/4 step  at a time it will be like this:
1: Moves 1/4 step.
2: Moves 1/4 step.
3: No motion (but stepper sound changes)
4: No motion (but stepper sound changes)
Then this patter repeats consistently as I keep joging the mill.


Emil


----------



## ZeptoBit (Feb 15, 2015)

MarkStephen said:


> I'm a complete noob to LinuxCNC but I will ask, are your steps per revolution matching your microstepping settings on the driver? If you have your steps per revolution set at 200 and your board is set to 1/16 microstepping a 1.8* motor (3200 steps per revolution) your going to have problems.



I have set the step size correctly. If this setting was wrong it would be a problem as the machine would move slower/shorter or farther/faster than expected. (And in the last case, possibly stall.) 


Emil


----------



## JimDawson (Feb 15, 2015)

Assuming the chips are OK, it is starting to sound like a wiring issue.  I could not find good documentation on the board, but the key seems to be that the White and Yellow wires are connected to their respective common.  I haven't worked with a uni-polar 6 wire stepper, but I know the phase relationships must be correct.  Just by logical inference, miss-wiring might exhibit the symptoms you describe.


----------



## ZeptoBit (Feb 15, 2015)

JimDawson said:


> Assuming the chips are OK, it is starting to sound like a wiring issue.  I could not find good documentation on the board, but the key seems to be that the White and Yellow wires are connected to their respective common.  I haven't worked with a uni-polar 6 wire stepper, but I know the phase relationships must be correct.  Just by logical inference, miss-wiring might exhibit the symptoms you describe.



The two common wires are not connected together in the stepper. There's seperate terminals on the board for the two common wires but they are connected together on the board.

I have checked the wirering (a few times) and I think it is correct. I don't think the stepper would run correctly when full stepping either if the wirering was wrong? 

I will check my wirering again, maybe I missed something.


Emil


----------



## bladehunter (Feb 15, 2015)

ZeptoBit said:


> There is some backlash on the X and Y axis, ~40-50µm which I have not tried to do anything about yet.
> 
> But this is different.
> For example if I jog the machine in one direction one 1/4 step  at a time it will be like this:
> ...



Damn what class ballscrews are you using ?


----------



## ZeptoBit (Feb 15, 2015)

bladehunter said:


> Damn what class ballscrews are you using ?



No ballscrews. Stock leadscrews. Don't think 0.04 mm is ballscrew quality?


----------



## bladehunter (Feb 15, 2015)

Sorry had a brain fart on the backlash.

Ok so lets suss this ok.

Steppers off mill you get full movement, no "missed steps" or anything like that ?
IF THAT TEST FAILS: That would indicate an electrical or stepper issue.

IF THAT TEST PASSES: I would postulate you have a mechanical issue

Gibs are too tight.  

If the leadscrew nuts have adjustment they are too tight.
There is end play in the bearings, which would be rare on all 3 axis.
Backlash is an issue, after a quick search 0.003" or 0.0762mm seems typical backlash for a Taig mill. 0.040mm - 0.050mm appears to be quite a 
bit on the low side.
I would also test with backlash comp turned on and see if that makes a difference.

On my mill I running ballscrews with a 5mm pitch, with 1.9' stepper and 1/8 microstepping I get 0.003125mm per step. Now from memory my backlash is about 0.015mm so without backlash comp on I'd get 4.8 turns before any movement when reversing direction. Yep I know I can get better with a double nut or oversize balls but I'm happy with the way my parts are coming out. 

I had a real issue with mine to begin with that had me stumped for a bit, which turned out the lock nuts supplied weren't the best quality, changing to a better locknut fixed the issue.


----------



## Boswell (Feb 15, 2015)

You could remove a stepper but leave it electrically connected and then see if you have the same problem when it does not have to move a load. This should be a definitive isolation between Electrical and Mechanical.


----------



## bladehunter (Feb 15, 2015)

Boswell said:


> You could remove a stepper but leave it electrically connected and then see if you have the same problem when it does not have to move a load. This should be a definitive isolation between Electrical and Mechanical.



That's exactly what I have suggested.


----------



## Boswell (Feb 15, 2015)

bladehunter said:


> That's exactly what I have suggested.


Yep, sorry about that. misread your post.


----------



## bladehunter (Feb 15, 2015)

Boswell said:


> Yep, sorry about that. misread your post.


No probs Big fella, all's good.


----------



## ZeptoBit (Feb 16, 2015)

bladehunter said:


> Ok so lets suss this ok.
> 
> Steppers off mill you get full movement, no "missed steps" or anything like that ?
> IF THAT TEST FAILS: That would indicate an electrical or stepper issue.
> ...



I will remove a stepper from the mill and test it after work today today to eliminate any mechanical effects as you suggest. I'll look at backlash and other mechanical issues only after geting the steppers to run well.


Emil


----------



## ZeptoBit (Feb 17, 2015)

I removed on of the steppers from the mill and testet it. The results match what I observed with the stepper on the mill, but the problem is a lot easier to see.

When using 4 microsteps it will run like this for each microstep I jog it:
Step CCW (medium size)
Step CCW (large)
Step CW (small)
Step CW (small)
This sequence then repeats consistently when I keep stepping.

Looks like a wirering problem, but I don't think it is. I have measeured the resistance between the stepper wires to verify that the wire colors from the datasheet are correct. I have tried every wirering combination which makes sense, with the same result in each case.

I didn't have time to measure the voltage each phase is geting last night, but I will do that today. 


Emil


----------



## bladehunter (Feb 17, 2015)

You haven't got your step & direction pins mixed up in Mach 3 config.


----------



## ZeptoBit (Feb 17, 2015)

bladehunter said:


> You haven't got your step & direction pins mixed up in Mach 3 config.



Good sugestion. Had to check that.

Got this in LinuxCNC:
Pin 2: X direction
Pin 3: X step
Pin 4: Y direction
Pin 5: Y step
Pin 6: Z direction
Pin 7: Z step

It matches the pinout in the HopbbyCNC manual, so that is not the problem.


----------



## bladehunter (Feb 17, 2015)

So you'd connect the stepper like this:
a:* Black*
COM: *Yellow*
A:* Green*

b: *Red*
COM: *White*
B: *Blue*

And you're sure there's no Trolls, Evil Spirits or Gremlins in the board ?*  *(This is all I can think of)


----------



## Boswell (Feb 17, 2015)

Check to see if all the steppers do the same thing or if the problem is unique to the one that you removed for testing ?


----------



## ZeptoBit (Feb 17, 2015)

bladehunter said:


> So you'd connect the stepper like this:
> a:* Black*
> COM: *Yellow*
> A:* Green*
> ...



Wirering: As you descibed.
Evils spirits etc: failed to make reliable measurement


----------



## ZeptoBit (Feb 17, 2015)

Boswell said:


> Check to see if all the steppers do the same thing or if the problem is unique to the one that you removed for testing ?



They all do the same thing on the mill, not removed the other two motors to test separately.


----------



## Boswell (Feb 17, 2015)

Sounds like it is time to get with the company that made the stepper controller. Possibly a controller bug ?


----------



## bladehunter (Feb 18, 2015)

Have you tried the cnczone forums or the hobbycnc yahoo group ?


----------



## ZeptoBit (Feb 18, 2015)

I posted a question to the HobbyCNC yahoo group yesterday, no reply so far. I'v not tried cnczone yet.


----------



## ZeptoBit (Feb 23, 2015)

I'v still not solved the driver problem, but I got my mill running using 3 MA860H drivers which I was planning to use for another project. 

I've not given up fixing the HobbyCNC board, but if I do I will use it for something else. It's just to much work to take out the drivers and rewire everything.

I'm still tweaking things, but I have milled some parts and I'm very happy with the performance of the Taig mill.


----------



## stupoty (Feb 23, 2015)

Edit due to me not seing your latest post 

Being unipolor motors (5/6 wire type) the torque is going to vary at different steps when half stepping etc.

Have you got an osciloscope so you can view the coil voltages and shape?

Stuart


----------



## compsurge (Feb 24, 2015)

What is the kernel speed? I don't have LinuxCNC up in front of me right now and don't remember how it's calculated.

I've been pleasantly surprised with the Taig. It has a lot more capability than I was expecting. I have access to it as part of a high school robotics team I mentor and it has really helped me understand how the hobby-grade CNC systems work and has helped put a boot in my rear to finish my conversion (at least once it gets above 45 degrees in the garage).

I had all sorts of issues with the eBay TB6560 board. I eventually traced them to the pulse per inch being incorrect. For some reason one axis was set at 1/8 microstepping and the rest at 1/16. The 1/8 axis was also set with 64000 pulses per inch (as opposed to 16000) and somehow worked properly for a year or so. Granted, this machine was also set up with Mach at 4ipm rapids. Needless to say, I did some tweaking and the board works well now.

Does your current board work well without microstepping? You may not need it. I've been running a Taig that initially was set up for 1/16 microstepping and had all sorts of speed and torque issues (1/16 microstepping could result in the motors with as little as 10% of rated torque). I turned off microstepping and have had good results. Here is with 2D adaptive clearing in a plastic sheet with a 2 flute HSS, 10k rpm, 0.125" DoC, 36 ipm. 2D adaptive clearing wasn't the best strategy timewise for this (all of those jogs were painful), but I'm still new at this.

Also, one thing to note: how is the grounding of the machine? I noticed any large static charge on the machine will trip the "Reset (E-stop)" on Mach. This can cause all sort of issues. I am going to investigate bonding all of the electrical system grounds together (power supply, control board, mill) to see if this is a potential issue.


----------



## ZeptoBit (Feb 25, 2015)

stupoty said:


> Edit due to me not seing your latest post
> Have you got an osciloscope so you can view the coil voltages and shape?



I have a two channel DSO. A bit tricky measuring 4 voltages with 2ch, but I did not see the waveform I would have expected. When I get around to fixing this board I will check again, hopefully I can get hold of a 4 channel scope.


----------



## ZeptoBit (Feb 25, 2015)

compsurge said:


> What is the kernel speed? I don't have LinuxCNC up in front of me right now and don't remember how it's calculated.
> 
> I've been pleasantly surprised with the Taig. It has a lot more capability than I was expecting. I have access to it as part of a high school robotics team I mentor and it has really helped me understand how the hobby-grade CNC systems work and has helped put a boot in my rear to finish my conversion (at least once it gets above 45 degrees in the garage).
> 
> ...



I was surprised too, I can take larger cuts than I was expecting and the surface finish is excellent. So far I'v milled aluminum, steel and styrofoam. All looks great.

I see no advantage to more than 4 microsteps on this machine. I'm using 1/4 step now, I was considering 1/2 step which I think would be fine too. I'm a bit worried about using fullsteps for a few reasons: Surface finish. Breaking very small drill bits if Z-axis feed is jerky. Some loss of resolution compared to 1/2 steps. Possibly more resonance/vibration/noise compared to 1/2 steping.

Not sure about the kernel speed, I'm at work now, but I can check it when I get home. The maximum jitter was 36000ns. I don't think the problem is related to this as it runs fine with the MA860H drivers and the problem with the HobbyCNC board was the same even when moving one microstep at a time with several seconds between each microstep.

The HobbyCNC board worked with full stepping in the sense that it steped and the steps where the correct size. But it was a lot more noisy and the full steps seemed very rough. Half stepping did not work.

The case for the electronics is connected to earth ground directly form the power cable. The power supply negative terminal is also connected to earth ground. The gnd pins of the parallel cable are connected to earth ground trough the PC. The case of the spindle motor is connected to ground as well, so the structure of the mill should be grounded, but I have not measured the resistance. I should have a look at how I connected the ground to make sure I don't have any ground loops.


----------

