Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 08:20:59 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
Spindle speed
Pages:
1
Go Down
« previous
next »
Author
Topic: Spindle speed (Read 557 times)
0 Members and 1 Guest are viewing this topic.
Aeroshade
Active Member
Offline
Posts: 138
Spindle speed
«
on:
April 19, 2011, 11:26:08 AM »
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
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Spindle speed
«
Reply #1 on:
April 20, 2011, 07:24:22 AM »
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.
another option, would be to move your gear changing code, to a "Brain", and have it do all your gear changing logic based on, your Spindle Speed, and Pulley Number DRO.
scott
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Aeroshade
Active Member
Offline
Posts: 138
Re: Spindle speed
«
Reply #2 on:
April 20, 2011, 09:55:58 AM »
Thank you for the reply Poppabear.
Quote from: poppabear on April 20, 2011, 07:24:22 AM
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
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Spindle speed
«
Reply #3 on:
April 20, 2011, 10:49:06 AM »
In that case, I would make a custom Macro i.e. M800 or what ever.......
this would be your "M3" in a way, inside that macro, to start your spindle cw, "DoSpinCW()"
(there is also DoSpinCCW(), and DoSpinStop(). now basically since your using the direct VB spindle controls,
you are not in the OEM M3 (or M4) funcs.... do also your spindle speed/gear change stuff in this macro as well.
OR
move all your M3 code, into your spindle speed code, since the spindle speed is called by it at the OEM level
scott
«
Last Edit: April 20, 2011, 10:54:16 AM by poppabear
»
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Aeroshade
Active Member
Offline
Posts: 138
Re: Spindle speed
«
Reply #4 on:
April 20, 2011, 01:13:11 PM »
OK I will try the moving everything to the SpindleSpeed macro. Do I leave the M3 macro blank?
Thanks,
Aero
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...