Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: hyildiz on February 20, 2022, 11:24:33 AM

Title: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 20, 2022, 11:24:33 AM
Hi guys,

I faced with a very dangerous error yesterday while running a gcode in Mach4, in short the problem is; Mach4 looses its zero point while running gcodes, this happens once in a while, like 1 out of 8 jobs. At first it was like missing the zero point in X(generally X, couple times it happened in the Y too) within 40-50mm, i was stopping the code and realign the axis and go on from there, but yesterday it lost the zero point by 400mm!! i was not close to the machine so it went 400mm(approx.) back in -X direction and hit the limit switch so that the machine stopped. (There is a malfunction in the front, +X direction limit switch, i ordered the new one and waiting for it to arrive to change it, so if it moved in the + direction it would not stop by hitting the limit switch and that would kill the machine for sure, this is a c3 ballscrews attached 4 ton machine, so it would cost very much). First thing tomorrow i will attach a small limit switch i have in hand to the +X direction before running the machine again.

But this problem is very weird, most of the code runs normally, i always generate the gcode from Solidworks, HSMworks with Mach3 post processor, so there is nothing wrong with the code(i am posting the code anyway), in general there is no noticeable noise in the machine and if it was noise i think i should get the same error in every gcode i run but this happens once in a while and can not say when actually. Gcode runs normally but suddenly at some point zero point of X moves back to 400mm and machine thinks that it is in the wrong place and moves back to keep up with the coordinate in the code, so it moves in a wrong place. It ruins the part, in addition to that a high quality PCD bit and sdc holder was installed yesterday and just because of the luck it didnt hit to anything while moving to the wrong coordinate. the plate is relatively big so in general i attach other jigs on the plate i was lucky it didnt hit them.

So as you can understand this is a very very serious malfunction for a cnc machine in every aspect.

I searched the web and forums for a similar error and found out that Mach3 users faced with the exact same error before but no one understood why this happened or didnt post any solution about it.

X axis is driven by a 16NM stepper motor, 100 microstep / 30.000 pulse per revolution, (i have a 11NM servo and using the stepper because its more powerful, the Y+Z axis is 600kg in weight approx.) its driving a 40mm diameter, C3, zero backlash, 5mm pitch ballscrew, i also attached the speed, accel. values for you guys to check. My positioning accuracy is within 5microns.

I was using my own screen while this first started, thought that it may happen because of the screen and reinstall Mach4 and ESS plugins with latest stable versions and started to use Mach4 standard screen as is with no modifying on it. The PC motherboard and ram capacity is more than enough for running Mach4, nothing wrong in device manager and all drivers are up to date including the gpu.

Do you guys have any ideas about the reason and solution of this weird problem? anyone faced with the same error while running a gcode? why would Mach4 loose its zero point by 400mm during operation? any ideas are really appreciated, thanks in advance.

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: Graham Waterworth on February 20, 2022, 12:09:01 PM
I would start by reducing the micro stepping to 10 from 100 as the machine can never achieve that resolution and it will reduce the load on the stepper drives and pulse generator and increase the torque.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 20, 2022, 01:21:37 PM
Hi,

Thanks for the advice, i will try to reduce the micro stepping, i did that to achieve high resolution for positioning since the ballscrew is capable of doing that. u are right it can overload the pulse generator, will try and run the same code in air.

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 20, 2022, 03:30:31 PM
Hi,
your machine is loosing steps, or one of the steppers is stalling.

Mach4 IS NOT A FEEDBACK controller, that is to say if Mach issues pulses for a stepper to go to a certain location it assumes the stepper does so because there
is no way for Mach to tell otherwise, it does not get feedback from the stepper.

Many Mach users prefer closed loop steppers or servos because the the stepper/servo drive uses feedback from the stepper/servo to determine whether its in agreement with
Machs commands. In fact if it differs from where Mach has commanded it be then the drive will issue pulses to try to correct the error. If the stepper/servo cannot for whatever
reason keep up with Machs commands and it slips behind it will fault out, produce an alarm and usually Estop Mach rather than carry on machining when its well out of correct
location. Note that Mach is still not a feedback controller in this circumstance, but the stepper/servo drive is smart enough to know when its stepper/servo is out of position.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 20, 2022, 04:39:02 PM
Hi Craig,

I know that thanks for reminding me, X axis has open loop 3 phase stepper, Y axis has closed loop 1.8 degree stepper, z axis has a servo motor, this is a prototype machine to test all types of motors.

This error happens in both open loop stepper(X axis) and closed loop stepper (Y axis) so i dont think its about position feedback, and about missing steps; missing steps is 1 step or 10 steps, i dont think it can be couple million steps. loosing zero point for about 400mm with 100 microstep(30000 pulse/revolution) and 5mm pitch ballscrew u have to loose 2.400.000 steps if i am not mistaken.

About the stalling, motors are not stalling they keep on working normal just the zero point in mach4 is shifting, i am not sure about the open loop 3 phase driver but closed loop driver(fastech ezi-servo https://fastech.co.kr/new/eng/sub0102.php )  has a fault function, it even stops immediately if the axis slightly hit something so it has all kinds of protection for the stall, overload etc. Its a precision product made by koreans, they say its better than servo motor ;)

I can not say for sure but this may be happening when i increase the fro during operation, so closed loop stepper has high micro stepping too, i remember adjusting it as the highest it can get so maybe mach4 and ess can not catch the required pulse number when fro increased. And the reason that it happens time to time may be when both axis make small and sudden movements like small helixes while diving in to part etc. 

sorry for my english, it is rusty little bit but that is what comes to my mind after Graham's advice, what do u say?

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 20, 2022, 04:51:45 PM
Hi,

Quote
i remember adjusting it as the highest it can get so maybe mach4 and ess can not catch the required pulse number when fro increased.

Mach produces numeric data so is in no way limited by FeedRate or otherwise. The ESS has a max output frequency of 4MHz so it too is very unlikely to be pulse rate
limited. Your BoB however may be pulse rate limited and almost certainly the steppers drivers will have some  max input pulse rate.

Mai I suggest that you reduce the microstepping such that the pulse rate at max axis speed is 100kHz or less.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 20, 2022, 05:13:51 PM
Hi,

Bob is pmdx-125, yes u are right about ess and mach4 but as it seems this looks like mach4 related to me because its the one which shifts the zero point by 400mm, there is no such command in the gcode, for some reason it suddenly thinks that the axis moved forward by 400mm and tries to fix it, that is what it is doing. For what reason zero point shifts during operation? stalling came to my mind at first also but for that much shifting u have to hear a stalling noise(and u know the noise and oscillation that big steppers does) for about 6-10seconds at least. so its very close to impossible to not to hear/feel it when it happens.
 
Tomorrow i will try decreasing the microsteps , and if that doesnt fix it i can also try to make improvement for stalling, what would be your advice to fix it if we assume X axis stepper stalls(i never heard that noise during operation as i said but lets try it also) i dont want to lower the accel. too much as u know it may lead to loose positional accuracy, what would be your advice for the velocity and accel. values? Its driving 600kg of weight via 40mm diameter 5mm pitch 2000mm long ballscrew.

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 20, 2022, 05:41:40 PM
Hi,

Quote
yes u are right about ess and mach4 but as it seems this looks like mach4 related to me because its the one which shifts the zero point by 400mm,

I've been using Mach4 for seven years, and other users for as long and longer. If there were such a fault in Mach4 do you not think that it would have been detected by now?

One possibility is an extraneous g28 in the Gcode. I have seen some post processors that include g28's which will result in large unexpected excursions by the machine.
It possibility is an extraneous g92.

Craig.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: Steve Stallings on February 20, 2022, 06:59:04 PM
The PMDX-125 (and PMDX-126) provide a noise filter on step signals that limits the step rate to 500,000 steps per second.

At 30000 pulses per revolution and 5mm travel per revolution this filter would limit the commanded motion to 5000 mm per minute or about 196 inches per minute. Step commands issued at a faster rate would simply drop out. This is not a sharp cutoff value as this is an analog filter.

It also happens that the servo driver you are using specifies a maximum step frequency input of 500,000 steps per second at a 50% duty cycle. I would recommend that you provide some margin for the ESS and the PMDX-125 in case there is some duty cycle distortion.

It is likely that your stepper motor drivers have even lower limits on maximum step signal frequency.

Steve Stallings
www.PMDX.com
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 20, 2022, 07:07:38 PM
Hi,

I didnt say its a general fault of Mach4, i said its something Mach4 is doing because i can see that the zero point in Mach4 has changed after this happens, something is triggering that error in my case, i am trying to find out what it is.

If it were a general error all of u should see it, its not a general error. But its a fact that something is triggering it to happen. and the weird thing is i get all of the gcodes from hsmworks/mach3 post processor and most of them works fine without any error.

u mean instead of g28 it should code g92? I could try that also, its simple to find out if it is the problem, when i ran the code in the air, if it does the same movement in same place than its because of the g28, if its because of the gcode, error should repeat itself right?

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 20, 2022, 07:18:03 PM
Hi Steve,

Thanks for the reply, 500.000 step/second is in total for all axises? or per axis?

So u are also suggesting to decrease the micro stepping did i understand correct?

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: Steve Stallings on February 20, 2022, 07:28:33 PM
The 500,000 steps applies to each axis individually. The sum of steps for all axes does not matter.

If you are approaching this limit, then decreasing the micro stepping would be my suggestion.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 20, 2022, 08:05:53 PM
Hi,

Quote
u mean instead of g28 it should code g92?

No, I just mean that these are two codes that can produce unexpected excursions of the machine, and often not recognised if you are reading code trying to determine a fault.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 21, 2022, 04:52:05 PM
Hi,

I decreased the microsteps 1/10 and ran the same code, it finished it without any error. It seems that the problem was high microstepping which lead to high pulse numbers because of the 5mm pitch of ballscrew in small movements(helixes), machine moves very fast in those areas and Mach4+ESS generates very high number of pulses in less than a second which the stepper drives can not accept. The 3 phase 16NM stepper driver accepts max. 200khz signal so when pulse generator exceeds 200khz momentarily, stepper driver looses it.

So the correct approach in microstepping should be adjusting it to a lowest value which is enough for the required movement precision, 2 micron is what i adjusted it for today, before it was very high like below 0.05 microns of electronic precision which the machine can never perform mechanically.

To be sure i need to run at least 10 jobs but it didnt make any absurd movements in 3 jobs i ran today, so thanks to you all for the help and support.

Regards,

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 21, 2022, 05:13:48 PM
Hi,

Quote
So the correct approach in microstepping should be adjusting it to a lowest value which is enough for the required movement precision, 2 micron is what i adjusted it for today,

Close, but not quite. Increasing microstepping does not increase resolution, its nice to think it would but in practice 1/2 stepping is the highest practical and reliable resolution. You might
get an increase at 1/4 stepping but it will not be consistent. This derives from the fact the the differential torque between microsteps diminishes rapidly with increasing microstepping, and
consequently there is insufficient torque to step one micro step, but there is enough to step 1/2 step, and sometimes enuogh to step 1/4 step, but not enough to step 1/8 step.

The true value of microstepping is increased smoothness of motion. Microstepping was first proposed and implemented by astronomers whom were wishing to acieve a smoother motion from
the steppers in their telescope mounts. Microstepping, to some reasonable value, will reduce or eliminate mid-band resonance, which plagues steppers. Microstepping beyond that value it pointless,
you gain little extra 'smoothness', no extra resolution and an increased signal rate. In practice microstepping of 1/8, 1/10, and 1/16 are the maximum practical microstep regimes.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 22, 2022, 04:54:47 PM
Hi Graig,

well as manufacturers say smooth motion is the gain of microstepping but the aim is dividing 1 rotation to higher number of pulses which should increase the precision of motion u are getting from the motor/ballscrew. So 1.2 degree motor should receive 300 pulse for 1 full turn but with microstepping u double, triple or increase the pulse number 10 times, the resolution of motion with 300 pulse and 3000 pulse for 1 turn can not be same i think, if u are not loosing steps u are increasing the resolution(precision) of motion u get out of the ballscrew.

If the pitch is 5mm, in 300pulse case u get 0.016mm movement for every pulse and in 3000pulse case u get 0.0016mm movement am i right? or wrong?

U are saying in real world driver can not do 10 times microstepping but if thats the case the drivers should not work and machine wont be able to move as u command but it is moving. for example in that driver there is 30000 pulse microstepping and in that microstep resolution when i command the axis to move 1 microns it moves 1 microns.

Hakan 
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 22, 2022, 05:48:29 PM
Hi,

Quote
increase the pulse number 10 times, the resolution of motion with 300 pulse and 3000 pulse for 1 turn can not be same i think

Does not work, it would be nice but anything beyond 1/2 stepping, that is 400 pulses/rev does NOT result in increased resolution.

Let say that you have set 10 microsteps per full step, ie 2000 pulse per rev, and the current location of the rotor is at fullstep position 0.
The current in the A winding is max, say 1A, and the current in the B winding is 0A. If the driver gets a pulse it will alter the currents to:
A will reduce by 1/10th, ie 0.9A and the B winding will increase to 0.1A. The rotor would like to assume a postion 1/10th of one fullstep (1.80)
or 0.180, but the torque available to make that move is the difference between the holding torque at position 0 verses the torque at position 0.1
and that is ONLY 1/10th of the RATED holding torque. It is highly probable that the load will exceed the available torque and the rotor WILL NOT move as you had hoped.

If the drive gets a second pulse, now the A current will be 0.8A and the B current will be 0.2A. The torque from position 0 to position 0.2 is 2/10ths of the holding torque, again
probably not enough to overcome the load.

If the drive gets yet another pulse then A=0.7A and B=0.3A and the torque from 0 to 0.3 is 3/10ths which may or may not be enough to cause the rotor to move.

So you can see because of the very much reduced torque between each partial steps  the rotor will probably not move, until some indefinite number of steps
have accumulated until the is sufficient torque to overcome the load and then the rotor will move a number of microsteps and once. This is not ideal. You'd want
the rotor to move exactly 1/10th a full step at each pulse, but you may get three, four or five pulses where the rotor does not move, then all of a sudden it will, and
catch up.

If you were using 1/2 stepping most drives apply A=1A and B=1A for a torque from position 0 to position 0.5, ie 1/2 a step of 1.41 times the holding
torque and surely the rotor will move.

For this reason 1/2 stepping, ie 400 pulse per rev is the highest reliable resolution you can get from a two phase stepper.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: Steve Stallings on February 22, 2022, 05:54:24 PM
For stepper motors, the issue is with how much torque is available at the target location. The manufactures torque spec relates to how much torque is available just before the motor fails to hold position and jumps to the next set of winding poles. With a traditional two phase stepper motor, this happens at a shaft angle displacement equivalent to 1/2 of a full step.

If you are micro stepping you do not get the full torque if you only displace the shaft a small fraction of a full step. This is why the full enhanced resolution is not available in the real world. If your load required very low torque, then you could get closer to the ideal target location. Microstepping can offer significant advantages in some light duty instruments such as telescopes, but does not gain you much resolution for a router or milling machine.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 22, 2022, 05:59:18 PM
Hi,
one of the few advantages of closed loop steppers is increased resolution.

As I posted earlier open loop steppers can reliably step in 1/2 steps, ie 0.90 per pulse, but even with microstepping cannot reliably achieve any higher resolution.
With a closed loop stepper however the feedback to the drive will allow the drive to alter the A and B currents UNTIL the rotor shifts to it desired position as measured by the feedback
encoder. Thus the drive could be commanded to shift the rotor by 1/10th of a step, ie 0.180 and the drive will alter the A & B currents until 0.180 has been achieved.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 22, 2022, 06:01:10 PM
Hi Steve,

Quote
If you are micro stepping you do not get the full torque if you only displace the shaft a small fraction of a full step. This is why the full enhanced resolution is not available in the real world. If your load required very low torque, then you could get closer to the ideal target location. Microstepping can offer significant advantages in some light duty instruments such as telescopes, but does not gain you much resolution for a router or milling machine.

Very nicely and concisely  worded.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 22, 2022, 07:05:22 PM
Thanks for the detailed information Craig, also to u Steve, so we can say that microstepping is ideal for cnc machines like laser/plasma/water jet cutters or small machinery like pick and place machines which has light weighted gantries.

In my case the ideal is full step as it seems because i need the full torque from the 16nm motor, x axis motor is driving the heaviest weight in this machine.

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 22, 2022, 07:13:22 PM
Hi,
I would still use microstepping, say 1/5, 1/8, 1/10, or 1/16, to get advantage of the smoothness of motion, but when you consider your machines
'actual' resolution, calculate it as if you are using 1/2 steps, while the 'theoretical' resolution would be 1/5 or 1/8 or whatever provided there was zero load
on the stepper.

In short what you have done by implementing 1/10 th stepping is good, you get the smoothness that you want but the actual resolution will be 10um,
not 2um as you previously calculated. Still 10um is pretty damn good for any machine!

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: Steve Stallings on February 22, 2022, 07:40:32 PM
For most machine tools the best way to get higher resolution is to used a closed loop system with feedback that can measure the desired resolution and a driver that takes advantage of it.

If you want to gain more resolution from an open loop stepper using microstepping, then utilize motors with much higher torque so that the error in the angular location is not affected as much by the available torque at the microstepped locations.

For smoothness of open loop stepper systems, I usually recommend microstepping factors between 4 and 10 which do smooth things significantly without adding too much challenge to the process of generating and transmitting the step signals.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 22, 2022, 08:01:04 PM
I have an 11nm servo motor for the X axis but its gservo(made in china) brand and it does not have an auto tuning software so u have to tune it by your self manually, need to be connected to the load to adjust the gain parameters, actually i did that at first but while playing with some parameters motor did a very strange resonance it was so high that the plastic between 2 piece servo coupling literally melted. It was connected to the ballscrew at that time, it is a c3 zero backlash ballscrew which is little bit expensive so i was afraid that the balls in the nut damaged the ballscrew but again God helped and it didnt do any harm. After that incident i afraid to harm the ballscrew and removed the servo and put the stepper, thats why i am going on with the open loop stepper.

when i get a yaskawa, panasonic or delta in equivelant torque(16-20Nm) i will change it with servo, those brands have auto tuning softwares with oscilloscope screens etc. as u know.

For guys like you, who knows the details about the stuff it may be easy to tune a servo manually but guys like me who is relatively new in this stuff its a little bit risky.

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 22, 2022, 08:03:53 PM
Hi,
closed loop steppers do offer an advantage of higher resolution, but that's about the only advantage. The manufacturers claim 'they
go faster, more power, never lose steps'....pure BS. Closed loop steppers are still steppers and they lose torque at speed just like any stepper,
closed loop doesn't do squat about that.

If you want true closed loop performance, don't waste your money on closed loop steppers, get servos. A servo will eat any stepper ever made.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 22, 2022, 08:08:06 PM
Hi,
what sort of machine requires 16Nm?

I have bought and used 750W Delta B2 series servos which are 2.4Nm rated, and 7.1Nm overload and they kick arse!
While I can get 25m/min rapids and 0.25g accels, its too aggressive and I back in off to 15m/min and 0.15g....and that's still scary fast.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 23, 2022, 05:55:21 PM
Hi Craig,

This is a prototype machine that we built, its a 4 ton machine in total with 1200mm x 800mm x 500mm machining area and the x axis is the heaviest axis because u know there is y and zth axis connected to the ballscrew(its a 2 column machine like dmg dmu 340) so u have to push them at reasonable speeds and with 10um precision, now i can drive the x axis with 6000mm/minute but even with 40mm diameter 5mm pitch ballscrew and precisely leveled roller guideways 16nm is not enough(to precisely cut a perfect circle for example)in higher accelerations/speeds so i am looking for a 20Nm yaskawa or panasonic servo for the x axis.

On the other hand i saw that 11nm servo motor moved the 4 ton body front and back couple centimeters when it made sudden movements on x axis because of the inertia but for precision positioning i think its better if the torque is higher then needed.

Delta is also nice but its my second choice because approx. same price you can buy a yaskawa/panasonic from China or even from ebay if u catch the right bid.

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 23, 2022, 06:25:26 PM
Hi,

Quote
Delta is also nice but its my second choice because approx. same price you can buy a yaskawa/panasonic from China or even from ebay if u catch the right bid.

All the sites I seen selling Yaskawa are  double and triple for the equivalent Delta.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 23, 2022, 06:31:58 PM
Hi,
I did the calculations with my 32mm diameter 5mm pitch screws and the inertia is totally dominated by the rotational inertia of the ballscrew, not the 150kg axis weight.

The breakdown went like this:
85% rotational inertia of the ballscrew
10% rotational inertia of the servo rotor
5% linear inertia of the axis.

Given that the first moment of inertia of a ballscrew goes as the fourth power of diameter I would guess you situation more like 92% of the inertia is in the ballscrew.
Why such large diameter screws? Mine were outsized at 32mm...but they were what I could get.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 23, 2022, 07:49:50 PM
Hi Craig,

u can check taobao.com u can get good equipment from there with good prices sometimes.

I got the diameter big for stiffness, i am driving the axis from one side, u should drive that kind of axis from double side normally, if u do so u can use smaller diameter(32mm) ballscrews but if u do it on one side for the machining precision bigger diameter is the better.

Hakan
 
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 23, 2022, 09:05:57 PM
Hi Hakan,
I think your'e over doing it, even 32mm has a stiffness of 1100N/um, easily twenty times the stiffness of my machine. Many comments I garnered from CNCZone concluded
that my ballscrews were too big for my machine, 800kg, with 150kg X axis weight.

I would expect 40mm diameter screws to be found on machines requiring 100kN or more of thrust and an X axis weight of tonnes...not hundreds of kg's but tonnes.

When I was finding parts for my new mill I like you thought the bigger the ballscrew the better...right? Wrong, a large diameter ballscrew, or at least an out-size ballscrew, requires huge torque
just to accelerate and that counts against toolpath following. As it turns out I can still get 0.25g with the ballscrews I've got with 750W servos, but I would have done even better with 25mm
ballscrews. When it comes to rotating components bigger is not always....or even normally....better.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 24, 2022, 05:48:54 PM
Hi Craig,

You are right, i know that its not just the g, one side pushing of a gantry heavier than lets say 250kg will likely create more wobble on thinner ballscrews since the x axis is the longest (ballscrew length is 2000mm) i got 40mm because of that, just to make sure. So its not just to create higher torque, wobble in the ballscrew will kill the c3 precision according to the manufacturer TBI, they advised it for the length of the axis and weight of the gantry. U can drive an axis which weighs 2 ton with that ;-)

They are good at what they are doing for example i thought to use the ballscrew on the zth axis one end open, thats the way some bigger manufacturers like makino use ballscrews on zth axis just to keep it short but engineers in TBI said u should never use a ballscrew like that because it will shorten its life. And if u want precision they said always fix the opposite end with c3 bearings. so i dont know how the manufacturers use it like that and keep up with the precision.

U auto tuned the delta servos with their pc software right? Is it easy to tune them? is it full automatic or u had to tune them manually?

Also, do u think an oscilloscope will be helpful for manually tuning the servos? i still wanna use 11nm 130mm flange servo, its worst performance is still better than open loop stepper i guess. Can i tune it by seeing the signals on oscilloscope? i never used an oscilloscope before but is it useful for this purpose?

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 24, 2022, 06:40:15 PM
Hi,
OK, so using manufacturers recommendation is good practice, but that does mean large and expensive ballscrews which will in turn require large and expensive servos,
but that's the nature of CNC.

Yes I used Auto-tune and its pretty straight forward. I did tweak the parameters manually, but its dubious that I made any improvements over Auto-tune, having said that
I did not use the scope, so it probably it not surprising that I could not secure any noticeable improvement.

The inertia ratio in my machine is about 5:1, and is very much within the 'sweet spot' for Auto-tune. At inertia ratios of 10:1 manual retuning after Auto-tune
would be common. At 20:1 I think you can forget Auto-tune, manual tuning is probably your only choice.

Quote
Also, do u think an oscilloscope will be helpful for manually tuning the servos?

I didn't bother, my machine PC is to gutless to do a good job with the software scope. If I were to revisit it I would use a more powerful development PC to run the tuning and set-up software
that would allow me to use the software oscilloscope.

Quote
i still wanna use 11nm 130mm flange servo, its worst performance is still better than open loop stepper i guess. Can i tune it by seeing the signals on oscilloscope? i never used an oscilloscope before but is it useful for this purpose?
 

I am a relative newcomer to AC servos but my experience is they far FAR FAR outperform steppers. They, in practice, seem to be rather more powerful than the specs suggest. I believe
that it because of the overload properties of servos. When a stepper overloads it stalls, no ifs or buts, it just stalls. A servo on the other hand just 'digs' in and does the job.

I you give me some numbers I will do the inertia calculation for you. I can tell you at a glance that the inertia is DOMINATED by the huge ballscrews, the 250kg axis is nothing, likely less than
5% of overall inertia.

What I need is the diameter, length and pitch of the ballscrew, any gear/belt reduction if used, and the weight of the axis and associated linearly moving components. The inertia of the servo
would be helpful, but we can make a pretty good ballpark guess on that.

Once we have the inertia equation then equation then the questions about use of the scope can be answered. If the inertia ratio is moderate then you don't really need to manual
tune....although it is instructive to do so, particularly with a scope to observe the results rather than inferring from movement data.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 26, 2022, 07:13:06 PM
Hi Craig,

sorry for the late reply,

diameter:40mm pitch:5mm length:2000mm, the weight of the axis(both Y and Zth) is 600kg, servo is 11nm 2.2kw AC servo, i connect the motor to ballscrew with direct coupling.

I asked about the oscilloscope because i think to buy one from taobao next month if i can tune the servo with it, it would be very nice because this servo driver has no auto tuning. Its a servo motor at the end there is no meaning to leave it there idle.

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 27, 2022, 01:54:21 AM
Hi,

Quote
I asked about the oscilloscope because i think to buy one from taobao next month if i can tune the servo with it, it would be very nice because this servo driver has no auto tuning. Its a servo motor at the end there is no meaning to leave it there idle.

Its not going to help. For instance you need to monitor the error between the commanded position and the actual position.
Both are numeric quantities that cannot be displayed by a regular oscilloscope. The oscilloscope provided in the set-up and tuning software
takes those numeric values and displays them, but those value are specific to each servo manufacturer. You might say that its a software scope,
a regular hardware scope will not help.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 27, 2022, 03:11:02 PM
Hi,


The mass of the ballscrew:

mass= 0.022. 2. PI.8000    (radius of ballscrew =0.02m, length=2m, density of steel =8000kg/m3)
   =20.1kg
First moment of inertia of a cylinder:

Iballscrew=1/2 . m. r2
   =0.5 x 20.1 x 0.022 
  =40.2 x 10-4 kg.m2

The first moment of inertia of my 750W Delta servo  is 1.13 x 10-4 kg.m2 so your 2.2kW servo will be more, much more lets guess 6 x 10-4 kg.m2

Iservo=6 x 10-4 kg.m2

The equivalent first moment of inertia of the linear axis:
Ilinear= mass. (p/2.PI)2       (p is the pitch=0.005m and mass is the linear axis mass=600kg)
   =600 x (.005/2 x PI)2
   =3.8 x 10-4  kg.m2

So the total first moment is:

Itotal=(40.2 + 6 +3.8 ) x 10-4 kg.m2
   =49.8 x 10-4 kg.m2

Very obviously, and as I predicted, the rotational inertia of the ballscrew dominates  81%, with the armature of the servo in second spot with 12% and the 600kg axis at only 7%.

This result may surprise you but because the ballscrew and the armature have to rotate SO fast while the axis moves but only slowly, the inertia is totally dominated (93%) by the rotating
components and the 600kg axis mass adds only 7%!!!!.

Angular acceleration=torque/ first moment of inertia
  =11 Nm/ 48.9 x 10-4
   =2249 rad.s-2

Converting to linear acceleration:

