Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: davidcomputersinc on January 28, 2020, 06:37:56 PM

Title: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on January 28, 2020, 06:37:56 PM
I just built my CNC.  I used
Nema 23 Stepper Motors 270 Oz.
TB 6560 MD 430 motor controllers
and a parallel 5 axis CNC breakout board not sure if there is even a model number.
Amazon description:
4 Axis Nema23 Stepper Motor 270oz-in 76mm 3A Dual Shaft+TB6560 MD430 Driver CNC Controller Kit for CNC Router Engraving Milling Machine

I can move all axis's around in Mach3 using the arrow and Pageup/down keys and they move fine.  When I go to run a test Gcode or calibrate the motors under "Settings" "Set Steps per Unit" the motors will just make noise and not really move the axis but stutter a bit.  I purchased a new USB breakout board but could not get the motors to move with that board at all. As a test, I wired only one axis motor with new wiring and did not put it near any other wiring and had the same result.  I was trying to rule out interference.  I am using Windows 7, 8 gig ram.  I have not tried a different computer as I only have one with a parallel port.
Looking for any suggestions you may have. 
Thank you
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: joeaverage on January 28, 2020, 07:08:08 PM
Hi,
that sounds like Machs parallel port not getting CPU service.

Machs parallel port is not the same as Mach3, the Windows application. The Windows application sends numeric trajectory
data to the motion controller, in the case Machs parallel port. This chunk of code lives in the kernel and almost has to shove
the Windows kernel aside to run properly. It takes that numeric data and generates the required pulse streams and transmits them
to the outside world on the parallel printer port.

Any software or services that run on the PC compete with Machs parallel port. The advice is shut everything BUT Mach down
when running. Note also that some computers just don't ever run Machs parallel port well while another PC of the same spec
does a great job.....and no rhyme nor reason.

If you get discouraged trying to get Machs parallel port to work get an external motion controller like an Ethernet SmoothStepper
or a UC300. DO NOT BE TEMPTED BY CHEAP CHINESE CONTROLLERS, they just don't work like they should.

An external motion controller takes over the roll of generating pulse streams from numeric trajectory data. Therefore the PC
is relieved of that duty and therefore just about any PC (desktop/laptop/Windows7,8,10/ 32 bit or 64 bit) will run Mach just fine.

Craig
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on January 28, 2020, 09:56:45 PM
Thank you for your quick and thorough response. As I understand you, I should try a different computer, or perhaps put a fresh load of Windows on this one to make sure it is dedicating as much processing power as possible to Mach3.  When that doesn't work I should buy a good quality external motion controller and put it between the machine and breakout board to relieve the computer from doing so much work.  Lastly, next time I build something I should spend some money to get good quality equipment to start with.
Again, thank you for your help.  It will be a week or two but I will report back with my findings.
Have a good day.
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: joeaverage on January 29, 2020, 12:42:27 AM
Hi,

Quote
As I understand you, I should try a different computer

Yes, if you can beg, borrow or steal another desktop PC with Windows 7 32 bit or earlier, or even buy one if its real cheap.

My original PC started giving me grief so I bought a MiniITX single board PC with a low power dual core Atom with 4G RAM.
It has one built in parallel port and I added another with a PCI card. That gave me two parallel ports and I ran Mach3 like that
for two years...and it went well PROVIDED you didn't do anything silly and especially run other software or services on it.
I loaded Windows 7 Embedded (Standard) 32 bit. Embedded is very much like Windows 7 retail but you can chose not to load certain code,
for instance I did not load a browser, any anti-virus/malware code, nor a firewall, nor any multimedia crap that I don't need.

More recently I bought an Ethernet SmoothStepper (ESS) and upgraded to Mach4 but using the same gutless-little-wonder PC
and it runs fine. In fact it runs SO MUCH BETTER than the parallel ports ever did, without stuttering, stalling and all the other
bulls*********t that you have put up with and a parallel port. I would have to commend the ESS, and have been informed that other
external controller like the UC300 and 57CNC work equally well. All of these devices are in the range $150-$200, so would be
cheaper than a new PC.

Craig
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on February 02, 2020, 02:23:59 PM
Thank you Craig
I got a different computer and put a fresh load of Windows 7 32 bit on it.  For everyone else, 64 bit did not work.  My motors run a lot smoother.  I can calibrate, and even drew a circle.  However, if I set "home" for the axis I am calibrating, calibrate it at 10", put in 10" as the distance it has moved, then hit "go home" it rarely ends up in the same spot.  It will be off about 1/16 - 1/8 of an inch.  I continue to do the same and always enter 10" and it continues to get off more each time.    I am playing with the backlash settings but have not been able to resolve the issue yet.  It does this for all three axis.  I will continue to work with it and let you know what happens.  Thanks again for your help.
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: ZASto on February 02, 2020, 04:30:32 PM
64-bit OS is no good with parallel port.
Driver for PP that Art wrote works only on 32-bit systems.

