Hello Guest it is May 21, 2024, 04:36:51 PM

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 - Aeroshade

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 »
41
Hello all. I wrote a Brain that when I press a button, real button not one on the screen, it triggers the tool unclamp OUTPUT and releases the tool from the spindle. It works good, but when I run my automatic tool changer with that Brain on, the M6 macro wont turn the OUTPUT on for the tool unclamp. When I have the Brain off it works fine.

Any suggestions?

Thanks,

Aero


42
VB and the development of wizards / Re: Spindle speed
« on: April 20, 2011, 02:13:11 PM »
OK I will try the moving everything to the SpindleSpeed macro. Do I leave the M3 macro blank?


Thanks,

Aero

43
VB and the development of wizards / Re: Spindle speed
« on: April 20, 2011, 10:55:58 AM »
Thank you for the reply Poppabear.

I would HIGHLY recommend that you MERGE your M3 and SpindleSpeed macro into ONE single M3 (and repeat it in a M4 if you use that as well), macro, I think they are not synching up correclty as seperate..........   

Also, Set you Pulley by talking to the Pulley DRO directly, don't do it over the setpulley() call.
See Wiki under OEM DROs for the Pulley number OEM number.

I tried running the whole thing in the M3 macro but couldn't get it to change the pulleys.

I tried this and could never get it to work right.

M3 Macro:

Spin = GetRPM()

If Spin < 911 Then
   SetOemDRO(56,1)
   Call LowGear
   End If
   

If Spin > 910 Then
   SetOemDRO(56,2)
   Call HighGear
   End If
   

Sub LowGear
   ActivateSignal(OUTPUT8)'Low Gear (OUTPUT)
   Sleep (50)
   
   Do Until IsActive(OEMTRIG2)'Low Gear Switch (INPUT)
   Loop
   
   If IsActive(OEMTRIG2) Then
   Call SpinSpindle
   End If
End Sub

Sub HighGear
   ActivateSignal(OUTPUT7)'High Gear (OUTPUT)
   Sleep (50)
   
   Do Until IsActive(OEMTRIG1)'High Gear Switch (INPUT)
   Loop
   
   If IsActive(OEMTRIG1) Then
   Call SpinSpindle
   End If
End Sub


Sub SpinSpindle

   DoSpinCW()

End Sub

Exit Sub


There are a few variations to the above that I have tried but none could change the pulley#, as soon as I put the change pulley code in the SpindleSpeed it worked.


This is my original thread, it has everything I have tried, well almost everything. http://www.machsupport.com/forum/index.php/topic,17654.0.html

These macros run great, I just think I need to clear a var. that is storing the last RPM from the spindle.

I can try the Brain suggestion, but I need to read up on how to do it.


Thanks again,

Aero


44
VB and the development of wizards / Spindle speed
« on: April 19, 2011, 12:26:08 PM »
Hello all, I have this INFO in another post that is mixed with other questions, so I decided to start a fresh thread with just one question. I have set-up my M3 macro along with my SpindleSpeed macro to get my spindle and gear changer working. A little history, I have VFD and automatic gear changer for high gear and low gear that uses two OUTPUTS, I also have two INPUTS that come on when the gear is in high or low position. So this means I have two pulleys, pulley 1 = 0-900 RPM and pulley 2= 901-5000 RPM. I'm still trying to get the RPM tuned in, but that is something I'm sure I can get tuned. I had to put all my gear change code in the SpindleSpeed macro, along with changing the pulleys. I will post the two macros at the end of this post.

Everything is working great except one part. I MDI M03S100, the macros run and change to low gear, and spin the spindle to 100RPM. I then MDI M05 and the spindle stops. I then MDI M03S1000 and the macros run and change to high gear, and spin the spindle to 1000RPM. I MDI m05 and the spindle stops. Now comes the problem, I then MDI M03S100 again and the macros run, they change the gear to low, but instead of running the spindle at 100RPM it runs the spindle at full speed(10v). Since the macros set the pulley to #1 it runs the spindle at 900RPM instead of 100RPM. I then MDI M05 and the spindle stops. I then MDI M03S1000 and the spindle runs at full speed(10v), which in pulley #2 makes the spindle run at 5000RPM instead of 1000RPM. I can MDI M05 and the spindle turns off but, I have to shut Mach3 down and restart it to get it not to run at the max speed.

