Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: MechanoMan on February 15, 2015, 04:43:04 PM

Title: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 15, 2015, 04:43:04 PM
I hooked up my X200 VFD (older blue one, not the new black one) into an RS485 link alongside the Ethernet Smoothstepper and built a basic Brain for it.  Speed and RPM control are ok.  RPM control is through the command bus, not PWM.

Problems I noted:

1.  The spindle RPM cannot be displayed on Mach3's RPM field.  I was told this was impossible to do because Mach3, for whatever reason, didn't allow the RPM field to be written via Brains.  Is that correct?  I tried using a Brain to write a constant number to it and no, it can't be written.

2. Mach3 cannot detect that the spindle is actually running.  Or, for that matter, that the VFD even has its breaker on.  It needs feedback for RPM and/or VFD errors I guess and throw an E-stop if it's not there.  But my first note is that is it not always an error for the VFD RPM to be 0 when the Target RPM is 10,000 RPM, because that's normal for the very first moments after the Target RPM is set.  
It also needs to stop trying to send the RS485 RPM command, because if the VFD's breaker is off and Mach3's console has the Spindle left "on"  because of operator error, I'd rather the spindle not spin up on its own when I reset the VFD's breaker.  If it threw itself into E-stop automatically when it didn't get spindle RPM, that problem should have resolved itself with an E-Stop.

3.  My greatest concern here- say Mach3 crashes.  Or the Ethernet cable to the Smoothstepper pulls out.  Or the 120v breaker pops (the VFD is on a different 208v 3ph breaker).  I don't expect the VFD to shut down, it will continue running since it was last given the RPM command and doesn't require ongoing commands to stay running.  How can I institute a hardware failsafe for this?  I have an Ethernet Smoothstepper here.  VFD control is all through the RS485 control bus on a separate link from the PC, I don't want to do with PWM throttle control for it.

4.  I did see a case where hitting Feed Hold stopped the spindle and when Resuming, it failed to restart the spindle.  Why would that happen?  Like I say, it restarted the spindle elsewhere immediately upon powering up the VFD breaker, so it's continuously sending the RS485 RPM command to the VFD.  IIRC in that case I hit Spindle Reset manually to adjust the work, but Mach3 didn't realize the spindle should be "on" again to resume, which is dangerous.






Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: BR549 on February 15, 2015, 05:39:21 PM
Bringing the VFD into Mach3 though the brains is NOT a good idea. You should use a plugin which has fulll control of Mach3 assets and functions.  As is you have a dangerous situation where Mach3 is NOT in full control of the spindle NOR is the operater protected from the spindle running when Mach3 is offline. Also it is a BAD idea to turn breakers on/off as switches UNLESS the breaker is switch rated.

All Estops should be mechanical in nature NOT controlled through software. Even if you used Mach3's failsafe IT to can fail in a PC crash leaving your spindle running.

There are some examples of VFD plugins in the plugins section you may find one that works for your application or contact the AUTHOR for help making your work with it.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 15, 2015, 05:58:04 PM
First... you are getting WAY over paranoid about the "What If's" especially with item #3. Years ago I had a boss that was overly paranoid and analyzed everything to death. I called it "Analysis Paralysis"... :)  

If you were using a PLC all the concerns you have could be fairly easily addressed. But now we are talking system design and integration on a much different level.

Most, if not all, VFD's have two programmable output contact (relays) that can be setup to monitor drive functions such as "drive running", "at speed", "Drive faulted", etc. and probably a couple of dozen drive parameters.... as well as programmable digital inputs. And most are Modbus compatible which expands the options. I'm not sure about the older X200 VFD but this stuff has been around since the early 80's. Nothing new here.

You could have the drive monitor the charge pump enable and Mach 3 monitor the drive status via the E-stop input wired in series with the drive relay contact... probably a half dozen ways to make it work. Just figure out the logic to make it happen.      

Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: BR549 on February 15, 2015, 06:03:02 PM
Be Careful of the Mach3 charge pump signal it CAN run with Mach3 crashed.

