Hello Guest it is April 28, 2024, 05:37:55 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.


Topics - TTalma

Pages: « 1 2 3 4 »
21
Mach4 General Discussion / Is there any way to home a single axis?
« on: February 08, 2019, 01:42:48 PM »
As the title states is there any way to home a single axis? I have a setup I use rarely, and I only care about homing the Z axis. If I forget to home the machine I have to go through setting up my X and Y again.

22
Mach4 General Discussion / How do I wait for spindle at zero in my script?
« on: February 02, 2019, 05:55:01 PM »
I have my output from my VFD set to trigger when it is at zero. I have this connected to the Spindle at zero input. When I check with a meter this is going low. It takes 10 seconds for my spindle to stop.

So I added some script to make sure my spindle is stopped when doing a tool change.

    ------ Make sure the spindle is stopped ------
    mc.mcCntlGcodeExecuteWait(inst, "M5\n")
    local SpindleAtZero = mc.mcSignalGetHandle(inst, mc.ISIG_SPINDLE_AT_ZERO)
    --local ret2 = mc.mcSignalGetState(mc.ISIG_SPINDLE_AT_ZERO)
    local ret = mc.mcSignalWait(inst, SpindleAtZero, mc.WAIT_MODE_LOW, 10.0)

The first line appears to work and tells the spindle to stop.

The second line returns a number

The third line (Commented out) crashes Mach 4???????? So I have no way of telling what mach reads this as.

The 4th line always returns -2, and the is immediately skipped over even if the spindle is still rotating.

What am I doing wrong? I thought this line would make the machine stop and wait until it had stopped rotating, or the timeout expired. It's doing neither.

How do I wait for spindle at zero?

23
Mach4 General Discussion / How can I smooth out motion in my LUA script
« on: January 30, 2019, 11:24:52 AM »
I wrote a script for my tool changer and got it working with help from here.

Now I would like to do a little optimization. One of the problems is that during the tool change cycle the motion is pausing during the different operations. I would like to eliminate the pauses if possible.

For example part of the lowering to pick up the sequence is:
Lower over tool holder
Turn on blow off
Lower some more
Turn off blow off
Turn on Drawbar open

There is a stop in motion at each point where I ether turn on or turn off an output. Is there a way to turn on/off the outputs with out stopping the machine motion?

Here is my code for that sequence:

    ------ Lower to blow off start position ------
    local GCode = ""
    GCode = GCode .. "G00 G91 Z-2.0\n"
    mc.mcCntlGcodeExecuteWait(0, GCode)
   
    ------ Turn on Blow off  ------
    local BlowOff = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT0)
    mc.mcSignalSetState(BlowOff, 1)

    ------ Lower to pick up start position shut off blow off, turn on drawbar------
    local GCode = ""
    GCode = GCode .. "G00 G91 Z-.25\n"
    mc.mcCntlGcodeExecuteWait(0, GCode)
    mc.mcSignalSetState(BlowOff, 0)
    local DrawbarOPEN = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT1)
    mc.mcSignalSetState(DrawbarOPEN, 1)

24
I worked on a LUA tool change script this weekend. It is working great except that the script needs to run twice for the Current tool number to be updated.

What happens is on power up. Tool 1 is loaded by default, and I command T4 M6, (or M6 T4), The machine changes to tool 4. Then if I command T2 M6. The message pops up that tool 4 is already loaded. But if command T2 M6 again, the machine changes to tool 2. And this continues for each tool change command.

It is mostly a copy from the LUA programming script tool change function. I've attached my code. I can't see where this is going wrong. Does anybody have any idea? (Had to add TT to the file name to get it to upload)

25
I am writing my tool change script for my CNC. I am a little confused about how to handle the outputs. I am using a smoothStepper board. For a simple first test I want to just turn on the blow off, lower the z axis 1" and turn off the blow off. But I don't know how to assign the output.

I have been reading through the Mach4 Scripting Manual and I am using the sample code in there for reference. (In the code it uses a variable(?) "inst" what is "inst"?)

I am using port 1, pin 7 on the smooth stepper for the blow off. I have named the pin "Blow Off" in the pin assignments.

So what is the "mc." designation? Is there a list of these somewhere that I can find that maps the I/O and other signals I can read?

Here is my code:

