Hello Guest it is March 28, 2024, 03:50:33 PM

Author Topic: Motor Tuning in Mach 4, Very Stuck  (Read 5569 times)

0 Members and 1 Guest are viewing this topic.

Motor Tuning in Mach 4, Very Stuck
« on: January 26, 2019, 06:35:59 AM »
Hi all brand new to mach 4 and ive almost finished my first build but alas i'm well an truly stuck and have been pulling hair for a week.

I cant seam to wrap my head around motor tuning to suit my motors, i just dont understand and would love if someone would be able to help me through it

My set up is Mach 4 with a ess and MB2 breakout board, I'm running Nema 34 hybrid motors like the ledshine branded ones in 8.5nm and 12nm with SFU1605 leadscrews
I have everything moving and working well but im just stuck on the tuning.

If there is anyone that is able to help i would really appreciate it.

Let me know if you need anymore information and ill try and add some pictures of my rig

Regards
Re: Motor Tuning in Mach 4, Very Stuck
« Reply #1 on: January 26, 2019, 11:32:40 AM »
Homebuilt,
How what are you having trouble with?  The Steps Per Unit or the Velocity and Accel?
 
For Steps Per Unit, I found a couple of resources that are worth looking at. 
The first is Artsoft's YouTube Channel:  Steps Per Unit Calculator Wizard.
https://www.youtube.com/watch?v=d-xCWDR0Uvg
The next resource I found gives you a formula for finding the correct SPU.  (You can stop reading once you get to the formula)
https://planet-cnc.com/how-to-setup-cnc/

For Velocity and Accel; I'm sure someone else will have a better explanation than what I do, but this is how we do it....  I like the old trial and error approach.  First, calibrate your axis, otherwise this will be pointless because it will change with calibration.  Once I know that all my axis are calibrated correctly, I decide what the Max Rapid Rate for my machine should be or where I want it; this will depend on how strong your motors are for your table, I retrofit lathes and VMCs mostly so I use good size servos so I can get good speed out of my machine.  Your Velocity is the max units per minute the machine can move; for example, the mill I'm working on is currently set to 450 units (inches) per minute.  If you are unsure how fast to set the velocity, start high and keep adjusting your velocity down until the motors don't stall while jogging, then go 3/4 of that speed and you should be good to go.

As for the acceleration, I usually go with 10% of my velocity and 95% of the time it works great.  With servos and hybrid steppers it could be a little less because they have the feedback from the encoder; but again, this is trial and error, if you machine table is a heavy, has small motors, or is a gantry type machine, it will likely have to have a higher acceleration to not stall your motors.

Like I said, someone may have a more scientific or mathematical approach than what I do; but this has always worked for us.  Maybe someone else will share their experience, I'd love to hear it as well.
« Last Edit: January 26, 2019, 11:37:46 AM by Cbyrdtopper »
Chad Byrd
Re: Motor Tuning in Mach 4, Very Stuck
« Reply #2 on: January 26, 2019, 01:09:08 PM »
Hi,
Chad has outlined the process spot on.

Quote
I'm running Nema 34 hybrid motors like the ledshine branded ones in 8.5nm and 12nm with SFU1605 leadscrews

Those are extremely powerful steppers. Often large steppers that have a great deal of torque do not have very high top
speeds before they start missing steps. You might be advised to treat the maximum speed as when the motors are doing 500 rpm.


If the steppers are direct coupled to the ballscrews then 500 rpm results in a linear speed of 2500 mm/min.

With steppers such as yours with high torque you can probably accommodate high or even very high acceleration. Chad has suggested
10% of your velocity, a good place to start, but I suspect, especially if you don't try to make them spin too fast, ie keep
the max velocity low then your acceleration could be much MUCH higher.

Often cycle times are improved as much if not more by high acceleration than axis speed. Certainly the higher the acceleration
your machine is capable of the more accurate parts will be when running in CV mode. The long and short of it is you need
to find the maximum safe and reliable acceleration your machine and motors can handle. Its more important than maximum
axis speed.

Can you tell us about the drivers and the settings you can make with them? Perhaps post the manual. If they are genuine closed
loop hybrid then there are a number of settings that will affect resolution and therefore your 'steps per unit'. Until you have the
'steps per unit' absolutely nailed down then any other motor tuning is a waste of time.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Motor Tuning in Mach 4, Very Stuck
« Reply #3 on: January 26, 2019, 04:07:09 PM »
Thanks for your help guys, i suppose ill start from the begining

On the stepper motor controller units i have it set at 2000 pulses per rev but im not really sure if that works as everything is moving at a snails pace now
and with 2000 pulses what does that equate to in my current steps per revolution just to give me a start point
Re: Motor Tuning in Mach 4, Very Stuck
« Reply #4 on: January 26, 2019, 04:20:02 PM »
Also wanted to add in the wizard i have my settings as

1000 counts per unit
100 units velocity
10 acceleration units

no idea if these numbers are right but when i move 10 units it moves 63mm and when i try to input that new length the number gets amazing small and my machine is crawling along like a snail
Re: Motor Tuning in Mach 4, Very Stuck
« Reply #5 on: January 26, 2019, 04:37:23 PM »
Hi,
who knows.....you have given us no information.

