Hello Guest it is April 26, 2024, 11:06:50 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 - zmajmr

Pages: « 1 2 3 4 5 6 7 8 9 »
31
General Mach Discussion / Re: Spindle button and M3 and M4
« on: September 15, 2016, 04:59:46 AM »
Could possibly be done with a #var - every time the M3 or M4 is called it will store a value representing the last called direction in the variable, when you press spindle toggle manually, it would read that variable and call the correct direction.

I can see issues here but thats where i would probably start ;)
Hi

I read couple of time what you wrote and I do not not how to implement that, I mean where to use #var.

From my experience when some data need to be saved and read it only worked saving them in file otherwise every time I enter in macro variable is not remebered. Probbly I could use saving in file information but was hoping that there exist something simpler of what I am not aware of. Thank for your help. I assume somebody had this kind of problems already.

32
General Mach Discussion / Spindle button and M3 and M4
« on: September 15, 2016, 03:22:44 AM »
Hi guys,

I have CNC lathe , was running some G code yesterday, then wanted to pause spindle and feed in order to remove chips from tool safely, so I pressed feed hold button and spindle button.

When I wanted to proceed with execution of my G code program I pressed spindle button and cycle start button and thing is that I found out that spindle starts to rotate in M3 or CW mode/ direction ,
thing is that in program before stop it was command to use M4 or CCW , so it never crossed my mind that if I stop spindle that it will continue to execute g code program but with wrong RPM direction.

Today I went to find what is behind spindle button and it is function for spindle CW and reset THC height.

Now question is how to make that when I want to stop execution of g code and want to remove chips in safe way to proceed with g code but with spindle rotation which is programed by G code, did not tried yet but probably I can make same button below existing one that will give command to rotate spindel in CCW dirction,

Is it possible to make that by pressing only one button, somehow to program continue with correct RPM direction?

Yesterday was wondering how from some point my boring bar was producing chips like it was to aggressive cut, and was really surprised when I figured out that stopping spindle in the middle of program was thing that made problems , not depth of cut, luckily tool was not destroyed.
Hope somebody have some example how to solve this or what is normal procedure.

This is my machine and tool whit which I had problems (I thought that cuts to deep , first it was removing 0.1 mm of material then changed to 0.05 mm and after that I was, there is something wrong here LOL)
https://www.youtube.com/watch?v=8iJwtRoWx3o

Thanks in advance :)

33
here is video about my testing
https://www.youtube.com/watch?v=qiXE-lEhwfE

if someone have something to say about this please let me know

34
Hi folks, I was thinking how to ask this question,  as English is not my mother language , maybe like in subject of topic.

I made macro that is being triggered after RESET button is presses and it runs all the time , have while 1 (loop) and it serves me to count how many impulses z axis balscrew manage to make in order to know when to activate oil pump (every 20 meters need to be turned on for 8 seconds).
So while I am in manual mode macro runs pretty good, it counts impulses, but before few days I discovered while I spent quite amount of time in auto mode running g code, I went to check how many pulses macro/scrip did count, and after some time I realized that number of pulses did not changed from time when I was in manual mode.

So I concluded when I came in auto mode and pressed Cycle start, macro is being stopped, I did not know that will happen, I thought that macro will continue to work . So my observations that when you enter in auto mode all macros are being stopped and you are prepared for execution of g code. Got idea to try to activate macro when  spindle starts, so I went and rearrange brain that controls triggering of macro to be triggered when spindle is started and after when RESET is  pressed. My machine started to move and when it came to part of g code where spindle is turned on movement stops and time is running on in auto mode.

So I came to conclusion that I can not have situation that Mach3 executes g code parallel while my macro for controlling oil pump works also.

Maybe it looks like I confirmed how Mach3 works but I would love to confirm did I conclude good or I am not aware of all possibilities.

Before I made macro, I had plan to use Siemens LOGO PLC for counting impulses but discovered inputs are to slow, so instead to  buy PLC with fast inputs I decide to make it over Mach3 but now as it seams I will need to buy PLC with fast inputs .

