Hello Guest it is March 19, 2024, 04:28:04 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 - jevs

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 »
71
Sounds good. Based on posts here, I will leave it as it is and avoid tying anything together.
If I can remember that using the CTRL key works it should work fine....:)

72
I talked with Machmotion this morning. It sounds like there may have been some limitations with Mach3 that may have affected how things were setup back then.
From the conversation we had, it seems like it may be more normal and desired that FRO never affects any manual jogging speeds weather incremental or continuous (at any percentage)?
 
Which means the way I have it now should be good (without trying to tie the FRO switch to step jog position move rates)? They said basically FRO should only affect G01 moves (Which I assume no manual jogging would be included in that)?




73
That is good to know. Thank you.

Is there a specific reason it was chosen that the keyboard does not or should not follow the onscreen selection of incremental vs continuous?

74
On my Machmotion X15-10-01 Control Panel when used with Mach3, the Feedrate Override switch would also slow down or speed up the incremental jog speed.
I thought it also affected it in the different Continous Jog % settings, but I cannot recall for sure and the manual only specifies this:
"With the Feedrate Selector you can adjust the feedrate override from 0% all the way to 130%. You can use it to slow your machine down while running a program. Also, in step jog mode the speed of the axis is regulated by the Feedrate Selector."

I do not have to stick with this way of doing things, but I am not sure how FRO should work in relation to Manual jogging normally? It seems that stock Mach4 FRO does not affect incremental or continous jogging.

Looking for some advice how I should do it.

See page 5 and 6 for the control panel I am using.

https://machmotion.com/documentation/CNC%20Controls/X15-200/X15-200%20User%20Manual.pdf
 

75
Is there a reason the keyboard buttons will only jog continuous and not incremental?

Should it be kept this way?

If not, is there a way to make them also do incremental when you have that selected?

76
This seems to be working perfectly so far! I tested everything out and it seems to be working great!
Thanks a million for doing this. This saved me a ton of time and also showed me some new things to do.

I am going to attempt to move on to the feed rate switch next and then the pendant. What you did here gives a great example. I am sure some others will benefit from this code if they find it in the search.

I think this one is solved if no other questions come up.

Thanks again!

77
This is beyond anything I would have ever dreamed up! Thank you. I will give this a try tonight and report back.

78
I looked at this for a long time, but I do not understand it well enough to fix why it comes up "Error starting continuous jog" on initial boot of Mach4.
I have to give up for now. It is late. I tried a couple things, but just break stuff worse.

Code: [Select]
function jogAxis(axis, dir)
-- Get states of Inc and Cont outputs
local inst = mc.mcGetInstance()
local rc
-- Below is a work around as there is no mc.mcJogGetType API call
local axisLetters = {[0] = "X", [1] = "Y", [2] = "Z", [3] = "A", [4] = "B", [5] = "C"}
local hReg = mc.mcRegGetHandle(inst, string.format("core/inst/JogType%s", axisLetters[axis]))
local jogType = mc.mcRegGetValue(hReg)
--
if (jogType == mc.MC_JOG_TYPE_INC) and dir ~= mc.MC_JOG_STOP then --If incremental jog
local incVal = mc.mcJogGetInc(inst, axis) --Get increment value for the axis
rc = mc.mcJogIncStart(inst, axis, (incVal*dir)) --Start the inc jog
if (rc ~= mc.MERROR_NOERROR) then
mc.mcCntlSetLastError(inst, "Error starting incremental jog")
end
elseif (jogType == mc.MC_JOG_TYPE_VEL) and dir ~= mc.MC_JOG_STOP then --If continuous and not stopping
rc = mc.mcJogVelocityStart(inst, axis, dir)
if (rc ~= mc.MERROR_NOERROR) then
mc.mcCntlSetLastError(inst, "Error starting continuous jog")
end
elseif (jogType == mc.MC_JOG_TYPE_VEL) and dir == mc.MC_JOG_STOP then
mc.mcJogVelocityStop(inst, axis)
end
end

I am tempted to just comment out the error, because it seems to work fine if you just ignore it on first bootup...
I am down to getting this on first bootup, even though things seem to be working okay and the ESS error seams unrelated to the topic of this thread. It is there even if I disable things for this thread.

-----ESS: Limit Switch triggered on
Error starting continuous jog
Error starting continuous jog

One other thing to note is that every once in awhile if I am on the x1 switch position, a jog will go 2 inches instead of just one...this is random so far as I can tell. Maybe to do with switch bounce while it is still moving? It thinks you hit it twice so it goes 2 inches instead of one. I wonder if there is a way for it not to accept another input until it finishes the move? This way if there was some switch bounce it would be ignored if it occurs after the initial press, and before it finishes moving the command distance from the first press.



79
Any idea why I get "-----ESS: Limit Switch triggered" on  at bootup?
Nothing seems to be triggered, and homing works fine.
If you just ignore this, things seem to work fine, but it is annoying seeing it every time like there is something wrong...