First...tell us about the stepper drivers or better yet post the manual
Are the steppers direct coupled to the ballscrews or through some sort of gear/belt reduction?
You said you are using 1605 ballscrews....can you confirm and in particular that they are 5mm pitch?

I will make some assumptions based on what you have said, I know 'assumption is the mother of all 'f......ups'
but here goes.

If your ballscrew is direct coupled and it is 5mm pitch AND you have set the drivers to 2000 steps per revolution THEN

Steps per Unit (mm)=2000 /5
                              =400

I would suggest you start with the velocity setting of 2500 (mm/min) and an acceleration of 250 mm/sec/sec.

When you say that the axis is traveling very slowly, how are you instructing it to move?
I would be prepared to guess that you are jogging it and the jog rate is set vey low.

Do yourself a favour and learn a little Gcode and use MDI instructions instead.

If for instance you code:
g0 x100 <MDI Cycle Start> the X axis should move at its fastest possible (2500 mm/min if you have followed my recommendation)
speed to X=100 mm.

If you code:
g1 x100 f500 <MDI Cycle Start> then the X axis should move to X=100 at 500 mm/min.

Thus by using MDI commands you have explicitly told Mach how fast to drive the axes....you are not reliant on jog speeds.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Motor Tuning in Mach 4, Very Stuck
« Reply #6 on: January 26, 2019, 04:46:48 PM »
Hi craig chucked in those assumptions and she is definalty moving a bit better.

I post a link to the driver spec sheet
http://oceancontrols.com.au/files/datasheet/lea/SMC-180_ES-Dhm_V1.1.pdf

I'm running the larger one and they are direct link coupled, i turned up a aluminium couple on my lathe and i can confirm they are 100% 5mm pitch ballscrews.

Ill watch some more youtube videos on g code but yeah i was just jogging to unit.

Hope that helps a little

Regards Dale
Re: Motor Tuning in Mach 4, Very Stuck
« Reply #7 on: January 26, 2019, 04:47:07 PM »
Hi,

Quote
1000 counts per unit

You cant arbitrarily set the 'Steps per Unit' to whatever value you like.

If you have a manual car and are cruising in top gear if the engine is doing 3000 rmp and you are going 100km/hr
unless you change the gearing, or the diff or the size of the wheels you can't suddenly decide 'I want to go 120km/hr
at 3000 rpm'. The ratio is fixed by the mechanics of your car.

The analogy is that if you have set your stepper drivers to 2000 pulses per revolution and the pitch is 5mm per revolution
then the Steps per Unit IS 400.....no if...no buts. If you want to change it then change the number pulse per revolution
ie your stepper driver OR change the pitch of your ballscrews OR introduce some gearing between the motor and the
ballscrew.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Motor Tuning in Mach 4, Very Stuck
« Reply #8 on: January 26, 2019, 05:20:03 PM »
Hi Dale,
are you Aussie? Is it warm enough yet!

Ok, the stepper driver has a setting which would make your desired 'Steps per Unit' 1000.
If you set your stepper driver to 5000 pulse rev revolution combined with directly driven 5mm pitch screws
results in 1000 Steps per Unit.

Its another way of saying that every pluse issued by Mach/BoB/Controller will advance the axis 1 um. That's pretty impressive.

You have not said what sort of controller you are using?.

If you wish to spin your motors at 500 rpm and your driver is set to 5000 pulses per rev then
Pulses per minute= 500 X 5000
                          =2,500,000
or Pulses per sec  =41666 or near as dammit 42kHz.

As you can see my question about your controller is not idle. Machs parallel port is natively 25kHz. It would not be
fast enough to signal your driver with that high resolution. You can increase the kernel speed in Mach3 parallel port,
if I recall there is a setting for 45kHz. The downside is that the faster you try to make a parallel port go the likelihood
of glitches /stalls and stutter goes up markedly.

For this reason I would not recommend such high resolution if you are attempting to use a parallel port, your original
setting of 2000 pulse per rev is better. That corresponds to a linear resolution of 2.5um per pulse, still very impressive.
Even 2.5um resolution is likely to be more accurate than your machine....or if your machine is that good/expensive
then what are you doing pissing around with Mach in the first place?

If you are using an Ethernet SmoothStepper say, by way of comparison, that has a max pulse frequency of 4Mhz.....
that is 160 TIMES faster than Machs parallel port (at 25kHz), thus you can set your resolution high, even higher than 5000
pulse per rev and still be within the capability of  the SmoothStepper.

Resolutions of finer than 1um (excepting wafer scale semiconductor manufacturing gear at millions of dollars each) is for those
people who like to jerk off and/or brag.....not what I would expect from an Aussie! ;D

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Motor Tuning in Mach 4, Very Stuck
« Reply #9 on: January 26, 2019, 05:28:27 PM »
Hi,
my apologies, in your original post you specified that you have an ESS, so disregard the question about the controller.
The ESS will handle anything you care to throw at it at a canter.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'