Hope someone can clarify me am I concluded good how Mach3 works.

Here is macro for oil pump, I had topic where I described how I all made but if that macro can not work parallel while g code is running then all was for nothing  ;D

Sub main ()  ' logic for auto oil pump

Dim oldp,newp,n,error_m As Integer
Dim Msg

While 1

If Not IsActive(Index) Then
n=0
Else
n=1
End If

Sleep 10 ' sample input f = 100Hz

If  IsActive(Index) And n=0 Then '  before 10 ms Index was zero , count only rising edges
Open "C:\Mach3\oilpump.txt" For Input As #2
Line Input #2, oldp
newp=oldp+1
Close #2
If newp=4000 Then ' for testing purposes newp is 10 in reality it needs to be 4000 for 20 m of travel with 5 mm pitch ballscrew
ActivateSignal(Output8) 'oil pump is on output 8
error_m=1

Sleep 1000 'turn on pump for period of 8 seconds , 8 x 1000

If IsActive (Timing) Then
error_m=0
End If

Sleep 1000

If IsActive (Timing) Then
error_m=0
End If

Sleep 1000

If IsActive (Timing) Then
error_m=0
End If

Sleep 1000

If IsActive (Timing) Then
error_m=0
End If

Sleep 1000

If IsActive (Timing) Then
error_m=0
End If

Sleep 1000

If IsActive (Timing) Then
error_m=0
End If

Sleep 1000

If IsActive (Timing) Then
error_m=0
End If

Sleep 1000

If IsActive (Timing) Then
error_m=0
End If

DeActivateSignal(Output8)
newp=0

If error_m=1 Then

Msg = "Oil pump error --> check oil level "
MsgBox Msg

Else

Msg = "Lubrication was sucessful after 20 m of travel "
MsgBox Msg

End If


End If
Open "C:\Mach3\oilpump.txt" For Output As #1
Print #1,newp
Close #1

End If

Wend

End Sub                        
    

35
General Mach Discussion / Re: Spindle at speed signal
« on: June 06, 2016, 02:53:59 PM »
https://www.youtube.com/watch?v=TTFXF2W0lUs

spindle at speed in Mach3 - my way

36
Here is info on using CSMIO I/O
http://www.cs-lab.eu/en/upload/fotki/Elementy,%20banery/CSMIO-IP-A%20artykuł.jpg

I think there are also examples in the I/O modules manual.

There is stored info in Mach for axis distances but I am not sure if you can get that info from VB or not, you can view it from Operator Menu then Maintenance Hours.
Best bet would be to email Mach Support and see if there are any OEM codes for these DROs.
Hood

Funny update, got this from support before day ago :), I guess this what I did is best that can be done , I do not know...

"Hello Marko, take a look at this thread in our support forum, this user was able to achive what you are look to do and has posted their work there, best regards Jim.

https://www.machsupport.com/forum/index.php/topic,32293.msg224740.html#msg224740


James Dingus Jr.
Tech support staff
To learn the answers to our most Frequently Asked Questions please visit our FAQs page at http://www.machsupport.com/help-learning/f-a-q/

37
Nothing at all to do with the subject of the topic but...

Quote
I do not know why link for video is wrongly showed *******, I did not wrote those symbols

Been puzzling over this and concluded that YouTube chose an unfortunate combination of letters for the video's address. Somewhere in this forum's engine is a routine to remove offensive words and replace with asterisk's - thus the problem with your link to the video.

Tweakie.



OK, it is not problem, like I said copy-past in youtube this :

Macropump Macro Mach3 Brain OEMTrigger

And you will find video (I mean , anybody who wants to see procedure).

38
Here is update, manage to solve problem of oilpump to work automatically , by myself (that is important, just kidding).

Here is in video what I did

https://youtu.be/G*********qxjDDw?t=2s

So to recapitulate what all I tried before I came to this solution.