Just a thought, (;-) TP
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 15, 2015, 06:04:30 PM
Good point BR549.  If this setup is being used in a commercial or industrial application then personnel safety is #1. E-stops can not be a function of a PLC or PC and must be hard wired to be fail safe to remove sources of energy. Only Siemens PLC's has recently been certified to to perform e-stop functions. Siemens fail safe logic is very complex.
 
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 15, 2015, 07:30:43 PM
Bringing the VFD into Mach3 though the brains is NOT a good idea. You should use a plugin which has fulll control of Mach3 assets and functions.  As is you have a dangerous situation where Mach3 is NOT in full control of the spindle NOR is the operater protected from the spindle running when Mach3 is offline. Also it is a BAD idea to turn breakers on/off as switches UNLESS the breaker is switch rated.

All Estops should be mechanical in nature NOT controlled through software. Even if you used Mach3's failsafe IT to can fail in a PC crash leaving your spindle running.

There are some examples of VFD plugins in the plugins section you may find one that works for your application or contact the AUTHOR for help making your work with it.

Not sure what you're saying.  Where's this plugin?  It's a common VFD but I've never found a plugin for it. 
Yes I know a stop should be controlled by hardware.  That's what I said.  The question was how.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: BR549 on February 15, 2015, 08:01:08 PM
http://www.machsupport.com/forum/index.php/topic,22806.0.html

In this directory there are seveal examples of VFD plugins.

(;-0 TP
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 16, 2015, 04:21:36 AM
http://www.machsupport.com/forum/index.php/topic,22806.0.html

In this directory there are seveal examples of VFD plugins.

(;-0 TP
But that's a compiled DLL for a Huanyang.  I don't see any way to apply that to this.

BTW I also noted that pressing STOP FIRST commands the spindle off, but the axes kept moving for a short time.  That's super-bad, it's plowing through the material with the spindle running on nothing but remaining inertia.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: BR549 on February 17, 2015, 03:18:47 AM
" you may find one that works for your application or contact the AUTHOR for help making yours work with it."

(;-) TP
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: BR549 on February 17, 2015, 03:22:19 AM
Pressing STOP in Mach3 should STOP the axis dead in their tracks NO movement.

(;-)TP
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 17, 2015, 10:24:34 AM
Pressing STOP in Mach3 should STOP the axis dead in their tracks NO movement.

(;-)TP


That's the way mine works.... pressing "STOP" kills any axis movement and raises the Z axis to home position. If your axis is still moving something is wrong or maybe you are using "Feed Hold" which will continue movement until the buffer is empty. I use "Stop" and "Run From Here" instead of "Feed Hold" to prevent tool crashing.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 17, 2015, 06:05:56 PM
Yeah I think I meant "feed hold".  I think that's the case where it shut down the spindle first but kept moving the axes.

Help me out here.  Feed hold can take a LONG time to stop, too long if there's a problem, even if the spindle getting stopped early wasn't happening.  But if I hit Stop, that can make the machine lose its position.  At least that's what the ESS plugin says.  It raises an error message in Mach3 that the Smoothstepper ran out of data and the position may be lost.  So it's no better than E-Stop in that regard.  Plus the Stop message is super-annoying, it throws itself on the screen and must be "OK"'ed manually to continue.

It's not unusual to see a problem with the work getting loose or realizing a hole was being drilled too deep.  I don't want to lose the machine's position here, that usually means ditching the stock and starting over again.  Is there any way to make it slow to a stop much sooner?  I did set the "lookahead" to 200 lines, but that doesn't change anything, does it?
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: BR549 on February 17, 2015, 06:34:34 PM
Bring the look ahead down to 10 or 20 that will speed UP the Stop process on feedhold as the buffer is not so large.

Just because you STOP and loose position  does NOT mean you cannot RESTART the program . IF you had refhomed the machine at startup then you simple refhome it again and start from a safe spot in the gcode with Run from Here.

(;-) TP

Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 17, 2015, 07:36:21 PM
The LookAhead is actually the buffer size that must be emptied?  Wow.  I thought that was just the lookahead for trajectory planning.

I was manually homing.  The machine doesn't have homing switches yet.  So losing machine position is kinda fatal.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 17, 2015, 08:58:50 PM
Ok... now getting more info as to the REAL problem. The ESS running out of data and losing position fault message is not a Mach 3 problem. It's a result of the ESS not configured correctly.

First... make sure you have the latest ESS plugin from the Warp 9 site.

1) Go to the ESS config page and change the Data Rate (upper left hand side) from the default 4Khz to 1Khz or 2Khz.
2) Calculate the ESS motor step frequency (right under the data rate box) and set for lowest frequency equal to or just above the calculated value. The Warp9 website has the procedure to figure this number. Or set the motor step freq number to the lowest one which I believe is 32khz.  
3) In Mach 3 set the kernel rate for 25Khz. The ESS does all the step calculations independent of Mach 3 so setting the kernel above 25khz just wastes PC CPU time and resources and adds absolutely nothing.  Also... it's been reported setting the kernel higher than 25Khz can result in Mach 3 calculation, DRO and trajectory errors with ESS.
4) Use Mach 3 ver 0.62. This version works with ESS and is recommend by Warp9. Do NOT, repeat NOT use V0.66... it has problems and should be avoided.
5) Set Mach 3 Look Ahead to 200.
6) Set CV to ON and turn off all other CV settings such as CV Dist, CV Speed, CV Stop angle. CV speed and dist is broken in Mach 3 anyway.