80
I wasted a bunch of time testing my changes using the Jog- button and nothing happening LOL. I finally figured out you had it on input 50 instead of 52.
I was able to solve the crashing if the Axis selector switch was in the Off position.
I also fixed the Jog being at 2% on any of the Step-Jog positions by adding a command to set it to 100% when any of the Step-Jog positions are selected.
The one thing I have not fixed yet is getting the  "Error starting continuous jog"  from popping up at Mach4 boot up.
This may be the only thing left to find a fix!
The error at bootup does not occur if the Axis selector switch is in the Off position, since this stops it from calling the jogAxis function.
Code: [Select]
[mc.ISIG_INPUT51] = function (state) -- Jog+ Input
local axOff, rc = mc.mcSignalGetHandle (inst, mc.ISIG_INPUT43)
local Off = mc.mcSignalGetState (axOff)
local axisNum = getAxisToJog()
    if (Off == 1) then
elseif (state == 1) then
jogAxis(axisNum, mc.MC_JOG_POS)
else
jogAxis(axisNum, mc.MC_JOG_STOP)
end
end,
[mc.ISIG_INPUT52] = function (state) -- Jog- Input
local axOff, rc = mc.mcSignalGetHandle (inst, mc.ISIG_INPUT43)
local Off = mc.mcSignalGetState (axOff)
local axisNum = getAxisToJog()
    if (Off == 1) then
elseif (state == 1) then
jogAxis(axisNum, mc.MC_JOG_NEG)
else
jogAxis(axisNum, mc.MC_JOG_STOP)
end
end,
Code: [Select]
--Control Panel jog functions
function setJogInc(inc)
local rc, axisNum
local inst = mc.mcGetInstance()
--For each axis set the incremental value and jog type to inc
for axisNum=0,5,1 do -- X = 0, Y = 1, Z = 2
rc = mc.mcJogSetRate(inst, axisNum, 100)
rc = mc.mcJogSetInc(inst, axisNum, inc)
rc = mc.mcJogSetType(inst, axisNum, mc.MC_JOG_TYPE_INC)
end
end

function setJogRate(rate)
local rc, axisNum
local inst = mc.mcGetInstance()
--For each axis set the jog rate value and jog type to cont
for axisNum=0,5,1 do -- X = 0, Y = 1, Z = 2
rc = mc.mcJogSetRate(inst, axisNum, rate)
rc = mc.mcJogSetType(inst, axisNum, mc.MC_JOG_TYPE_VEL)
end
end

function jogAxis(axis, dir)
-- Get states of Inc and Cont outputs
local inst = mc.mcGetInstance()
local rc
-- Below is a work around as there is no mc.mcJogGetType API call
local axisLetters = {[0] = "X", [1] = "Y", [2] = "Z", [3] = "A", [4] = "B", [5] = "C"}
local hReg = mc.mcRegGetHandle(inst, string.format("core/inst/JogType%s", axisLetters[axis]))
local jogType = mc.mcRegGetValue(hReg)
--
if (jogType == mc.MC_JOG_TYPE_INC) and dir ~= mc.MC_JOG_STOP then --If incremental jog
local incVal = mc.mcJogGetInc(inst, axis) --Get increment value for the axis
rc = mc.mcJogIncStart(inst, axis, (incVal*dir)) --Start the inc jog
if (rc ~= mc.MERROR_NOERROR) then
mc.mcCntlSetLastError(inst, "Error starting incremental jog")
end
elseif (jogType == mc.MC_JOG_TYPE_VEL) and dir ~= mc.MC_JOG_STOP then --If continuous and not stopping
rc = mc.mcJogVelocityStart(inst, axis, dir)
if (rc ~= mc.MERROR_NOERROR) then
mc.mcCntlSetLastError(inst, "Error starting continuous jog")
end
elseif (jogType == mc.MC_JOG_TYPE_VEL) and dir == mc.MC_JOG_STOP then
mc.mcJogVelocityStop(inst, axis)
end
end

function getAxisToJog() --This function looks at the inputs for the axis selector and returns the axis number for the one that is selected
local inst = mc.mcGetInstance()
local axisToJog, k, v
--Create table for axis input signals
local axesTbl = {[0] = mc.ISIG_INPUT44, [1] = mc.ISIG_INPUT45, [2] = mc.ISIG_INPUT46, [3] = mc.ISIG_INPUT47, [4] = mc.ISIG_INPUT48, [5] = mc.ISIG_INPUT49}
-- Find the input that is active and return the axis number
for k,v in pairs(axesTbl) do
local hSig = mc.mcSignalGetHandle(inst, v)
if (mc.mcSignalGetState(hSig) == mc.MC_ON) then
axisToJog = k
break
end
end
return axisToJog
end

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 »