As Craig wrote zillion times external controllers are only way to go on 64-bit systems. And, of course, not some Chinese knock-offs.
Even Russian PLCM-E3 works correctly (if you can find plugin for Mach3 :) )
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: joeaverage on February 02, 2020, 09:10:53 PM
Hi,

Quote
It will be off about 1/16 - 1/8 of an inch.  I continue to do the same and always enter 10" and it continues to get off more each time.

Sounds like your steppers are missing steps. Try tuning them to half their current speed and acceleration and try again.

Quote
I am playing with the backlash settings but have not been able to resolve the issue yet.

Disable and/or set the backlash settings to zero and leave them there. They are just confusing you. You need to be able to
MDI 10 inches the the left and then 10 inches to the right and come back to the same location within the bcaklash of the machine,
which should be minimal.

If the backlash of your machine is 1/16 to 1/8 inch then fix your machine. Expecting software to overcome that sort of lash is a fools dream.

Craig
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on February 07, 2020, 06:19:26 PM
Good day,

I have slowed everything down to a crawl and have the same issue.  Do you think purchasing a Ethernet SmoothStepper would solve the issue?  Perhaps this is still a computer issue?
Thanks
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on February 07, 2020, 06:46:25 PM
I have also worked with the settings for Amps. torque and steps.  Thanks
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: joeaverage on February 07, 2020, 07:44:48 PM
Hi,

Quote
Perhaps this is still a computer issue?

I believe you are correct. That you have tried two different PC's with the same result rather shakes my
confidence in that conclusion however.

What most people don't realise is that Mach3 is really in two parts.

The first part is a Windows application. It is a GUI, Gcode interpreter and trajectory planner. It will run on just about any PC,
32 bit, 64 bit, laptop, XP through to Windows 10. Its not a difficult program to run at all.

The second part is Mach's parallel port engine. It takes numeric trajectory data (from the first part) an converts that into
pulse streams. It uses interrupt driven timers to do so. Windows however makes VERY extensive use of the interrupt system for
its own purposes. As a result Mach's parallel port struggles to get CPU service and has to almost 'shoulder Windows out of the way'.

That Mach's parallel port runs at all came as a huge surprise to many programmers, and to my knowledge no-one other than
Art Fennerty was ever able to get it to work.

Some of the consequences of that history is that Mach's parallel port engine is VERY VERY sensitive to the hardware of the PC
on which it is to run and also very sensitive to other software and/or services installed on it. Certain operations cause Mach's parallel port
to stutter and stall, screen refreshes particularly. For this reason you are recommended to run a good video card so that screen refreshes
don't interfere with the smooth running of Mach's parallel port.

That you have tried two PC's and neither run the parallel port properly could just be bad luck. There used to be a list of things that you could
do to your PC to help, although I have not seen that list for some years.

The other alternative is an external motion controller like an ESS. I have one and have used it with Mach4 for five years, its great.
While I never had a great deal of trouble with Mach3 and Mach's parallel port I found that when I switched to the ESS that the smoother
and stutter free motion allowed me to run my stepper 33% faster without losing steps and my machine never stutters. To be honest I
think anyone trying to run Mach3 on a parallel port is being foolish. An ESS is not much more than a good stepper and driver....can anyone
seriously use the excuse 'an ESS costs too much'?

Quote
I have also worked with the settings for Amps. torque and steps.  Thanks

Don't bother with all that. Set the current to the rated current of your steppers, and set the microstepping to 8 microsteps per full step,
ie 1600 steps/rev and leave them there. Fiddling with those settings will get you no closer to solving the issue of Mach stuttering.

Craig
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on February 08, 2020, 11:13:02 AM
Thank you. As I see it if I want to waste time I could disable on board video and add a video card that would have its own GPU or try a different comptroller again.  I am going to buy a speedstepper since I have more money than time.
Thanks again for all your help.  I will order one and post the results.
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on February 08, 2020, 02:17:22 PM
https://www.amazon.com/Ethernet-SmoothStepper-Mach3-Smooth-Stepper/dp/B07QKQ8L52/ref=sr_1_5?keywords=Ethernet+SmoothStepper&qid=1581178571&sr=8-5
From Amazon,
CNC Ethernet SmoothStepper for Mach3 / Mach4 CNC Smooth Stepper with Cable
by Automation

There is no brand name.  Can you comment on this?
Thanks
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: joeaverage on February 08, 2020, 03:15:57 PM
Hi,
the picture looks to be a genuine Ethernet SmoothStepper, but I'm dubious about Amazon.

Why don't you go to the Warp9TD site and either buy direct or from one of their distributors?

