# Machsupport Forum

## Mach Discussion => General Mach Discussion => Topic started by: mach3lover on November 10, 2015, 01:12:44 PM

Title: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 01:12:44 PM
Hello!

I'm a newbie in Mach3, and I have some problem with the speed of the axis in my Mach3 CNC machine. I think this is probably a really easy problem to solve, so for a pro this might take a sec!   ::)

I have set the system to metric, e.g. in mm's. By measuring the distance the axis move when I use the program, I have calculated the "Steps per" to be 200. My stepper motors turn 200 steps per revolution, which means that one motor revolution moves the axis 1 mm in linear distance. The kernel speed is 25KHz, so the maximum velocity should be 25KHz/200 steps per unit = 125 mm/s

However, this feels like a very low velocity? This is the maximum velocity the machine will move, right? What can I do to make it faster? Or am I missing something completely now?

/ Johanna
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 01:19:44 PM
That is not how you work out the velocity....!

Firstly your stepper motor drivers, what microstepping resolution do you have them set on?

Next what leadscrew or ballscrew pitch do you have?

Presume you have no gearbox and they are direct drive?

How big is your machine... Not its physical size but how much travel does each of the axis have?

Presume all the leadscrew for all the axis are the same?

Rob
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 01:26:15 PM
How big is the machine (the carriages)... What sort of a machine is it ... Is it a milling machine / engraver like the 3040 cncs or is it something else?

Do you have a photo?

Rob
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 01:29:46 PM
The drivers are set at full step.

About the ballscrew and the leadscrew, the problem is that they are in the machine and I can't determine their pitch. I am fixing an already existing machine, and making the controller between the computer and the motors.

Yes I presume they are direct drive.

The travel in Z-, Y- and X-axis is about 40 cm.

The machine is an Emco F1-CNC

/ Johanna
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 01:33:52 PM
If I test and put the "Steps per" to for example 4000, then the axis move a lot faster, but the distance they move does not match the distance in the "Distance Window" in Mach3
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 01:39:07 PM
Hang on trying to review some specs of the f1 (I have an fb2... Not converted to CNC yet)

Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 02:02:32 PM

http://www.usinages.com/Documentations/EMCO_F1_cnc%20manual.pdf

http://www.smoregrava.net/CNC/f1pcncservice.pdf

are you using the existing stepper motors and drives or have you set up new drives and steppers?
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 02:06:49 PM
We use drivers HY-DIV268N-5A and the stepper motors are KL23H
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 02:13:34 PM
Seems they are 2mm pitch, with a 2:1 gear reduction (if you are using the existing stepper motors), then each stepper will be 200 steps full scale resolution...

The manual lists the resolution as 0.001mm / step...

so 2 / 2 / 200 = 0.005 mm / full step..... the problem is the commong uStep resolutions are:
full step, half step, quarter step, 8th step and 16th step....
which would give the following resolutions per step
full - 0.005
half - 0.0025
quarter - 0.00125
8th - 0.000625
16th - 0.0003125

the manual lists the maximum axis speed as 1200mm / min ....

So I'd suggest setting up the maximum axis velocity as 1200mm / min

Then you are going to need to do a bit of exploration as to the step resolution .... I'd suggest as a start (given you have them as full step) as 1 / 0.005 = 200 steps per mm.... (which is what you did in the first place....)

I'd start off with the acceleration as about 40 mm/s/sec .....

given 1200mm/min = 20mm / sec >>>> and a good starting point is about 0.5sec to achieve full speed....

Then you will need to do some tuning....

as far as the Kernal speed.... leave it as 25kHz  .... given 200 steps / mm x 20 mm / sec = 4000 steps per second (maximum).... hence 4kHz...

Rob
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 02:18:13 PM
..... if I was setting up my machine.... I would try to set it up on quarter uStep driver setting ....

So I'd get 0.00125mm / micro step and that would allow for backlash compensation

