Hello Guest it is April 25, 2024, 03:18:10 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - smurph

41
Mach4 General Discussion / Re: Avid cnc dual Z
« on: November 29, 2022, 05:37:18 PM »
TimmyJ,

The programming is not as bad as it first appears.
I am not a programmer either and it took me a while to understand.
I made this to help other non programmers.
it should give you a good starting point.

https://www.machsupport.com/forum/index.php?action=dlattach;topic=43260.0;attach=54239

Bill
I'm glad you posted that, Bill.  You did a fine cliff notes++ there!  I thought I had bookmarked that thread and I guess I must have deleted it accidently.  I have too many bookmarks...  LOL 

https://www.youtube.com/watch?v=hnBL3ox5rpQ
take a look
its double z, double y ,Atc, Rotate axiss
all this mach4
That is an impressive machine!!! 

42
Mach4 General Discussion / Re: Avid cnc dual Z
« on: November 29, 2022, 03:59:34 PM »
Confusing how a dual Z isn't more popular.
What percentage of the router market do you think has dual spindles?  It basically turns a complex machine into a SUPER complex machine.  If it were easy, I would guarantee they would be more popular.   

I find myself in your shoes- a woodworker learning a new complex tool that requires me to learn a whole new skillset that takes people years in school to master- computer programming. Just shows that the software programs are still in an infancy state and have a way to go to make it so the common man can easily use the machines.
I have to disagree here.  You are not just wanting to use this machine.  You are wanting to make an improvement to increase your machine's performance.  Most likely, you can easily use you machine as it is but it just takes longer than you wish.  So there is a subtlety here that makes a huge difference.  So to be honest with yourself, what you are really saying is you are wishing there was an easy way that the common man can improve the machine's performance by altering its design.  Right?   ;D

Well, there's nothing wrong with wishing that.  But unfortunately, doing that is gonna require some programming.  And possibly electrical wiring too.  There is only one Z, one S, and one T in G code so you have to consider all of those implications for dual spindles.  Software configuration will only carry you so far once the machine gets our of the more or less "standard" category.

And finally, don't let programming deter you.  I too consider myself a common man.  Like you, I try to find ways to optimize my work, machines, and processes, etc...  It just makes sense.   And also because I will freely admit that I'm a rather lazy man too. :D  The old saying of "work smarter, not harder" comes to mind.  Oh, and I'm dyslexic too so maybe I'm not so common.  LOL  And I will say this as an ex auto mechanic, the very reason I learned to program was to make my life easier.  I had a service station (remember those?) and decided I needed to write my own inventory control software.  And back then there wasn't much software that you could even buy!  No school, no internet, I just stuck my nose in a book, read it over and over, and did the trial and error thing over and over too.  Mostly error, BTW.  ;) However, within 6 months, I had my inventory program.  Note that I didn't master programming in that time though!  But you don't have to master programming to solve a problem.  I would say most people never master programming unless they go on to make a career out of it.  Adam (DAAD) probably hasn't mastered programming but he sure did solve his problem.

The information I gave Adam was very generic (because his machine was going to be different) and should also apply to your machine as well.  Then take a look at his implementation and see how he applied that generic stuff.   Even though your machine will probably be different, It will probably give you a leg up to the right path. 

Steve

43
Mach4 General Discussion / Re: Lua script: Pause for operator to jog?
« on: November 17, 2022, 01:32:27 AM »
mcFileHoldAquire(inst, 'A textual reason for the File Hold', axisJogBits);

Supply the instance, and the reason for the File Hold, and the bitmask of the axes that you want to be able to Jog.  The bitmask is 7 for axes X, Y, and Z.

This is what is used behind the scenes in mcCntlToolChangeManual(). 

WARNING!  You have to command the axis back to the original position. 

Steve

44
Mach4 General Discussion / Re: delay and timer in signal script #mach 4
« on: November 04, 2022, 03:59:27 PM »
This is why your are not supposed to cross post (same question in multiple posts).  I answered your question in another post.  See https://www.machsupport.com/forum/index.php?topic=41633.msg294381#msg294381.

Steve


45
Mach4 General Discussion / Re: Lua script problems
« on: November 04, 2022, 03:55:22 PM »
hi there

I almost have the same problem but mine seems to be worst
I am trying to get a the delay working in the signal script and up to now i have not succeeded.
as soon as i saw the wait function i wen ahead and used it but right after that i got an error.
i also tried using the wx.wxMilliSecond(), but it forces me to shut down the Mach 4

wx.wxMilliSleep(), not wx.wxMilliSecond(). 

Anyway, waiting 5 seconds in a script that is supposed to take nanoseconds to execute is GOING to cause problems.  The signal script is processed from a GUI messaging event.  The Windows GUI has ONE event queue.  So a signal changes in the core and that fires one event to the GUI.  Just like pressing a button sends a "clicked" event to the GUI.  Well, while your signal event is waiting for 5 seconds, no other event is processed.  This means no DROs get updated, no buttons will work on the screen, and the whole GUI just seems frozen.  So even if your script didn't produce an error, it would have not worked well. 

So what to do to solve the problem?  Well, there are several ways to solve the issue gracefully.  You can split the process up and let the PLC script count down and fire the second output signal signal (OSIG_OUTPUT6).  This is the old school multi thread model.  It is probably the most flexible but also the hardest to implement and really not needed for your application but I thought I would share it in case you or others may find it useful in the future:

