Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: rnjcurtis@charter.net on March 04, 2020, 01:00:37 PM

Title: Stepper motor speed varriations
Post by: rnjcurtis@charter.net on March 04, 2020, 01:00:37 PM
My stepper motors on the X and Y axis make different sounds and change speeds as I manually move them by using the keyboard.  What might be causing this?  It is a new setup, so I may have some parameters wrong.

Roger
Title: Re: Stepper motor speed varriations
Post by: joeaverage on March 04, 2020, 01:21:25 PM
Hi,
what happens when you MDI G0 moves on each axis rather than keyboard jog?

Craig
Title: Re: Stepper motor speed varriations
Post by: rnjcurtis@charter.net on March 06, 2020, 06:03:00 PM
My apologies for the delay. 

It seems to do the same thing in either mode.
Title: Re: Stepper motor speed varriations
Post by: joeaverage on March 06, 2020, 06:38:27 PM
Hi,
OK you need to try some experiments to work out whats happening.

What are your native units? I use metric so I will assume mm units.

In the first instance you need to write and run small Gcode programs to test each axis, firstly at low speeds slowly
increasing to rapid traverses.

For example:

g1 x200 f100
x0
x200
x0
x200
x0
x200
x0

This code should cause the x axis to move back and forth by 200mm at a max of 100mm/min.
Now try the same code but at higher feed speed:

g1 x200 f200
x0
x200
x0
x200
x0

The same motion, back and forth but at 200mm/min.
And again at a higher speed:

g1 x200 f300
x0
x200........etc

Keep repeating the test but with ever increasing feed speed.

I don't know what speed max speed you have tuned your motors for, lets guess at 2000mm/min. Then the following code
tests the x axis at rapid traverse speed:

g0 x200
x0
x200
x0
x200
x0


I am guessing that if you follow this you will find an eventual limit beyond which you get the variations in speed but
below that limit the x axis behaves normally.

Try it and report back.

Craig
Title: Re: Stepper motor speed varriations
Post by: ZASto on March 07, 2020, 04:06:21 AM
Could it be that you have very low acceleration?
Title: Re: Stepper motor speed varriations
Post by: rnjcurtis@charter.net on March 07, 2020, 12:24:54 PM
In the interest of full disclosure, I am new at this.  I just finished building this CNC Router and have installed and wired the controller (TB6560T4V1) with a Parallel interface and this controls 4 ea. NEMA 23 steppers (X, Y, Z, and A axis) A being slaved together with the Y axis.  On the Controller board I have the Microstepping (working mode 1/8, dip 3&4 on) Current decay (Slow decay, dip 1&2 off)  Current setting dip T1&2 are off for 100%*2.5A.  That's it for the hardware setup.  Not sure I understand these settings, but if they are incorrect please let me know.  The stepper motors have 24 tooth 3M pulleys operating on a timing belt, for the X & Y axis movement.

Initial setup for Mach 3:  Native Units mm.  Port#1 enabled. Motor outputs X, Y, Z, A enabled.  Step Port and Dir Port all set to 1.  Y axis Dir Low Active green check. Step pin# 2, 4, 6, 8.  Dir Pin # 3, 5, 7, 9.  Input Signals X+- enabled pin 10 both,  Y+- enabled Pin 11,  Z+- enabled pin 12,  EStop enabled pin 13.  Output Signals, Enable1 pin 1 Output #1 pin 14.

Unless there are other parameters to set up, it is on to motor tuning, on which I am a bit confused.  Some help here would be appreciated.

Roger
Title: Re: Stepper motor speed varriations
Post by: ZASto on March 07, 2020, 01:37:59 PM
Max speed and acceleration are set in Motor tuning.
Title: Re: Stepper motor speed varriations
Post by: rnjcurtis@charter.net on March 07, 2020, 01:52:54 PM
How do I determine max speed and acceleration?
Title: Re: Stepper motor speed varriations
Post by: rnjcurtis@charter.net on March 07, 2020, 02:02:53 PM
I am a bit confused with the calculation and use of: Micro stepping, Steps per unit, steps per revolution, cycles per revolution, Mach 3 steps per unit, as they should be calculated for my particular unit.
Title: Re: Stepper motor speed varriations
Post by: joeaverage on March 07, 2020, 02:03:50 PM
Hi,
the 'Setps per Unit' value can be calculated or measured. It is specific to your machine and unless you change your
ballscrew or belt pulleys will stay the same for the life of the machine.

Maximum speed (also called velocity) and maximum acceleration have to be arrived at by experiment. My previous
post outlines the procedure.

