Hello Guest it is April 29, 2024, 10:21:00 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 - Fledermaus

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »
101
Quote
1mm becomes a 25.4mm jog

Scared the pants off me a few times. This was my motivation for abandoning the stock jogging facility.

Allan

102
Well, I've never had to run without a final M5 but you could try writing a custom M30 macro. Essentially, this would just contain the code to stop the spindle, Mach4 would still do the essential housekeeping at program termination.

By the way, if you wanted to try my jog screen for real to see what suits you and what doesn't, I could post the actual screen tab that you could drop into the screen tree manager. I think that and the awprobing module are the brunt of what you'd need, but of course you'd need to add a require statement for the module to be recognised.

Allan

103
striplar

Sounds like you may be doing something similar to what I attempted. I also found it impossible to reconcile all of the internal values used by Mach4, which is why I decided to take an independent approach.

As the screen shot shows, I use a set of buttons to set the jog increment. I find this to be quick and convenient in use; to me it is preferable to the stock arrangement. You might reasonably conclude that I'm not a lover of the bland colour schemes that seem popular at present.

The button scripts are all one-liners. I started with the function codes in the screen load script but ultimately moved them into a separate module. I find this is easier if I want to do a quick review or edit of it, as there is lo need to invoke the screen editor.

In case you are interested, I have attached the module code, for which I make no claims, special or otherwise.

Allan

P.S. After much time and frustration trying to post this I have combined the 2 files into a ZIP archive.

104

JofType is just the entry under the section [Preferences] in the machine.ini file. I can't remember for sure as it was some time since I did that, but if this entry is not in your machine.ini it must be one that I have added.

I have replaced the standard jog tab with one that uses a set of buttons that directly set the jog increment and type, and these are saved in machine.ini. The buttons cover increments from 0.01 to 10mm in a .01, .03, .1, .3 .. 3, 10 sequence, plus a continuous option. The values are taken from the list in Mach4's Configuration/Control. 

The jog buttons call the function listed above, plus a related button up function which stops motion. These same functions are accessed by the keyboard via signal table entries in the screen load script.

Allan

105
smurph

Point taken. I tend to use the return codes during debugging, but for simple calls like the above most returns are caused by parameter failures which should not normally occur once the code is stable. But I agree this is a short cut.

The probing module, which I have completely re-vamped, is another matter. Due to the likelyhood of issues, I check each and every return code associated with motion and control how errors propagate through the call chain.

Allan

106
Here is the actual button down script I use. I have totally replaced the stock jog functions and this has proved reliable for a long time. This should give you some ideas from which to build, but note that I do not take any stock value for distance and jog type, as I created my own and saved them in the INI file. I call this from buttons and from keys mapped into the signal script.

Code: [Select]
--AW Jog button down initiates motion.
-- type is taken from INI if no parrameter is supplied
function Jogging.JogBtnDown(axis, direction, type)
    local inst = mc.mcGetInstance()
    if (type == nil) then
        type = mc.mcProfileGetInt(inst,'Preferences', 'JogType', mc.MC_JOG_TYPE_INC)
    end
    local dist, rc = mc.mcProfileGetString(inst,'Preferences', "JogDist", '0')
    dist = tonumber(dist)
    local defUnits = mc.mcCntlGetUnitsDefault(inst)
    rc = mc.mcJogSetUnitsMode(inst, axis, defUnits)
    if (type == mc.MC_JOG_TYPE_INC) then
        if (direction == mc.MC_JOG_NEG) then
            dist = -1 * dist
        end
        rc = mc.mcJogIncStart(inst, axis, dist)
    elseif (type ==mc.MC_JOG_TYPE_VEL) then
        rc = mc.mcJogVelocityStart(inst, axis, direction)
    end
end

My default units are set to metric, and I've never experienced a switch to Imperial units when using the ablove.

Allan

107
Mach4 General Discussion / Re: Spindle at Speed
« on: May 10, 2018, 05:22:15 AM »
Excellent news Steve. Sounds like all should be good very soon.

Allan

108
Mach4 General Discussion / Re: Spindle at Speed
« on: May 09, 2018, 04:27:39 PM »
Hi Craig

My comments applied only to Steve's suggestions. These do not have the 0-63 limit. Sorry if I muddled things.

Personally, I continue to use mcSignalWait() due to its more complete error handling.

Allan

109
Mach4 General Discussion / Re: Spindle at Speed
« on: May 09, 2018, 02:12:58 PM »
Hi Craig

We may be at cross purposes. I was referring to the call mcSpindleSetDirectionWait() mentioned by Steve above.  SignaWait() gives the error MERROR_TIMED_OUT as you might logically expect.

Allan

110
Mach4 General Discussion / Re: Spindle at Speed
« on: May 09, 2018, 02:05:22 PM »
Hi Craig

Just wondered where you got that info. It doesn't make much sense to me, as a bad argument is quite distinct from a timeout. When I tested the timeout condition returned error 0 (no error).

Allan

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »