Hello Guest it is November 30, 2021, 07:00:21 AM

Author Topic: Need some help setting up a spindle gear shifter!!!  (Read 4521 times)

0 Members and 1 Guest are viewing this topic.

Need some help setting up a spindle gear shifter!!!
« on: October 01, 2008, 06:59:13 PM »
Hi All,

I am looking for some info on how to set up a spindle gear shifter.  If someone has a macro to do most of it, I could possibly edit it and make it work for me. 

The logic would be:
Enter a spindle speed, and then it will look up to see which gear to use based on the spindle speed in the pulleys.
If it needs to change gears stop the spindle.
Pause the motion.
Turn on out-put 1 for gear 1 and turn off out-puts 2 and 3.
      
The mill only has three gears:
Output 1 = gear 1 speed range 9-140 RPM
Output 2 = gear 2 speed range 180-450 RPM
Output 3 = gear 3 speed range 560-1400 RPM

I tried one shot at it and couldn’t get past the little error message that says “Too Fast for Pulley..Using Max.”  What I did would work if I could find a way to make it so when I entered a spindle speed faster or slower than the current pulley speed, it would change pulleys.

The reason I am having to use the pulley is for the scaling of the 0-10v to my VFD.

Any help would be great. :)

Andrew
 

Andrew
MachMotion
Re: Need some help setting up a spindle gear shifter!!!
« Reply #1 on: November 01, 2008, 10:24:51 AM »
Hi,

I have the same problem.
I need exactly the same thing.

If you will have any informations, please let me know.

Regards!
Re: Need some help setting up a spindle gear shifter!!!
« Reply #2 on: November 01, 2008, 02:14:31 PM »
Hi,

I wrote a simple macro for gear shifter.
It is working from Script editor but not from G-code  - Compile error. Syntax error in script

In this moment I havent a time to search for mistake (I am not an expert), hope that someone will help!

Regards

'Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)

'''DoSpinCW()
rpm = GetRPM()
revolutions = GetRPM()
SetSpinSpeed( revolutions )

If rpm < 820 Then
pulleyD = 1       'desired gear
message "gear 1"
End If


If rpm > 800 And rpm < 5000 Then
pulleyD = 2         'desired gear
message "gear 2"

End If


pulley=(GetOEMDRO(56))  ' user DRO  - pulley number - added on screen


Select Case pulleyD
 
   
    Case  1 'pulleyD#1
   
    If pulley = pulleyD Then
    Message "Gear already in position 1"
    Else
   
   
    SetSpinSpeed(50)    'slow rotation for gear changing
    DoSpinCW()
    While isMoving()
    'Sleep 100
    Wend

    Code "G4 P2"
    While isMoving()
    'Sleep 100
    Wend
    DoSpinCW()
     ActivateSignal(OUTPUT1)
     DeActivateSignal(OUTPUT2)
     Code "G4 P2"
     While isMoving()
     'Sleep 100
    Wend

   
    setPulley(1)
    message "gear in position 1"
    Code "G4 P2"
     While isMoving()
     'Sleep 100
    Wend

    message "finished"
   
SetSpinSpeed(revolutions) ' set desired Spindle Speed back
DoSpinCW()

    Exit Sub
   
  End  If
 
 
  Case  2 'pulleyD#2
   
  If pulley = pulleyD Then
    Message "Gear already in position 2"
    Else
   
 
    SetSpinSpeed(50)   'slow rotation for gear changing
    DoSpinCW()
    While isMoving()
    'Sleep 100
    Wend

    Code "G4 P2"
    While isMoving()
    'Sleep 100
    Wend
    DoSpinCW()
     ActivateSignal(OUTPUT2)
     DeActivateSignal(OUTPUT1)
     Code "G4 P2"
     While isMoving()
     'Sleep 100
    Wend

   
    setPulley(2)
    message "gear in position 2"
    Code "G4 P2"
     While isMoving()
     'Sleep 100
    Wend

    message "finished"
   
SetSpinSpeed( revolutions )   ' set desired Spindle Speed back
DoSpinCW()

    Exit Sub
   
  End  If

 
  End Select   
Re: Need some help setting up a spindle gear shifter!!!
« Reply #3 on: November 03, 2008, 08:08:44 AM »
Email me and I will send you my XML and the macros I wrote!
Andrew
MachMotion