function m6()
    ------ Turn on Blow off ------
    local BlowOff = mc.?????????????????
    local bosig = mc.mcSignalGetHandle(inst, BlowOff )
    mc.mcSignalSetState(bosig, 1)

    ------ Move to current tool change position ------
    local GCode = ""
    GCode = GCode .. "G00 G91 G53 Z-1.0\n"
    mc.mcCntlGcodeExecuteWait(inst, GCode)

    ------ Turn off Blow off ------
    mc.mcSignalSetState(bosig, 0)
end
if (mc.mcInEditor() == 1) then
    m6()
end

26
Like the title says is there an advantage to using Modbus to talk to your VFD? I just purchased an Delta MS300 VFD. Reading through the manual it talks about using Modbus to talk to the controller.

I've never looked in to this, so I don't really know anything about it.

So I am wondering if I set up Modbus communication what advantages does it have over direct wiring. Can I get speed feedback, better control of the VFD? What amount of effort is required to set it up. (I am a software engineer so some programming doesn't bother me).

All I currently have connected to my unit is 0v-10v speed input, fwd/rev, spindle at speed, spindle at stop.

Thanks!

27
Mach4 General Discussion / Calling one G-Code file from another
« on: September 18, 2018, 11:48:25 AM »
I am working on a few files for making a few different parts (12 to be exact) that are similar. The files are all several thousands of lines long. I currently have each of the major steps in making the parts broken up into different functions.

As I am troubleshooting and making changes to a function, I need to go into each of the files and make the same change.

Is it possible to break each of these functions in to their own file, and then call each of these files from a main file, so if I need to make a change I only need to do it in one place? I hope my explaination makes sense.

If there is a way can someone post a short sample?

Thanks!

28
I am wondering how the home offsets work in Mach 4. I set up a fence on my machine to register my stock. I would like the center of the tool in the X and Y directions to align with the corner of the fence. I have this point set at X = -3 from homing switch, Y= -1 from homing switch. Those values don't appear to do anything.

I have my machine setup with the homing and limit switches being shared.

In the homing tab under setup I have X home offset = -3, Y home offset = -1.

I hit the ref all axis home button. The machine moves until the switches are triggered, backs off the switches (moves about 1/16"  or less), the DRO then displays X=0, Y=0, Z=0.

I would like the position set and the DRO to X=-3, Y = -1. Or the machine to move 3" in the X direction and 1" in the Y direction. How do I do this?

29
Mach4 General Discussion / My File is running real slow
« on: April 09, 2018, 06:44:13 PM »
I am running the file below:

This is a new machine, and this is the first file I am attempting to run.

When it runs the machine moves real slow. But shouldn't it be running at the machines maximum feedrate? (I am air cutting to test it out). Currently as it is running it would take about 20 min for A to turn 360 degrees.

The only thing I can think of is that it's the settings for the motors. When I add A to the motion is when it slows way down. X, Y, Z resolution is .005". My goal for the A axis is to have the same resolution at a 4" circumference.

What do i need to do to get my code running at a decent speed?

X: 2000 steps/inch, Velocity 350 Inches/min, Accel 50
Y: 2000 steps/inch, Velocity 350 Inches/min, Accel 50
Z: 8000 steps/inch, Velocity 50 Inches/min, Accel 12.5
A 81.2698 steps/inch, Velocity 10800 Inches/min, Accel 2700



O0001
G90
G00 X0 Y18.5
G00 Z-1
G91
M98 P2 L36 (call function, Function 0002, do it 34 times ->18 inches)
G01 Y-.25 A180
G01 Y-.125 A90 Z.29
G00 Z0
G00 Y0 A0
M30
(Thread cutting loop)
O0002
G01 Y-.5 A360
M99
%

30
Mach4 General Discussion / How do I make "Go to Work 0" work?
« on: April 02, 2018, 10:14:47 AM »
I completed setting up Mach 4 with my machine. I have everything working except the "Go to work 0" button. When I press it, it does nothing.

What I am doing.
1. Power up machine
2. Star mach 4
3. Home machine
4. Find the corner of my board
5. Press the "Zero X", "Zero Y", "Zero Z"
6. move to a random spot on the table
7. Hit "Go To Work 0"

Nothing happens except the screen flashes.

I am using an ESS smooth stepper if that makes a difference.

I'm ready to purchase a license for Mach 4, but unless I can get this feature working, the program is useless for my projects. After all the work setting it up I'd hate to abandon it.

Pages: « 1 2 3 4 »