Craig
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on February 20, 2020, 03:39:31 PM
Good day,
Looking to see if anyone has suggestions on how to get my router to return to the same home position every time. Sometimes I can jog an axis and press on the home button and it returns to the same home spot.  The next time it may be 1/16 or more off from the original spot.  Motors sound smooth and I've tried everything suggested in this forum with no success.   Thanks
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: joeaverage on February 20, 2020, 04:25:02 PM
Hi,
sounds like you motors are losing steps.....if you can rule out mechanical issues?.

Start by tuning your motors very slow and work upwards until they start losing steps, then back off a wee bit.

Craig
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on February 29, 2020, 05:11:39 PM
Good Day,
I still cannot get my axis to return to the same home position every time.  I agree I may be missing steps as I can sometimes hear it.  I have done the following:
Purchased the Ethernet Speed Stepper
Unmounted my breakout board and one motor driver and moved them to a different location with a different power supply
Rewired the one motor driver to the Nema 23 motor and ran the drain wire outside to an isolated 8 ft. copper ground
  I only grounded one side of the drain wire.
Also grounded the power supply
Grounded the drain wire on the wire going from the breakout board to the motor driver
I hooked up the Ethernet Speed Stepper directly to the breakout board using the 25 pin female DB connector supplied with the ESS
  So I am not using any other cable between the ESS and breakout board.
I tried a third computer with the same results. 
Tried adjusting the Amps, steps etc on via dip switch on the motor driver board.
Sooooooooooo Sad.

Several ideas and questions
1.   Can I be getting feedback from the Ethernet cable going from the computer to ESS?
2.   In my mind the next thing to try is to get a better quality breakout board and motor driver.  If you agree what do you 
      suggest?

Thank you for all your help.
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: joeaverage on February 29, 2020, 06:16:57 PM
Hi,
it sounds like you have experimented enough to have established that the fault IS NOT Mach, nor the ESS, nor probably
the BoB.

I suspect that either (or both) the driver or motor are faulty.

What model driver and motor, and in particular what are the motor specs....including the winding inductance?.

My suggestion is to set up Mach/ESS/BoB to systematically test the motor/driver combination. You have been conducting
various tests in a scatter gun approach and it has not produced any meaningful results.

First, set the driver current to the rated stepper current....then leave it at that setting. Altering the current settings is
just confusing the issue. At best reducing the current reduces the torque and therefore INCREASES the likelyhood of
missing steps.

Second set the microstepping to 8 microsteps per full step, ie 1600 steps/rev and leave it there. Altering the microstepping
is confusing you.....it is just not relevant to the issue you want to solve.

Now you need to devise a Gcode program designed to test the motion of an axis. I would suggest something like:

g1 x100 f200
x0
x100
x0
x100
x0
x100
x0
x100
x0

Note I have assumed millimeter units.
Note also that I have used g1 so that the rate of motion is determined by the feed rate f.
This allows you to have several programs with indentical motion, that is back and forth 100mm, at different
speeds, from slow, say 200mm/min up to the max of your machine say 5000mm/min.

Tune the X axis motor for some very high and probably unobtainable max speed, like 20,000mm/min but set the
acceleration low, say 100mm/s2.

Now work through your test programs, starting at the lowest speed, that is f=200. If at the end of the test the X axis
returns to the original start point, that is, it has not lost steps then you can conclude that with the motor tuned
to low acceleration, 100mm/s2 the motor did not miss steps at f=200mm/min.

Now run the same program but with f=400mm/min say. Should that test conclude successfully, run the program again but
with f=600 etc.

Eventually you will find a feed rate that means that the stepper starts missing steps. You have just exceeded the maximum reliable
speed of that stepper. It may be slower than you want but that's too damn bad....this is what you have got. Carry on with the other
tests and once they are complete you may then ask the question 'are the test results I have obtained a genuine and correct
reflection of the hardware limitations or is there a fault....maybe power supply/signaling/extraneous electrical noise?

You should now have systematically found the maximum speed of your stepper, lets say it is 3000mm/min. If you reduce the feed rate
to somewhat less than 3000mm/min you could expect the stepper to NOT miss steps and therefore always correctly return to the
starting point. Write your test program with a feed rate of about half of your established maximum, say 1500mm/min.

Now you run your test program again, but always at the same feed rate, namely 1500mm/min. Between each successive run of
your program increase the tuning of the motors max acceleration by 50mm/s2.  Eventually you will find a limit
such that if Mach attempts to accelerate that axis beyond that limit, say 350mm/s2 then the axis will stall.
You have established the maximum acceleration the driver/stepper/power supply can sustain. Your operation of this stepper
will require that you apply tuning LESS than this maximum.

Please conduct the tests and report back.