1 / 0.00125 = 800 steps / mm >>>>> 800 steps / mm x 20mm / sec = 16kHz kernel frequency ..... so leave it at 25kHz ( minimum setting ).

Rob
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 02:29:42 PM

I have now tried the settings you gave me, but without success...

I aslo get the message that the velocity is too high for the kernel speed, but I can still run the machine.

I tried first at full step, and the axis is moving very slow. When I change to 1/8 it is moving even slower.

It feels like I am missing something super easy here. In the "Jog Tab", the rate is set to 100%, so it should move at full speed.

/ Johanna
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 02:35:41 PM
Send me your XML file from within your mach3 folder as that is where all your settings are saved.
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 03:01:02 PM
I couldnt manage to attach the files here in the forum so I sent you an email!
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 03:25:28 PM
Option 1.....

200 steps / mm
1200mm/min
20mm/sec/sec (try using a slower acceleration until you get it running right then tune it]

Option 2.....

800 steps / mm
1200mm/min
20mm/sec/sec   (try using a slower acceleration until you get it running right then tune it]

Screenshots attached

You have some more problems.....

You're inputs and outputs screens are all wrong
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 03:27:16 PM
Outputs screenshot...

Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 03:35:53 PM
.... also note that the "step pulse" and "direction pulse" have been set to 5 micro (uSec) on the motor tuning page...

You need to get your EStop assigned correctly first.... Then start adding other functions

I'd suggest unchecking all of your other inputs and outputs for the moment until you can get the machine to run and then start finding out what limit switches and outputs are on what pins.

Do not try to get too many things working at once (unless you know what you're doing) or you will end up with many problems at once.

in order to get the machine to move you need to sort out the Estop (on the inputs tab) and you need to define the settings for the stepper motors (ports pins acceleration and velocity etc as well as the pulse widths....

Rob
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 03:52:12 PM
Wow, thanks for a good response!!

Now I have it moving at a good speed with the following settings:

X-axis
800 steps per
1200 velocity
40 acc

Y-axis
200 steps per
1200 velocity
20 acc

Z-axis
800 steps per
1200 velocity
40 acc

It moves good, but the axis is not even close to accurate.. When I move the X-axis 5 steps on the computer, it moves 19mm on the table...

I think I don't really understand the relationship between the settings here. The "Distance window" in Mach3, that will also show the koordinates in mm, since we set the whole program in mm, right?

Further on, we unchecked all the outputs and inputs, but we haven't had any problems with using them on these pins...? Or could it affect something else?

Also, what do you mean with the "step pulse" and "directions pulse"? Is 5 micro sec bad or good?

/ Johanna
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 04:06:28 PM

Also, what do you mean with the "step pulse" and "directions pulse"? Is 5 micro sec bad or good?

Have a look at the attached screenshot of your XML
----------------------------------------------------------
X-axis
800 steps per
1200 velocity
40 acc

Y-axis
200 steps per >>>> all of these settings should be the same for the X and Y Axis so that they can move in tandem at the same speed in constant velocity
1200 velocity
20 acc   >>>> all of these settings should be the same for the X and Y Axis so that they can move in tandem at the same speed in constant velocity

Z-axis
800 steps per
1200 velocity
40 acc
--------------------------------------------------------------------------------------------------------

It moves good, but the axis is not even close to accurate.. When I move the X-axis 5 steps on the computer, it moves 19mm on the table...

I think I don't really understand the relationship between the settings here. The "Distance window" in Mach3, that will also show the coordinates in mm, since we set the whole program in mm, right?

How did you tell the machine to move "5 steps"...... did you type in G0 X5 ?

If so... you told the machine to move 5mm not 5 steps....

I would suggest using the "auto calibration" on the "settings" tab.... at the bottom of the screen near the reset button is the axis calibration button (as shown in the screenshot)... click on it, select the axis and tell it how far you want it to move and measure how far it actually move, then input that distance and it will automatically correct tour "steps / mm" setting on the motor tuning page.

Rob
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 04:56:52 PM
Thank you, now everything works perfectly! :)

Yes I realised soon after I wrote that the X- and Y-axis should have the same settings! To make them accurate in distance I now put their steps per to 801,8, with 1/4 step in the motors.

I am now going to change the input pins for the limit switches. Why can't I use pin 0-4 for the switches and stops as I do now and it is working just fine?

/ Johanna
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 05:02:42 PM
Why can't I use pin 0-4 for the switches and stops as I do now and it is working just fine?

I presume you are using a parallel port....??

Some pins are inputs and some pins are outputs... they cannot be both [with the parallel port!.. different with a motion controller].

So you can only use pins 10-13 + 15 as inputs...

All the rest are outputs

You have already assigned pins 2,3,4,5,6 & 7 to your stepper motors direction and step pins...

Presume you have an eStop assigned.... so you only have 4 other input pins you can use.

http://image.dhgate.com/albu_140646897_00/1.0x0.jpg

Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 05:03:38 PM
Pin "0" does not exist too...
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 05:06:16 PM
No I use a motion card!
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 05:07:46 PM
.... which card?
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 05:09:57 PM
AKZ-250
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 05:31:29 PM
Ahh... OK then your pins should be fine....

Good luck if you can understand that manual .... (thank goodness for a smooth stepper!!!)

http://leafboy77.com/files/USB_Motion_Card_AKZ250_Manual_v1.17_CN-EN20121102.pdf.zip
http://leafboy77.com/index.php/en/home/16-english-categories/mach3/usb-motion/card-akz250/1-mach3-usb-motion-card-akz250
Title: Re: Speed of stepper motors
Post by: mach3lover on November 10, 2015, 06:23:56 PM
Haha, yes it is a bit confusing!  ::)