I'm think that some DRO isn't being updated. I added a DRO to my screen to monitor, OEMDRO#817, and when I run through the above sequence I can see that the spindle speed I set is being set in OEMDRO 817.

If anyone has any idea why this might be happening please let me know.

Thanks,

Aero



M3 Macro:

SpinS = GetRPM()

 If SpinS < 901 Then
   Call LowGearON
   End If

 If SpinS > 900 Then
   Call HighGearON
   End If


Sub LowGearON

   While IsActive(OEMTRIG2) = False
      Sleep(10)
   Wend
  
   If IsActive(OEMTRIG2) Then
   Sleep(5000)
   Message "Spindle On"
   DeActivateSignal(OUTPUT2)'Spin Reverse
   ActivateSignal(OUTPUT1)'Spin Forward
   DoSpinCW()
   End If

End Sub


Sub HighGearON

   While IsActive(OEMTRIG1) = False
      Sleep(10)
   Wend
    
   If IsActive(OEMTRIG1) Then
   Sleep(5000)
   Message "Spindle On"
   DeActivateSignal(OUTPUT2)'Spin Reverse
   ActivateSignal(OUTPUT1)'Spin Forward
   DoSpinCW()
   End If

End Sub  




SpindleSpeed Macro:

Spin = GetRPM()

 If Spin < 901 Then
   SetPulley(1)
   Call LowGear
   End If

 If Spin > 900 Then
   SetPulley(2)
   Call HighGear
   End If


Sub LowGear
 
   DeActivateSignal(OUTPUT7)'HG=7 LG=8

   ActivateSignal(OUTPUT8)'Low Gear

   While IsActive(OEMTRIG2) = False'HG=1 LG=2
      Sleep(10)
   Wend
  
   If IsActive(OEMTRIG2) Then
   Message "Low gear input is active"
   End If
  
   Call SpinON

End Sub
 

Sub HighGear
 
   DeActivateSignal(OUTPUT8)'HG=7 LG=8

   ActivateSignal(OUTPUT7)'Low Gear

   While IsActive(OEMTRIG1) = False'HG=1 LG=2
      Sleep(10)
   Wend
    
   If IsActive(OEMTRIG1) Then
   Message "High gear input is active"
   End If
  
   Call SpinON

End Sub

Sub SpinON

   Sleep(5000)
   rpm = GetRPM()
   SetSpinSpeed( rpm )
  
End Sub




M5 Macro:

DoSpinStop()
DeactivateSignal(OUTPUT7)'High Gear OUTPUT
DeactivateSignal(OUTPUT8)'Low Gear OUTPUT
DeactivateSignal(OUTPUT1)'Spin CW OUTPUT
DeactivateSignal(OUTPUT2)'Spin CCW OUTPUT



45
VB and the development of wizards / Re: M03 macro and changing pulleys
« on: April 15, 2011, 08:26:33 PM »
I'm not calling a macro from the program. Mach3 reads M3 and SpindleSpeed on it's own. You can test it by putting a message in your SpindleSpeed macro and it will show when you run the M3 macro (AKA M03S100)


Aero

46
VB and the development of wizards / Re: M03 macro and changing pulleys
« on: April 15, 2011, 04:46:40 PM »
Not sure what you are asking, but here is a better picture of what the M3 and SpindleSpeed macro are doing.



SpindleSpeed MACRO:

Spin = GetRPM()

 If Spin < 901 Then
   SetPulley(1)
   Call LowGear
   End If

 If Spin > 900 Then
   SetPulley(2)
   Call HighGear
   End If


