Hello Guest it is April 26, 2024, 06:33:44 AM

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

Pages: « 1 2 3 4 »
11
I used the "setvar(1,x)" route and it worked great.
I even got brave and used some variables to control subroutine loop counters. :)

Thanks for the help yall!

12
OK so after doing some more digging I have found that I can check the state of an OEMTRIG with "IsActive(OEMTRIGx)" where x is the #.
I think this pretty much answers my first part.
I can figure out the logic part in the macro.

But I am still not clear on how to get a value into a variable in my code.
Should I place my Macro at the beginning of the Gcode, and in the Macro, have it do something like:

If IsActive(OEMTRIG3) Then
Code "#501=2.65"
...

Then later in my Gcode, use the variable #501?

Also, when you use the "Code" command in a Macro, does the line(s) that the Macro was called from in the Gcode get replaced with whatever is written with the "Code" command?

13
I am needing to make a macro to:
A) Read a 3-position switch
B) Set a value to a variable in my G-code based on which position the switch is in.
What I have so far:
I am using a G100 for I/O. I have my switch wired to 3 of the digital inputs. This works so far.
I assume I need to assign each of the 3 inputs to an "OEM Trigger" under Ports/Pins.??

What do I then need to do in my macro to read the condition of each of these 3 inputs?
And the, how do I set a variable to a value accordingly so that my G-code can then use the set value? (it will be for a G1 Y xx call, where "xx" is the value)

Thanks-

14
SmoothStepper USB / Re: SmoothStepper and laptop without ground....
« on: November 30, 2008, 12:48:51 PM »
I am running the SmoothStepper on a laptop with no ground on the laptop power.
I was using it on a laptop that had a ground, and it gave me all kinds of problems with the SS disconnecting from Mach all the time (ground loop??).
On the laptop with no ground, it works fine so far....
I have the SS powered from the USB, in it's own enclosure, and is not grounded to anything else (except the USB). Step/Direction going to the G320 amps are already opto-isolated.
Hope this helps. It can be a bugger to get the SS to stay connected reliably if there are ground and noise issues.

15
Yes looked into on the Yahoo group, where it was described in a bit more detail.
Any ideas if this will work with a SmoothStepper? I have a G100 and I am 99.9% sure it wont work with that.. even if it did, the G100 has no "spindle" output. And if it did, the ABS encoder counter register for it would overflow after a few minutes of use, and everything would go wacky. :) :)

How to find out the Axis # designation? What "axis" is the spindle output in Mach? I guess trial and error might have to take it from here. :)

16
Jim- ah yes I think I see what you are getting at now... Yes that would be cleaner than the other hardware method I thought you were talking about.

Vmax- Thank you! I will look into the axisswap(). It sounds like it will do what I need.

17
Yes the axis would come to a stop first before switching.. not "while in motion". :)
It is what any lathe with a "C" axis (or "spindle indexing") can do. Or a mill that can ridged tap.

The hardware solution you mentioned could work, but I would think should be a last resort. Would require an added DC motor controller to run the spindle apart from the G320. Also, switching the encoder lines on and off from the G320 might make it upset. If you did not disconnect the encoder, the G320 would error out as soon a the "spindle" started spinning.

I know Mach can perform both functions. I just need to find out how, if possible, to switch between the two functions programmatically from Gcode. A VB macro might do the job, but someone with much more knowledge in that would have to say how to do it.

Art? Brian? :)

18
I have an application that is very much like a lathe, where I have a servo motor with a 500 count encoder driving the spindle, powered by a G320.
I would like to know if I can switch Mach modes from "velocity" mode to "position" mode from my Gcode, so that I can also use the spindle as a "C" axis for indexing the stock in the spindle for live tool machining, from within my program.

IE- 
For normal spindle mode, I know Mach can run a "spindle" with steps or PWM. I would use steps, since it is going to a G320 servo amp.
Then for angular control, I know Mach can output step and direction, and is a normal rotary "C" axis.

I need to know if I can switch between these two modes dynamically from my Gcode program? I understand that absolute position would be lost while in spindle mode, but that would be OK..

Thanks-
Colin

19
General Mach Discussion / Re: Stepper's spinning with glitch'es
« on: March 10, 2008, 12:15:35 AM »
I had this same problem on a Dell Inspiron 8200 2ghz. I followed your directions and it now works like a champ. Thanks!

20
General Mach Discussion / Re: Tool measure macro
« on: August 01, 2006, 05:04:43 AM »
Hi. I have not done any scripting in Mach, but it looks much like VB code, which I am familiar with.

Brian- can you set a DRO to a value that is in a variable?

Instead of this:
Code: [Select]
Offs = ZposOld - ZposNew

ZNew = 0
ZNew = ZNew - Offs

Code "G53 G00 Z0.1"

Code "G00 x0 y0"

Code "g00 z" & ZNew
Call setdro (2,0.000)

Can you do this?
Code: [Select]
Offs = ZposOld - ZposNew
Call setdro (2,&Offs)   'Set the value of the DRO to the value that is in "Offs"
Code "G53 G00 Z0.1"   'or hoever high you want to go to get up safely off the probe
Code "G00 x0 y0"

This would get around having to goto the zero to set it, correct?

Pages: « 1 2 3 4 »