Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 05:16:31 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Need help with Macro A-axis.
Pages: 1   Go Down
Print
Author Topic: Need help with Macro A-axis.  (Read 419 times)
0 Members and 2 Guests are viewing this topic.
Oldraven
Active Member

Offline Offline

Posts: 24


View Profile
« on: March 04, 2011, 08:38:27 AM »

I am wrestling with the VB language to make a macro for turning a stepper on the A-axis.
Complete newbie to Visual Basic.

There is an optical sensor on the tool changer axis, one pulse per revolution.
I want first to home the tools to this optical pulse.

This is what I have;

'M6start.own 
'Input is an optical sensor for homing the ATC. 
'Get OEMLED ATC-Home. Check if ATC opto is lit.
'One pulse as a home reference generated by Emco5cnc ATC.   

While GetOEMLED(821) = False    
Call Rotate_1
Wend 

Private Sub Rotate_1()
Code "G91"
Code "G00 A259" 
GetOEMLED(821) 
Code "G00 A-10"
Code "G90" 

End Sub 

any ideas please.

Jos
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #1 on: March 07, 2011, 08:06:58 AM »

ah, ok....... 

I am ASSUMING..... that you want to "Home" the A ONCE per user session? It would be best to use Machs Native homing routines.
in which case you don't need any macro, just pipe your home switch to mach3.

on the other hand, if your doing this for each time you call the "A" axis before going to find the tool, you can again use a Hybrid version of the Homing routine.
Note you will need to bring in the homing input inside of Ports and Pins and set it's port and pin number to be your A axis home.

'M6Start.m1s

DoOEMButton(1025)   'This will Re-Ref (or Ref), you A axis only.
Code "G1 A-10 F6"      'If you need to move some distance, after your homing to "line up" your first slot, then put in then change this amount to what you need.
While IsMoving()         'Old school wait till it finishes moving.
Wend
DoOEMButton(1011)   'If you want to "Zero" your A axis at the main tool slot, so that from this point on, you can have your the rest of your ATC code move to
                                'tool slots based on Tool Slot 1, being your A=0 degrees.

'The rest of your ATC code for moving to new positions here.

'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/
Oldraven
Active Member

Offline Offline

Posts: 24


View Profile
« Reply #2 on: March 07, 2011, 10:40:10 AM »

Thanks Scott,

I will give it a try.

What I wanted to do is first of all Home the A-axis (ATC optical pulse)
 then on call from the G-code , M6 T0404 for instance, select the tool called for.

I run into different problems;

A-axis is Angular > set
Rot 360 rollover > set
A Home input 13 low active.

After homing I want to turn the A-axis 60 degrees ( 6 tool positions)

The ATC turns alright but sometimes CW and sometimes CCW.
Sometimes 60 degrees but mostly turns a few times around.

Even the VB script editor plays up, stepping through a macro if OK, running it gives some errors even to the point that the system hangs up.

It is hard to get control,

thanks,

Jos
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #3 on: March 09, 2011, 08:40:40 AM »

Here look at this Rotary ATC example code I posted a while back, it can help you get started...

http://www.machsupport.com/forum/index.php/topic,4191.0.html

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/
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!