There are a number of choices to be made about maximum velocity and maximum acceleration that can be made and applied to
you motor tuning, it is not for instance always desirable to go for max reliable speed, acceleration is often much more important to
accurate toolpath following and should be favoured over max speed.

Craig
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on February 29, 2020, 09:56:36 PM
Thanks Craig,
I have the same issue with all axis.  I had very systematic trouble shooting approach to exclude one item at a time as troubleshooting is my livelihood.  In my post I am showing what I have done overall.   During all my testing I had Velocity set to 25 and the acceleration set to 4, In.  The motor is rated at 3 amps and the driver board is always set to 3 amps.  I have decay set to 0, Torque 100% and steps to 2, not 8.  I can try that again however anything other than 2 the motor makes a high pitched wine and will move very fast and continually stall out. 

One thing that sticks out is the acceleration.  When I first built the router and started jogging around the motors rampped up, starting slow and increasing in speed until at full speed.  After a bit that stopped and the motors just start and stop at full speed.  I have not been able to get them to start slow and ramp up after that.  Not sure if I changed a setting or why that action changed. 

I will try again tomorrow working with motor speeds and working with your suggested code.  However if it doesn't move home when simply hitting the home button I do not understand why it would running gcode

thanks again.
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: joeaverage on March 01, 2020, 12:37:31 AM
Hi,

Quote
However if it doesn't move home when simply hitting the home button I do not understand why it would running gcode

When you hit the Home button....do you actually know what is going on inside Mach? Does it shift a certain number of steps or what?
When you execute the small Gcode program I have suggested then you know EXACTLY what Mach is supposed to do. If your motor
tuning is 500 steps per unit say, then a move of 100mm should produce EXACTLY 500 x 100=50,000 steps, if you had a  pulse
or frequency counter you could count the pulses and confirm Mach/ESS/BoB. Can you do the same when you hit the Home button?

Quote
I have decay set to 0, Torque 100% and steps to 2, not 8.  I can try that again however anything other than 2 the motor makes a high pitched wine and will move very fast and continually stall out. 

That absolutely wrong and suggests a fault right there. If you set the microstepping to 2, that is called 'halfstepping' and
therefore 400 pulse per rev, exactly double the number of 'fullsteps' per revolution. If you set the microstepping to 8
then the number of steps per revolution is 1600 steps/rev. If the motor tuning remains the same then the axis should move
at 1/8 the speed of fullstepping and 1/4 the speed of half stepping. If its trying to move faster then your settings are wrong.

I still don't know what your drivers or steppers are but that description suggests that there is a fault or you are misapplying
the settings somehow. I repeat....'what drivers?'....'what motor specs, including inductance?'.

Either way you absolutely need to establish why your drivers are not responding to the microstepping settings correctly.

Quote
One thing that sticks out is the acceleration.  When I first built the router and started jogging around the motors rampped up, starting slow and increasing in speed until at full speed.  After a bit that stopped and the motors just start and stop at full speed.  I have not been able to get them to start slow and ramp up after that.  Not sure if I changed a setting or why that action changed. 

This is plain faulty, without an acceleration phase at the start of any move I would expect a stepper to stall. Likewise I would expect more
missed steps if the axis did not have a deceleration phase.

In the first instance try and sort out the driver/stepper combination....it may, with any sort of luck, rectify this second fault as well.

Craig
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on March 10, 2020, 11:11:42 PM
Good day all,

I have resolved this issue.  I joined a Facebook club for CNC.  I posted my issue same as above.  One of my first reply's was the TB 6560 motor controllers were know to have issues.  I had read this on other posts as well.  This is what I was suspecting after all my other trouble shooting and part swapping.  Based on user input I ordered one motor driver DM542T.  I hooked it up and presto.  No more skipped steps.  The motor runs very smooth and quiet.  I ordered three more motor controllers tonight and will be up and running (at least with this issue solved) by the weekend. 
Best of luck to anyone with this issue and I hope my post helps you resolve your issue.
Thanks
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: wes709 on March 12, 2020, 03:53:31 AM
Hey there , so was it the ESS or the driver ? Did you try running your setup without ESS?
Title: Re: I can Jog Fine but everything stutters when running GCode or even calibrating.
Post by: davidcomputersinc on March 12, 2020, 09:45:47 PM
Hey there , so was it the ESS or the driver ? Did you try running your setup without ESS?

Good day,  It was the motor driver.  I still used the ESS when testing the new motor driver.  I'm not sure if it is still necessary to use it, however I have it so I might as well.  I wish I had taken a video of the different ways the motors ran with out the ESS and with it, then with the old motor driver and the new motor driver.  I know it would have helped me to see something like that on YouTube because I thought the motors were running smooth after installing the ESS but now after seeing how they run with the new motor drivers I know they were not running correctly before. 
Hope this answers you question.  Let me know if you need anything else.