What you are trying to do is top establish the capabilities of your steppers/drivers and then set your maximums
WITHIN those capabilities so thy don't lose steps when operating.

Craig
Title: Re: Stepper motor speed varriations
Post by: joeaverage on March 07, 2020, 02:11:45 PM
Hi,
ideally the steps per unit should be calculated but many people get confused and use a measurement approach.

It seems strange to me that even the most mathematically challenged person seems to grasp compound interest
on their loan......all without a calculator....and yet cannot get their head around 'steps per unit'.

What pitch are your ballscrews?
Do you have belt reduction from the stepper to the ballscrews? If so what is the reduction ratio?
What have you set as microstepping? If you haven't or don't understand I would recommend 8 microsteps per
fullstep or 1600 steps/rev.
What are your native units?

Tell me these numbers and I will outline how you calculate the 'steps per unit'.

Craig
Title: Re: Stepper motor speed varriations
Post by: rnjcurtis@charter.net on March 07, 2020, 06:37:59 PM
Hi Craig,

I have belt drive for "X" and "Y" with 24 tooth pulley. Microstepping can be either 1/8 or 1/16.  Native units is mm.

"Z" axis is screw with 2mm pitch direct drive from stepper.

Please explain CPR and Mach3 steps per motor revolution.

Thanks,

Roger
Title: Re: Stepper motor speed varriations
Post by: joeaverage on March 07, 2020, 09:03:52 PM
Hi Roger,
CPR stands for counts per rev. It is usually applied to an encoder.

If an encoder has 2500 lines, it sometimes called pulses/rev or PPR then because of the quadrature placing of the opto-detectors
it will have 10,000 counts per rev or CPR.

If you set your microstepping to 1/8th (recommended) then your steppers will rotate exactly one revolution when the drivers are presented with 1600 pulses or CPR.

Lets tackle the Z axis first. If the stepper rotates once with 1600 pulses and the z axis will advance 2mm, being the pitch of the ballscrew.
The 'steps per unit' value that you put on the Z axis tuning page will be:
StepsPerUnit=1600 / 2
=800

Easy!

Now the X and Y axes are not so simple. You say they are belts with a 24 tooth pulley? What pitch are the teeth on the belt?
For the purposes of demonstration I'm going to assume 3.15mm pitch (1/8 inch).
StepsPerUnit= 1600 (steps per motor rev) / (24 teeth x 3.15)
=21.16
You will have to round to 21 steps per unit.

Note this is very course resolution, every pulse will advance either the X or Y axes 1/21 (=0.05)mm. Is this what you expected or wanted?

Craig
Title: Re: Stepper motor speed varriations
Post by: rnjcurtis@charter.net on March 08, 2020, 11:19:02 AM
Craig,

Lets see if I have this right. I was hung up on the encoder and trying to factor the 4 into the equation.  Apparently the items factored into the calculation are:  Motor Steps / rev (200), Microstepping (16), and distance moved per step or rev.

My calculation: 200 X 16 = 3200 Steps per revolution.  (Belt 3mm pitch, pulley 24 tooth) 

(3200) / (24 X 3) = 44.444 pulses per mm      Is this correct??

You mentioned previously that 8 is the preferred microstepping factor.  Is there a reason to not use 16?

Thank you much for your help, it is much appreciated,

Roger



Title: Re: Stepper motor speed varriations
Post by: ZASto on March 08, 2020, 12:40:35 PM
Hi Roger,
CPR stands for counts per rev. It is usually applied to an encoder.

If an encoder has 2500 lines, it sometimes called pulses/rev or PPR then because of the quadrature placing of the opto-detectors
it will have 10,000 counts per rev or CPR.

If you set your microstepping to 1/8th (recommended) then your steppers will rotate exactly one revolution when the drivers are presented with 1600 pulses or CPR.

Lets tackle the Z axis first. If the stepper rotates once with 1600 pulses and the z axis will advance 2mm, being the pitch of the ballscrew.
The 'steps per unit' value that you put on the Z axis tuning page will be:
StepsPerUnit=1600 / 2
=800

Easy!

Now the X and Y axes are not so simple. You say they are belts with a 24 tooth pulley? What pitch are the teeth on the belt?
For the purposes of demonstration I'm going to assume 3.15mm pitch (1/8 inch).
StepsPerUnit= 1600 (steps per motor rev) / (24 teeth x 3.15)
=21.16
You will have to round to 21 steps per unit.

Note this is very course resolution, every pulse will advance either the X or Y axes 1/21 (=0.05)mm. Is this what you expected or wanted?

Craig

No need for rounding in Mach3. Mach will be perfectly happy with fractional steps per.