Hello Guest it is April 25, 2024, 12:10:38 PM

Author Topic: M03 macro and changing pulleys  (Read 20208 times)

0 Members and 1 Guest are viewing this topic.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: M03 macro and changing pulleys
« Reply #10 on: March 01, 2011, 04:57:57 PM »
I have actually just noticed something funny going on, the spindle override is being set to funny numbers when your macro is run, will check it out and see if I can figure whats going on.
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: M03 macro and changing pulleys
« Reply #11 on: March 01, 2011, 05:07:04 PM »
What are you using with Mach as I notice you have some weird numbers in Ports and Pins, example Output 1 is Port 1 Pin 51.

Hood
Re: M03 macro and changing pulleys
« Reply #12 on: March 01, 2011, 05:29:58 PM »
I have a Galil DMC-2162. I have a daughter card hooked to it for extra I/O's. I use the extra I/O's as userLED's.


Aero
Re: M03 macro and changing pulleys
« Reply #13 on: March 01, 2011, 05:42:30 PM »
I have had REALLY weird things happening with this machine.

I have a door switch, air pressure switch and a lube level switch that when either are low, or open, they trigger an e-stop. I do this with a brain and when I link them all to the reset it makes my E-stop button stop working.

I have a tool unclamp button, real button, and I use brains to make it work. When I have that brain enabled and I try to make a tool change the tool unclamp in my M6 macro wont work.


Today hasn't been a very good day... I think I might go home and watch Netflix movies all night and call in sick for the next two months :P


Aero

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: M03 macro and changing pulleys
« Reply #14 on: March 01, 2011, 05:45:23 PM »
Ok, it may be the Galil plugin that is causing the issue.
Do you see the Spindle override DRO getting set when calling the speed change?

Hood
Re: M03 macro and changing pulleys
« Reply #15 on: March 01, 2011, 05:55:00 PM »
Yes. If I use M3S100 the "RPM" shows 0 the "S-ov" shows 100 and the "Spindle Speed" shows 100.

I hope this helps.... I REALLY do hope :)


Thanks,

Aero

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: M03 macro and changing pulleys
« Reply #16 on: March 01, 2011, 06:08:43 PM »
Probably doesnt help LOL but I will try a few things and see if I can figure it out, I think though I wont manage very much as I dont have a galil to test with :(
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: M03 macro and changing pulleys
« Reply #17 on: March 01, 2011, 07:34:20 PM »
Do you actually control your spindle from Mach?
Hood
Re: M03 macro and changing pulleys
« Reply #18 on: March 02, 2011, 12:43:13 PM »
Do you actually control your spindle from Mach?
Hood

Yes, it doesn't work like I would hope... but it does work.


OK, this is my new M3 macro:


1 SpinCW = GetRPM()                        'I use SpinCW to test how fast the spindle needs to go
2 ActivateSignal(OUTPUT1)                 'This OUTPUT enables my spindle drive, VFD
3
4 If SpinCW < 901 Then                     'Low gear. My spindle gear goes from 0-900 for low then 901-5000 for high
5   Call LowGear                                'Calls sub program LowGear
6   End If
7
8 If SpinCW > 900 Then                     'High gear
9   Call HighGear                                'Calls sub program HighGear
10   End If
11  
12
13 Sub LowGear                                          'LowGear sub program
14   ActivateSignal(OUTPUT8)'Low Gear   'Engage the Low gear solenoid
15   
16   SetPulley(1)                                   'Set pulley to Pulley #1
17   
18   While IsActive(OEMTRIG2) = False     'This is the INPUT, switch, for low gear
19      Sleep 10
20   Wend
21   
22   Call SpinSpindle                                'Call sub Spinspindle
23   
24 End Sub
25
26 Sub HighGear                                          'HighGear sub
27   ActivateSignal(OUTPUT7)'High Gear   'Engage the High gear solenoid
28   
29   SetPulley(2)                                    'Set pulley to Pulley #2
30   
31   While IsActive(OEMTRIG1) = False     'This is the INPUT, switch, for high gear
32      Sleep 10
33   Wend
34   
35   Call SpinSpindle                                'Call sub Spinspindle
36
37 End Sub
38
39
40 Sub SpinSpindle                                       'SpinSpindle sub program
41
42   DoSpinCW()                                    'Spin spindle CW
43
44 End Sub
45
46 Exit Sub                         


OK, so when I step through this everything seems to work fine, I step through it with the e-stop on. The pulley changes and INPUTS and OUTPUTS seem fine. I save it then MDI M3S100, that would choose LowGear. If the Pulley under the settings tab is already one it works fine, but if it's two I get the pulley error. It seems to be running the macro so fast that it's not running every command. Is it possible that only certain commands work in the M3 macro? I changed the pulley manually, changed the DRO, to two and ran in MDI M3S100, the spindle started to spin up before the gear was fully engaged. REALLY bad sound... let me tell you :P.

If anyone has a clue on why this code isn't working please let me know. I'm at a stop tell I can figure this out.


Thanks,

Aero

P.S. Helping at my son's little league practice + watching Bones on Netflix yesterday, made me have the ability to try this all over again today :P

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: M03 macro and changing pulleys
« Reply #19 on: March 02, 2011, 03:33:45 PM »
So how do you actually start and stop the spindle?
Hood