accellinear=accelangular.(p/ 2.PI)
   =1.79 m.s-2

or  0.18g   which is not too shabby for a 600kg axis.
The inertia ratio is:
Inertia ratio= (Iballscrew+Ilinear)/Iservo
  =7.3

So most good servo software should handle this inertia ratio well, and manual tuning will probablt not get you much extra.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 27, 2022, 06:14:58 PM
Hi,
just seen a 2kW Delta servo, 130mm flange , and it has a moment of inertia of 14.59 kg.m2.

I took my 750W Delta and multiplied by four to come up with a guess for your servo, may be its not enough. It's still not going to change
the fact that the ballscrew vastly dominates the inertia equation.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 27, 2022, 09:06:09 PM
Hi,
whoops, typo in previous post; should be 14.59 x 10-4 kg.m2.

I was only a factor of 10,000 out!

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on February 28, 2022, 07:03:28 PM
Hi Craig,

So we can say 2.2kw servo can drive the 600kg of mass with 1.79ms speed right?

ok now i have to find a way to tune this servo without harming the equipment which it will be connected.

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on February 28, 2022, 07:28:04 PM
Hi,

Quote
So we can say 2.2kw servo can drive the 600kg of mass with 1.79ms speed right?

No, not speed but acceleration. An 11Nm torque will cause the 600kg axis to accelerate at 1.79m/s2.

The ultimate speed will depend on the servo. What is the rated speed of the servo?. These medium inertia servos are often 2000 rpm or 1500 rpm rated.
lets say 2000rpm, then the max ultimate speed is:

Vmax= Nmax.p /60 m/s
  =2000 x 0.005 /60
  =0.1666m/s  or 10m/min.

With an acceleration of 1.79m/s2 the time taken to reach Vmax:
taccel=Vmax/acceleration
  =0.1666 / 1.79
  =0.0927 s or 93ms.

93ms from standstill to Vmax is pretty good, and my guess is that your machine will lurch around and you'll probably want to slow it down.
My machine is capable of 25m/min and acceleration of 2.7m/s2, but I slow it down to 15m/s and 1.5m/s2 and even then its still scary fast.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on March 03, 2022, 05:27:54 PM
Hi Craig,

Yes i slow it down to 5m/min, its still very fast for the size.

Do u have any advice for the manual servo tuning? I know that linuxcnc has an internal oscilloscope so that u can check the actual movement and commanded movement and try to bring them closer in a graphic window by tuning the driver parameters but Mach4 has no such an option, so any advice?

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on March 03, 2022, 05:32:34 PM
Hi,
that is usually provided by the servo tuning software.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: RecceDG on March 04, 2022, 11:58:41 AM
> If you want true closed loop performance, don't waste your money on closed loop steppers, get servos. A servo will eat any stepper ever made.

While I agree that servos are vastly better than steppers - my ongoing PM25-class mill conversion will use ClearPath servos - closed-loop steppers are WAY better than open loop:

1. The driver will pick up on a missed step and "try again", meaning when you are getting marginal on power you get some backstop; and

2. Outright failure to reach the commanded position errors out and stops the machine - which is a HUGE safety feature.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: joeaverage on March 04, 2022, 01:48:27 PM
Hi,

Quote
1. The driver will pick up on a missed step and "try again", meaning when you are getting marginal on power you get some backstop; and

The problem with that is that IF a stepper misses a step its because it is marginally overloaded, so any extra step inserted to catch up is likely to be missed as well.
The manufacturers claim that closed loop increases the power, pure BS.  Closed loop steppers are no more powerful than their open loop counterparts
of the same spec.

Quote
2. Outright failure to reach the commanded position errors out and stops the machine - which is a HUGE safety feature.

This is correct, and is a distinct and clear advantage of closed loop steppers over open loop steppers.

One feature that you did not mention was that closed loop steppers can interpolate between full steps whereas open loop steppers can do
1/2 steps reliably but no finer. Thus closed loop steppers have genuinely better resolution than open loop steppers.

These two features are to my knowledge the only two genuine advantages that closed loop steppers enjoy. My contention is that the premium
paid for closed loop steppers is not justified by these two features alone. Others may have a different opinion.

Genuine AC servos are still quite a bit more than closed loop steppers, say 25% or so, and if you are going to pay a premium then servos are  worth
the extra. There again that is my opinion, others may differ with that. The principle advantage that a servo has is overload capacity.
When a stepper (open or closed loop) gets overloaded it misses steps or stalls, no ifs or buts, it just stalls, whereas a servo just 'digs' into
its overload capacity, typically 3-4 times its rated output, and just does the job. The short term overload capability of a servo means that it
seems to have MUCH greater output than the specs suggest whereas steppers never seem to quite live up to their specs.