The Ess "Running out of data fault" is caused because the ESS buffer is running out of data (make sense right?)... the PC can't supply it fast enough. If you are still getting the fault change the ESS data rate to 1Khz. BTW... if you are wondering, increasing the Mach 3 kernel rate and the look ahead will NOT fix this problem.  

Now... run a G-code program and hit Mach 3 "Stop"... I bet the machine stops dead, G-code stops, Z axis goes up to home, VFD shuts off and no ESS error messages. Do NOT use Feed Hold. Then use Run From Here command... the program will start right where the Stop command was issued.

The Feed Hold function doesn't really work as one would assume unless you are running a very small look ahead buffer like 5... but this just creates other problems.

I have a ESS and run Mach 3 V0.62 with a VFD and it works good. I was getting running out of data faults after running 25 or 30 lines of code. Once I configured the ESS correctly... no more problems.    



  
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 18, 2015, 02:31:26 AM
OK, tried all that.  Feedhold takes like 2 sec to stop on 3D carving with a lot of vectors.

Stop takes a full second- and still generates the "Smoothstepper ran out of data and probably lost position" error.

Played with the field of whether Mach3 or Smoothstepper implements Feedhold- no difference I can see.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 18, 2015, 07:26:33 AM
Why are you STILL using Feed Hold?? Only use the stop command. Are you sure you set up the ESS correctly.

Open the ESS config page.... in the lower left hand set "Line PreCalculated" to 2000. 
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 18, 2015, 07:51:05 PM
The Feed Hold name is misleading and the function should be removed from Mach 3 or made to work properly. With Mach 4 somewhat released all hope of fixing any Mach 3 bugs are a lost cause. I refuse to pay $200 for the privilege of installing an incomplete Mach 4 so I have no idea if Feed Hold works any better.  

What happens from my observations is it stops Mach 3 G-code processing but never send a stop command to the external motion controller. So... the external motion controller simply runs out of data when the Mach 3 buffer empties. This is the motion delay you are seeing. In the case of ESS, without a "stop" command being sent and runs out of data, it triggers a data failure and stops all motion. Same happens using Feed Hold with a PP... motion continues until Mach 3's buffer empties. This is dangerous IMO.

Using the Mach 3 "STOP" command an actual stop signal is sent to ESS so its not expecting more data and all motion immediately suspended until a "Run From Here" and then "Start" is received. That's why I said not to use Feed Hold... but for some reason you are insistent to keep using it.

The definition of insanity is doing the same thing over and over and expecting different results. (Albert Einstein)  
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 18, 2015, 08:13:24 PM
I only mentioned Feed Hold for information.  I just want a Stop ASAP, without losing position, which means following the acceleration rules.  It might also necessitate having to complete the current G-code line (which could in some cases be a long move) if the program doesn't want to get too complicated.

But it's not doing that.  It's keeping a LONG buffer of operations around that it has to do through- for this 3D carving, there's a lot of moves in the 1 sec it takes to Stop, and yet still seems to fail to use acceleration rules, assuming the error message that comes up is accurate.

