Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 04:41:18 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  zero an axis before every move
Pages: 1   Go Down
Print
Author Topic: zero an axis before every move  (Read 438 times)
0 Members and 2 Guests are viewing this topic.
ASC
Active Member

Offline Offline

Posts: 64



View Profile WWW
« on: August 01, 2010, 02:47:51 PM »

Hey guys, I'm working on a rather unique 5 axis dispensing machine and am still quite new to Mach and VB, so I'm having a difficult time with what is probably a simple problem.  I have a dispenser controlled by my C-axis that is moved in and out of the work area via a linear actuator.  This actuator is moved into place with the M-command M802 (switching output 1).  My goal is to have the C axis reset to zero every time the actuator is activated.  This is to simplify the g-code when programming the dispenser;  Rather than accumulating a larger and larger value each time a small amount of fluid is dispensed, we want to start from zero each time.  Can anyone help me with a VB script or any other approach to make my C axis zero each time I activate M802?

My M802 script currently looks like this:

ActivateSignal(output1)
code("G4 P1")

I just need some help on what lines to add to set the C axis to zero!
Logged

Mr. Creosote
BR549
Active Member

Offline Offline

Posts: 2,553


View Profile
« Reply #1 on: August 01, 2010, 02:53:33 PM »

try

Dobutton(13)
Logged
ASC
Active Member

Offline Offline

Posts: 64



View Profile WWW
« Reply #2 on: August 01, 2010, 03:02:18 PM »

And away she goes!  That did it perfectly, thank you! 
Logged

Mr. Creosote
Mc2
Active Member

Offline Offline

Posts: 22


View Profile
« Reply #3 on: August 01, 2010, 04:41:59 PM »

try

Dobutton(13)
Hey guys, I'm working on a rather unique 5 axis dispensing machine and am still quite new to Mach and VB, so I'm having a difficult time with what is probably a simple problem.  I have a dispenser controlled by my C-axis that is moved in and out of the work area via a linear actuator.  This actuator is moved into place with the M-command M802 (switching output 1).  My goal is to have the C axis reset to zero every time the actuator is activated.  This is to simplify the g-code when programming the dispenser;  Rather than accumulating a larger and larger value each time a small amount of fluid is dispensed, we want to start from zero each time.  Can anyone help me with a VB script or any other approach to make my C axis zero each time I activate M802?

My M802 script currently looks like this:

ActivateSignal(output1)
code("G4 P1")

I just need some help on what lines to add to set the C axis to zero!

I would rather keep it simple. You will want to move the C axis incramental. So the g-code would look something like:

G91
C .01 f1.
G90

This way, you could move the actualtor back to the start when you are done. No need to reset zero. The C axis will move the set amount each time not a known postion each time.

Jim.
Logged
ASC
Active Member

Offline Offline

Posts: 64



View Profile WWW
« Reply #4 on: August 02, 2010, 10:56:44 AM »

That would work but I need to have all the other axes moving in absolute coordinates at the same time I'm dispensing.  I'd be worried that the inremental change would cause an absolute headache.
Logged

Mr. Creosote
Mc2
Active Member

Offline Offline

Posts: 22


View Profile
« Reply #5 on: August 02, 2010, 02:01:23 PM »

Oh, I understand. You will want the C axis moving simultaniously with other axis. In this case then I would use a macro varible. I would have to do some testing but it would go something like:

(At start of program)
#500=0.0

(anywhere in program where you wanted the feed move)
#500=[#500+.05]
G1 X1.0 Y1.0 C#500 F1

Anyways, glad you found your answers.
Jim.



Logged
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!