Thank you for all help! :)
Title: Re: Speed of stepper motors
Post by: robertspark on November 10, 2015, 06:26:59 PM
No problem, glad you got it working

Rob
Title: Re: Speed of stepper motors
Post by: mach3lover on November 11, 2015, 02:37:57 PM
One more quick question on the same subject!

When I stopped working yesterday the machine was working just fine and the speed was good. I did nothing over night, and changed no settings, but now when I turn it on again the axis are moving very slow when I use try to jog them.

Do you have any clue why this might be?

/ Johanna
Title: Re: Speed of stepper motors
Post by: robertspark on November 11, 2015, 03:10:20 PM
It may be the feedrate...

Go into general configuration and there is a text box in the middle of the screen.... Probably says g80 in the middle of it....

Type "coma" F1200

Restart mach3.... Did it sort your problems?

Rob
Title: Re: Speed of stepper motors
Post by: mach3lover on November 13, 2015, 03:31:52 PM
Yes in the inbox was G80 and I changed it now to F1200

The axes seem to move faster for one step, but if i want to test it for more example 10 steps
the motors start moving and then I get a high sound and the motors stop moving
Could it be that i have now a too high velocity?

Johanna

Title: Re: Speed of stepper motors
Post by: robertspark on November 13, 2015, 03:49:25 PM
Yes.

You need to tune the motors

Those drives you have are not very good... What voltage power supply do you have?

Rob
Title: Re: Speed of stepper motors
Post by: mach3lover on November 17, 2015, 12:29:04 PM
I measure 24.45 V from DC+ to DC- on the drivers.
Title: Re: Speed of stepper motors
Post by: Fastest1 on November 27, 2015, 08:52:33 PM
Yes in the inbox was G80 and I changed it now to F1200

The axes seem to move faster for one step, but if i want to test it for more example 10 steps
the motors start moving and then I get a high sound and the motors stop moving
Could it be that i have now a too high velocity?

Johanna

This is called stalling. It can be caused by a few things, one of which is too high of acceleration.