Knowing FeedHold takes even longer- 2 sec- is stranger knowing that it's taking longer than the commands already buffered.  But FeedHold seems to be the only way to accomplish a "correct" pause, provided the reason for the pause isn't too urgent.  Pushing "Stop" seems little different than "E-Stop" right now- you lose position, which seems to make it useless.

BTW, also, hitting FeedHold THEN Stop doesn't cause the "ethernet SmoothStepper ran out of data and probably lost position" error.  For what it's worth.

Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 19, 2015, 02:44:32 AM
Well I played with it some more tonight.  Nothing makes it Stop without error, or FeedHold soon enough.

The time to stop does scale with the reciprocal of Data Rate for both FeedHold and stop.  If I select 4KHz, FeedHold does stop within like 1 sec.  Which is better, but still not all that usable.  And the Stop still generates an ESS error, of course.  
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 19, 2015, 10:50:40 AM
What kind of stepper driver are you using? i.e. Gecko or a Chinese unit? I have a Gecko 540. Chinese TB6550 steppers do strange things and most never work right or fail all together.  

I'm out of suggestions. I'm convinced something in your Mach or ESS setup is not right. I have a old clunker Dell 6400 running XP home addition, 2gig memory... Mach V0.62. My ESS setup for 1khz data rate, 32Khz for steppers, precalc of 2000 and my system works without any issues. When I first started using ESS with the default setting of 4Khz I would get a out of data error after 20 or 30 lines of code especially with long x and y axis movement.

Pressing Mach "STOP"... x,y motion stops instantly, Z retracts to home, VFD shuts off.  G-code stops at the line the STOP command was issued. Then doing a "Run From Here" ---> "Start", it continues right where it left off. No ESS errors. I've run 3D Aspire files of 180,000 lines no problem.  

Feed Hold function in Mach 3 is a broken function and dangerous it should be fixed or removed. Maybe one of these years ArtSoft will have a version of Mach 4 where Feed Hold and CV actually work.  

The definition of insanity is doing the same thing over and over and expecting a different result. - Albert Einstein
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: ger21 on February 19, 2015, 11:29:30 AM
I just want a Stop ASAP, without losing position, which means following the acceleration rules.

The only way to do that is to use Feedhold, followed by Stop (after motion stops).
Using Stop by itself will ALWAYS result in loss of position.

Get some home switches, and use EStop if you need to stop quickly. With home switches, you can quickly restart where you left off.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 19, 2015, 01:47:11 PM
I just want a Stop ASAP, without losing position, which means following the acceleration rules.

The only way to do that is to use Feedhold, followed by Stop (after motion stops).
Using Stop by itself will ALWAYS result in loss of position.

Get some home switches, and use EStop if you need to stop quickly. With home switches, you can quickly restart where you left off.
So it's broken "for sure" then?  There's actually no way to make it come to a stop right away without ignoring acceleration and losing position?
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 19, 2015, 04:20:49 PM
Open the ESS config page and make sure the "Feed Hold Controlled by Mach 3" is checked. Do not use Controlled by ESS. The verify you setup ESS and Mach as I suggested several postings back.

Using stop will NOT result in a loss of position. When you are ready to resume cutting select "Run From Here" then "Start". A pop up window will open warning the axis is about to move, select OK, then select "Start" again. Note the G-code line number when Stop was pressed and again when "Run From Here" is selected.  If Mach and ESS are setup correctly cutting will start exactly when it left off.

On my system when I hit "Stop" (not E-stop)... x,y axis stop dead... Z retracts. Using the above steps I can resume cutting right where I left off... done it many times without issue.

Home switches will not solve your problem. Again, I'm convinced you have something setup incorrectly because you are all over the map troubleshooting, making changes, fixated on Feed Hold and acceleration for some reason. Could be your profile is corrupt. If you post your XML file I will take a look.    

As I said a few times... Feed Hold does not function as one would assume and it should be removed from Mach to prevent confusion and broken tool bits.



  
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 19, 2015, 05:14:31 PM
I'm "fixated" on FeedHold only in that it's the one that actually operates without losing the position at the moment.