1. Create a global flag variable and a global counter variable in the screen load script.
2. Set this global flag variable and initialize the counter variable In the signal script when ISIG_INPUT1 drives OSIG_OUTPUT5 high in the signal script.
3. In the PLC script, look for this flag and if it is set, start decrementing the counter variable by the refresh time of the screen (default of 50 milliseconds).
4. When the counter variable reaches zero, fire the OSIG_OUTPUT6 signal. 

Next, there is the PMC.  A simple PMC object can do this with a single rung.  Attached are the sample PMC file and screen shot.  You just have to change the output to match your system as the ones I used were from the Sim plugin.  It is dead nuts simple and probably my favorite way of handling these logic oriented tasks. 

And finally, there are the screen timer objects.  Drop one on the screen, set the properties according to the attached screen shot (enabled all states, 5000ms, oneshot, and the name property to 'tmrOutput6Delay'), switch to the timer control's event properties and provide an event scrip[t that turns on your Output6, and modify your signal script to the following:
Code: [Select]
if (ISigFDBK == 1)then
    mc.mcSignalSetState(hsignal,1)
    scr.SetProperty('tmrOutput6Delay', 'Command', 'START'); -- start the one shot timer.
else
    mc.mcSignalSetState(hsignal,0)
    mc.mcSignalSetState(hsignale,0)
end

But again, I like the PMC method the best. 

Steve

46
Mach4 General Discussion / Re: Line 0: Multiple E words in block
« on: October 28, 2022, 10:10:37 PM »
I have looked into this and I think we are getting some scientific notation from the OS! Why is it doing it .... well frankly that is the real issue. Thank you for bringing this up! We are looking for a solution.

Now that Brian brought up scientific notation, I think he is onto something.  I think the way xstart and ystart are used to form the string is what is causing the scientific notation to appear. 

Consider your script line below.  And this could very well happen if xstart and ystart were calculated and are in scientific notation!

Code: [Select]
mc.mcCntlGcodeExecuteWait(inst,(string.format('G' .. posmode)).." G54 G0 X"..xstart.." Y"..ystart)

Also, if tostring was used to convert  the x and y start positions to a string, the positions may be small enough to produce the scientific notation.  So how can we prove the scientific notation thing?  Try this code:
Code: [Select]
local gcodeLine = string.format('G' .. posmode) .. " G54 G0 X"..xstart.." Y"..ystart
mc.mcCntlSetLastError(inst, gcodeLine)
mc.mcCntlGcodeExecuteWait(inst, gcodeLine)

Now, what if the above code proves that out to be true?  How do you eliminate the issue?  Consider this code, assuming xstart and ystart are real number variables and not a string representation of numbers.  This also assumes that posmode is a number. 

Code: [Select]
local gcodeLine = string.format('G%d G54 G0 X%.4f Y%.4f', posmode, xstart, ystart)
mc.mcCntlSetLastError(inst, gcodeLine)
mc.mcCntlGcodeExecuteWait(inst, gcodeLine)

The above code is the proper way to use string.format()  %d is an integer.  %f is a floating point number.  %.4f means 4 digits of precision.  See if that gets better results. 

Steve

47
Mach4 General Discussion / Re: Line 0: Multiple E words in block
« on: October 28, 2022, 05:57:33 PM »
I think you guys are editing and using something other than ASCII character set.  Something with a double byte charset?  G code can only be one byte per character.  Either in the G code itself of scripts executing G code.  So the random-ness may be due to a DBCS or UNICODE character in the G code file and not directly having to do with your M6. 

Steve

48
Mach4 General Discussion / Re: set machine axess position 5 axiss+
« on: October 21, 2022, 12:21:45 AM »
I think I understand now.  Hmm...  I don't know what that could be.  What build are you running?  What motion controller? 

Steve

49
Mach4 General Discussion / Re: Can't set machine position in script
« on: October 20, 2022, 07:29:47 PM »
steve
im agree with you ,but now with abs encoder , i read position ,how can i set it on mach?
****i use with home in position and put the value as offset , but its not very good
for example the axiss always have mistories movment( its not noise ,its small move that comand from mach)

I don't think I fully understand your question.  Maybe you can post a new thread about it? 

Steve

50
Mach4 General Discussion / Re: Can't set machine position in script
« on: October 16, 2022, 05:11:59 PM »
I know what you are saying, I just don't understand why restoring the shutdown parameters isn't a basic default. I mean why not? It seems counter intuative to arbitrarily reset the machine Coords to zero.

Not heard of the Galil - have you got a link?

thansk
https://www.galil.com/.  However, note that the Galil is not a plug and play motion controller.  You must understand how a Galil works to effectively integrate them into a CNC machine.  Also, while there are things like position retention available with the Mach/Galil plugin, other things like lathe threading and mill rigid tapping are not available.  So research and decide.

I think everyone that wants something a certain way wishes for it to be a "basic default".  It is human nature.  :)  However, most motion controllers set the machine coordinates during the home operation because in all cases except ABS encoders, the correct thought is that the position is undefined until the machine is referenced.  Otherwise, why would there even be a homing/referencing feature?  Mach 4 has lots of screw mapping and Z leveling features that Mach 3 never had and they simply depend on the machine being referenced.  Referencing the machine at startup simply ensures correct operation EVERY time.  Not some of the time or times where nobody bumps the table.  Even though the Galil remembers the previous positions, I do not use it because it takes a mere 20 seconds to home my machine and then I know my fixture offset is correct.  No guessing or checking.

But again, this is not a Mach 4 limitation.  Mach 4's notion of machine coordinates is whatever the motion controller tells Mach it is.  If you wish for your shutdown positions to be retained, ask your motion controller vendor for that feature.

Steve