First I made macro that controls oil pump and it is activated/triggered over button that I add in mach3 screen by program machscreen editor (it is free), and in my case I connected input that counts impulses on input Index and pressure switch from oil pump (that serves for detection is there any oil and is pump in working condition ) on Timing input, as I  use CSMIO/IP-S as I concluded I can treat those inputs(Index and Timing ) as regular inputs (Input 1 to 4) and I used them because I I thought I have only those 4 inputs.

So macro for for controlling oil pump works correct when is executed over button (I named it Auto lube) and everything work OK until E-stop is activated , I made macro for oil pump to save how many impulses is counted in file named oilpump.txt so I can have exact number of counted impulses even if I close Mach3 and open it again (for that I need to delete from code part that initializes counter of impulses on zero every time I press Auto Lube button).

So next I thought that problem that I have by stopping macro by Estop can be easily solved by inserting code in macropump (like Hood said it is macro but it executes cyclic after you turn on mach3, you do not need to press any buttons or switches , you just need to adjust in general config that you want to use it, just check box where it say macropump and that is it, escape mach3 and come back and it should work, and inside of macropump you can put what ever you want that need  checks to be executed cyclic (from my experience, I put inside logic that checks do I want to open or close power chuck, and now will need to put same logic for tailstock, and most important thing that I discovered you need to put inside of macropump SetOEMTrigger(*********) function).

So as I wanted to cyclic run code that will count impulses in order to control oil pump I put code inside of macropump, and I thought, OK it will work same as in macro triggered by button (Auto lube), but it does not work , why, probably because of code that is necessary for macro for counting impulses, it needs to detect is it rising edge present (otherwise if sensor is active , macro will count presence  of sensor same as timing pulley made one revolution which is not good , because of that it needs to count changes not presence  , and other thing is that data is saved in file (and file needs to be open and closed), anyway probably that goes from some reason slow in macropump and because of that it misses to count impulses (it counts but not accurate).

And only solution till now that I can use is to use code over macro triggered by Auto lube button, but in that way macro counts correct but it is stopped when Estop is activated, I have nothing against   stopping because I will not get wrong data but I need to manually press activate pump and I can easily forget to press button, so after reading forums I discovered that there exist brains in mach3, only problem I never used them and have no clue what that should be, it sounds complicated "brain" haha. It is similar to ladder diagram for programing PLC, so you can activate output by input and you can between insert some logic and as I read they are faster then macros.

So I had simple idea, when Estop is acknowledged (I need to press RESET) if I want to start macro for oilpump (I named it m555.m1s) , so if Estop is triggered I must press RESET if I want to continue to work, I can not forget to press it.

And after experimenting with bits that I tested before (some OEM cods) I gradually came to solution to choose brain and make some logic, I guess.

So when Estop (LED with code 800) is not turned on , it needs to activate OEMTrigger1 which triggers macro (m555.m1s), Estop and OEMTrigger1 are connected over (no operation inverted), and as I described in macropump needs to be SetOEMTrigger(555) .

How that works, macropump is cyclic running and inside of it is SetOEMTrigger(555) and it waits for OEMTrigger1 to be activated (in  System HotKeys Setup under Triggerer#1 is selected code 301, and that means when OEM Trigger#1 input is activated it will trigger my macro m555.m1s , and that will happen when I press on button RESET (for that need to be no operation inverted).

Hope you can follow idea and what I did, in that way I do not need to worry about oil pump at all because it will automatically be under control of macro555 (it is script because I do not made button for it, script/macro all the same to me) and information about how many impulses is counted is in file oilpump.txt, I just need to worry is there enough oil in reservoir Smiley

I do not know why link for video is wrongly showed *******, I did not wrote those symbols

If you are interested in video try to copy paste this in youtube search :

Macropump Macro Mach3 Brain OEMTrigger

39
Here is update, manage to solve problem of oilpump to work automatically , by myself (that is important, just kidding).

Here is in video what I did

https://youtu.be/G*********qxjDDw?t=2s

So to recapitulate what all I tried before I came to this solution.

First I made macro that controls oil pump and it is activated/triggered over button that I add in mach3 screen by program machscreen editor (it is free), and in my case I connected input that counts impulses on input Index and pressure switch from oil pump (that serves for detection is there any oil and is pump in working condition ) on Timing input, as I  use CSMIO/IP-S as I concluded I can treat those inputs(Index and Timing ) as regular inputs (Input 1 to 4) and I used them because I I thought I have only those 4 inputs.

So macro for for controlling oil pump works correct when is executed over button (I named it Auto lube) and everything work OK until E-stop is activated , I made macro for oil pump to save how many impulses is counted in file named oilpump.txt so I can have exact number of counted impulses even if I close Mach3 and open it again (for that I need to delete from code part that initializes counter of impulses on zero every time I press Auto Lube button).

So next I thought that problem that I have by stopping macro by Estop can be easily solved by inserting code in macropump (like Hood said it is macro but it executes cyclic after you turn on mach3, you do not need to press any buttons or switches , you just need to adjust in general config that you want to use it, just check box where it say macropump and that is it, escape mach3 and come back and it should work, and inside of macropump you can put what ever you want that need  checks to be executed cyclic (from my experience, I put inside logic that checks do I want to open or close power chuck, and now will need to put same logic for tailstock, and most important thing that I discovered you need to put inside of macropump SetOEMTrigger(*********) function).

So as I wanted to cyclic run code that will count impulses in order to control oil pump I put code inside of macropump, and I thought, OK it will work same as in macro triggered by button (Auto lube), but it does not work , why, probably because of code that is necessary for macro for counting impulses, it needs to detect is it rising edge present (otherwise if sensor is active , macro will count presence  of sensor same as timing pulley made one revolution which is not good , because of that it needs to count changes not presence  , and other thing is that data is saved in file (and file needs to be open and closed), anyway probably that goes from some reason slow in macropump and because of that it misses to count impulses (it counts but not accurate).

And only solution till now that I can use is to use code over macro triggered by Auto lube button, but in that way macro counts correct but it is stopped when Estop is activated, I have nothing against   stopping because I will not get wrong data but I need to manually press activate pump and I can easily forget to press button, so after reading forums I discovered that there exist brains in mach3, only problem I never used them and have no clue what that should be, it sounds complicated "brain" haha. It is similar to ladder diagram for programing PLC, so you can activate output by input and you can between insert some logic and as I read they are faster then macros.

So I had simple idea, when Estop is acknowledged (I need to press RESET) if I want to start macro for oilpump (I named it m555.m1s) , so if Estop is triggered I must press RESET if I want to continue to work, I can not forget to press it.

And after experimenting with bits that I tested before (some OEM cods) I gradually came to solution to choose brain and make some logic, I guess.

So when Estop (LED with code 800) is not turned on , it needs to activate OEMTrigger1 which triggers macro (m555.m1s), Estop and OEMTrigger1 are connected over (no operation inverted), and as I described in macropump needs to be SetOEMTrigger(555) .

How that works, macropump is cyclic running and inside of it is SetOEMTrigger(555) and it waits for OEMTrigger1 to be activated (in  System HotKeys Setup under Triggerer#1 is selected code 301, and that means when OEM Trigger#1 input is activated it will trigger my macro m555.m1s , and that will happen when I press on button RESET (for that need to be no operation inverted).

Hope you can follow idea and what I did, in that way I do not need to worry about oil pump at all because it will automatically be under control of macro555 (it is script because I do not made button for it, script/macro all the same to me) and information about how many impulses is counted is in file oilpump.txt, I just need to worry is there enough oil in reservoir :)

I do not know why link for video is wrongly showed *******, I did not wrote those symbols

If you are interested in video try to copy paste this in youtube search :

Macropump Macro Mach3 Brain OEMTrigger

40
Yupiiiiiiiiiiii, I manage to solve problem alone , will make video how I did it  :) one more time yupiiiiiii

Pages: « 1 2 3 4 5 6 7 8 9 »