Craig
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on March 04, 2022, 08:04:39 PM
Hi,

The problem that i thought we fixed by decreasing the microstepping came back today while machining a wood mold, this time i was touching to the ballscrew because cv_feedrate was not on so that the machine was shaking while turning the corners and i was touching the ballscrew to see if it is because of the X axis motor, so i felt the stall by chance when it did it. But this time it was for a very short period of time like a second or so and machine miss aligned the gcode by 1cm(or so) on the x axis.

This happens when i play with the FRO, because today the tip of the endmill was not touching to the part so i didnt want to loose time and increased the feedrate by %150 and in one of the sharp corners machine did this error.

obviously decreasing the microstepping 10 times fixed the error to some extend but x, y and zth axis are all within the range of pulse frequency of pmdx bob, ess and motor drivers so i dont know what mach4 does when u increase the FRO but thats what is causing this error(as it seems microstepping was exaggerating it).

In actual feedrate(the feedrate embedded in the gcode) there is no error what so ever but when u increase the FRO this happens once in a while, hard to say when exactly.

Hakan
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: RecceDG on March 05, 2022, 02:00:02 PM

The manufacturers claim that closed loop increases the power, pure BS. 


Agreed - although the "try again" feature adds a little fault-tolerance for transitional spikes. This won't let you routinely run hard up against the motor's power limit, but it can save a job that would have missed a step or two on a transient load.

Quote
This is correct, and is a distinct and clear advantage of closed loop steppers over open loop steppers.

And it's the primary reason why I recommend them over open-loop steppers. "Can't get there" immediately stops that axis, and you can connect the error line so the driver can notify Mach and stop the whole machine.

Open loop steppers just keep pushing and trust you to notice the problem and e-stop. Unsat!


Quote
One feature that you did not mention was that closed loop steppers can interpolate between full steps whereas open loop steppers can do
1/2 steps reliably but no finer. Thus closed loop steppers have genuinely better resolution than open loop steppers.

I haven't seen this play out in my application - I changed my lathe X axis from open loop to closed loop - but that might be me not recognizing the error in the first place, or misattributing the source.

Quote
My contention is that the premium paid for closed loop steppers is not justified by these two features alone.

There really is not much of a price premium to pay, something on the order of $50 per motor/driver combo to get closed loop. And they can be had in integral driver/motor packages (like a ClearPath servo) where the motor driver is built into the motor housing. You run power and logic-level step and direction out to the motor, and take a logic-level alarm signal back.

Honestly, there's no good reason to ever use an open-loop stepper any more.

Servos are better than steppers, but the price differential is substantial.

My lathe was a good candidate for steppers, because the max axis speeds I need are well within stepper ranges, and the weak link is the spindle power (I will stall the spindle before I stall an axis).

https://www.youtube.com/watch?v=wnsZTu_pA9s

But the mill will be servos.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: RecceDG on March 05, 2022, 02:08:32 PM
Hi,

The problem that i thought we fixed by decreasing the microstepping came back today while machining a wood mold,

Hakan

I feel like this is a motor tuning problem, either in max motor speed, max motor acceleration, or maybe both.

It isn't that there's a problem in the FRO, it's that you are using FRO to push the motor into an unstable state.

I'd set up a pair of dial indicators and ping-pong between them at ever-increasing rapid speeds to see what max rapid you can get away with before you start losing steps, and then a similar test in sacrificial material, cutting first straight lines (in each axis) then squares, then circles, and see if you can isolate a motor speed at which the trouble starts. Then play with the acceleration tuning and see if that changes anything.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on March 05, 2022, 04:27:03 PM
Hi RecceDG,

This does not happen when u move the x alone, this happens when couple or more axis move simultaneously, i decreased the speed and acceleration and go on working like that after this happens last time but i am not sure thats the problem(it was already adjusted to half speed that 3phase 16nm motor can drive)

and when this happened the feedrate in gcode was 300mm/min i increased it to 750mm/min or so with the FRO, 750mm/min is not fast, actual speed that x can do with the 16nm stepper(keeping the 10-15um accuracy) is 3000mm/min in my case.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: Steve Stallings on March 05, 2022, 04:31:26 PM
It is not a good idea to push feed rate up more than 20% or so with FRO because the trajectory planning was done at the original speed. If you really want to do 100% or more speed change, code it for maximum speed and turn it down to 50% for regular run.
Title: Re: dangerous malfunction of a machine driven by Mach4
Post by: hyildiz on March 05, 2022, 04:47:02 PM
Hi Steve,

That is the problem i am facing with i think too, increasing FRO %100 messes up the control, u explained it technically of course, i am gonna do it like that by manipulating the gcode from now on, thanks.

Hakan