Sub LowGear
 
   DeActivateSignal(OUTPUT7) 'High gear OUTPUT off

   ActivateSignal(OUTPUT8) 'Low Gear OUTPUT on

   While IsActive(OEMTRIG2) = False 'Checks to make sure Low gear INPUT is active
      Sleep(10)
   Wend
   
   If IsActive(OEMTRIG2) Then
   Message "Low gear input is active"
   End If
   
   Call SpinON

End Sub
 

Sub HighGear
 
   DeActivateSignal(OUTPUT8) 'Low gear OUTPUT off

   ActivateSignal(OUTPUT7) 'High Gear OUTPUT on

   While IsActive(OEMTRIG1) = False 'Checks to make sure High gear INPUT is active
      Sleep(10)
   Wend
     
   If IsActive(OEMTRIG1) Then
   Message "High gear input is active"
   End If
   
   Call SpinON

End Sub

Sub SpinON

   Sleep(5000)
   rpm = GetRPM() 'this is what was in the SpindleSpeed macro
   SetSpinSpeed( rpm ) 'this is what was in the SpindleSpeed macro
   
End Sub   


M3 MACRO:


SpinS = GetRPM()

 If SpinS < 901 Then
   Call LowGearON
   End If

 If SpinS > 900 Then
   Call HighGearON
   End If


Sub LowGearON

   While IsActive(OEMTRIG2) = False 'Makes sure Low gear INPUT is active
      Sleep(10)
   Wend
   
   If IsActive(OEMTRIG2) Then
   Sleep(5000)
   Message "Spindle On"
   DeActivateSignal(OUTPUT2) 'Turns off Spindle reverse (CCW) OUTPUT
   ActivateSignal(OUTPUT1) 'Turns on Spindle forward (CW) OUTPUT
   DoSpinCW() 'this is what was in the M3 macro
   End If

End Sub


Sub HighGearON

   While IsActive(OEMTRIG1) = False 'Makes sure High gear INPUT is active
      Sleep(10)
   Wend
     
   If IsActive(OEMTRIG1) Then
   Sleep(5000)
   Message "Spindle On"
   DeActivateSignal(OUTPUT2) 'Turns off Spindle reverse (CCW) OUTPUT
   ActivateSignal(OUTPUT1) 'Turns on Spindle forward (CW) OUTPUT
   DoSpinCW() 'this is what was in the M3 macro
   End If

End Sub



Thanks for the help,

Aero

47
VB and the development of wizards / Re: M03 macro and changing pulleys
« on: April 15, 2011, 11:16:16 AM »
Add: The SpindleSpeed macro is located in the macro folder of Mach3. Sorry I have been calling it SpinSpeed macro I should have called it SpindleSpeed macro, sorry or the confusion :)

Aero

48
VB and the development of wizards / Re: M03 macro and changing pulleys
« on: April 15, 2011, 11:12:20 AM »
I had that same problem, I was fighting to get the SetPulley() to work in M3 macro, but wouldn't work... once I put it in the SpinSpeed macro it worked great. I'm guessing that the SpinSpeed macro and the M3 macro run at the same time, or the Spinspeed macro runs first then the M3 macro, since I got it to change gears before it ran the M3 macro. But my question is that something is being set when I put the spindle at a higher speed then try to go to a lower speed, the lower speed is overran by the high speed I programed.


Aero

49
VB and the development of wizards / Re: M03 macro and changing pulleys
« on: April 15, 2011, 10:13:54 AM »
Exactly how are you using the programs. How are you calling them to work.

(;-) TP

Not sure what you mean. I thought they are called up by using the M03 command. Please explain.

Thanks,

Aero

50
VB and the development of wizards / Re: M03 macro and changing pulleys
« on: April 14, 2011, 10:59:43 AM »
I was thinking that I might need to zero out a DRO at the beginning of my SpinSpeed macro. Any thoughts?

Thanks,

Aero

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 »