I tried both "Feed Hold controlled by Mach3" and "Feed Hold controlled by SmoothStepper".  Neither worked better.  

Not sure who to listed to.  ger21 says the opposite here, that Stop never worked without killing position.

My XML is not very complicated here.

How do you set it up to Z-retract?  Mine just stops dead where it is.  Z-retract seems to be a significant thing, because it sounds like it needs an arbitrary Z-height to go to.  Hmm that's a thing because often it's easier to zero the Z-axis on the work surface and carve in reference to that; if you did that with exceptionally thick material and used work coordinates the Z-retract could hit the machine's z-height limit.  geh7552, you clearly have something different going on, I'd like to know more.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: ger21 on February 19, 2015, 05:30:37 PM
Unless the Smoothstepper treats Stop as a feedhold, Stop will lose position, because it doesn't decelerate.

Feedhold is not "broken", it's just the way it works in a buffered system. It can't stop until the buffer is empty.

Go to Config > Safe Z and check the box to go to Safe Z on Stop. Safe Z must be enabled for it to work.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 19, 2015, 05:36:56 PM
With all due respect, it's utter b.s. that a buffered system HAS to work that way.  World's full of buffered systems that alter the plan partway through, and for a realtime control system, it needs to be able to do so.

It's also not explaining why Stop still has to run out of data and lose its position. 





Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: ger21 on February 19, 2015, 05:51:49 PM
Stop loses position because it doesn't decelerate. That's why there's a Feedhold.
Fwiw, Feedhold in Mach4 is supposed to be instant. Unfortunately, mach4 has already taken 2 years too long.

I can't tell you why the SS doesn't work with Stop.

Mach3 has lots of minor issues like this that will never be fixed. That's why there's a Mach4.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 19, 2015, 08:24:12 PM
Ok... let's start again from the beginning. BTW... I'm using Ger21 screen set which should have nothing to do with the problem.

Post your XML file please and are you using a custom screen set or Mach's standard screen set?

1) Create a NEW clean profile. I've seen profiles get flaky after making a bunch of changes even though it shouldn't. Don't worry about the VFD plugins for now.

2) You are using a Ethernet SS right....? Not the USB version. Make sure you are using Mach V0.62 and latest ESS plugin.

3) What type of PC and Windows are you using?

4) What make/model of stepper driver are you using?

5) What is you steps per unit settings and speeds?

6) In Mach set the kernel speed for 25khz. Make sure "Safe Z on stop" is checked.

7) Open ESS config page: Set data rate for 1khz, motor freq for 32Khz, Number of Lines PreCalc=2000.  
 
Let me know the above info and we can work from there.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: MechanoMan on February 20, 2015, 06:01:16 AM
Hmm I tried again with 4KHz on the Data Rate.  It's... hey it's doing what I want!  The Stop is pretty immediate, and it's NOT giving the "position lost" error.

Also, bonus... I have the XHC wireless pendant.  It's been "great to have" but the response through Mach3 was super-laggy.  NOW it's behaving MUCH better!

I swore I tested it with 4KHz before.  I wonder if I could have reset the Data Rate before but somehow forgot to reboot Mach3?  Maybe power on the SmoothStepper had to be cycled and that wasn't mentioned?  Dunno but it's looking great!

I think the 4KHz Data Rate is important here.  It reduces the buffer's time length a lot.

It's a 48v G540 with 381oz-in steppers, rack-and-pinion.  That was moving at 1200 ipm no problem.  Toned it down to 600 ipm because there wasn't a reason to be doing that.

Grey Cary of Warp9 just emailed me back- unless you do a FeedHold, Stop will always cause some loss of DATA, and that it stems from Mach3's mechanics and can't be fixed except with Mach4.  I interpret that as saying position may not be lost, but it won't necessarily pick up in exactly the right place to follow the exact same path as if Stop had not been used.  Probably quite small.
Title: Re: Safer connection from Mach3 to X200 VFD?
Post by: geh7552 on February 20, 2015, 08:19:50 AM
I use stop--> Run from Here --> Start all the time... never an issue. If you use Stop and then Start (not using "Run from here" before the start) you will lose some position.