Hello Guest it is April 25, 2024, 12:40:36 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 - mark4

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »
51
Mach4 General Discussion / Re: A solution for more switches than inputs
« on: February 10, 2018, 08:05:15 PM »
Hello
its 2 inputs doing the same thing why not just have a cycle start and cycle stop then if they = one or the other do something else

its not wrong the pendants do it exactly the same. the function decides which button is pressed or which switch is active and that part isnt working right. if i were to have one input doing cycle start and one input doing cycle stop and another function ex feed hold then you would also cycle start or stop at the same time you tried to feed hold the diodes seperate that out. i am attaching a drawing i through together. you will note 3 positions of the rotaty switch position 1 output 1 position 2 output 2 position 3 output two and three at the same time which makes position 3 and the diodes dont let it feed back. problem i have is switch bounce and i believe 3 doesnt trigger the exact same so sometimes i get one of the other two before i get three. i am planning to add debounce to the switches and see if that helps. i dont know how to add a delay to lua script yet but i am working on it.

52
Mach4 General Discussion / Re: A solution for more switches than inputs
« on: February 10, 2018, 02:18:09 AM »
thanks for the reply and yes i tried that. my lua is something i am still learning. the signals were set up properly and working the problem was false triggering. as i was trouble shooting i took all extra wires off the pokeys completely the only ones i left were for cycle start and cycle stop push buttons. every time i pressed either button the history would show multiple presses. but thats not the worst after playing with it i stepped back and watched the history bar the machine cycled between cycle stop and cycle start all by itself. i tried resistors and capacitors i tried grounding the ps which was a small 5v power supply connected only to the pokeys board. one thing i didnt mention. i installed the pokeys board in my operator control cabinet. the only things in that cabinet are the computer,keyboard,mouse,monitor. two rotary switches one mpg adapter and one mpg. basically nothing that should bother the pokeys board. my drive cabinet houses everything else. i tried there tech support didnt much like the fact that i couldnt directly reply to the email had to go to there sight and log in tedius. at this point even if there is something more i can do with pokeys i would be very reluctant to do so. i am a machine rebuilder and i need to support my machines. a machine that can start itself with no input is just plain dangerous. i am sure there are people who make out well with the pokeys board but i didnt. the solution i came up with gives my machines
ac servo drive
four axis
index homing
spindle encoder
vfd
probe input
mpg
what more could you ask for
at this point it isnt about the pokeys its about coding to make the logic work for the switches
luck
mark 

53
Mach4 General Discussion / Re: A solution for more switches than inputs
« on: February 09, 2018, 11:22:59 PM »
capacitor size .1 microfarads typo

54
Mach4 General Discussion / A solution for more switches than inputs
« on: February 09, 2018, 10:33:25 PM »
Hello i havent posted for a while had different problem with controllers and function. this is where i am at i have a cnc control built around the Ethernet Smooth Stepper and the MB2. i added a pokeys board to make up extra inputs i needed. i tried to use it for mpg that didnt work so i put my mpg back to the ESS and continued to use the pokeys 56e for some simple inputs two rotary switches and three push buttons. also 9 led's. none of this worked i tried to update the firmware on the pokeys. i tried capacitors and resistors like the manual said. nothing worked i kept getting false triggering that is a problem when one of your switches is cycle start. so my next solution for not enough inputs. i realize i can use two inputs to make three if i do it like this first switch input one on. 2nd switch input 2 on. 3rd switch input one and two on at the same time however on switch three use two diodes so they cant back feed.
the same thing can be done with more my second rotary has 4 positions i use 3 inputs and two diodes. and three push buttons just to cover everything. electrically they work good i can see the led's on the MB2 light up exactly as they should. so here is my problems i just guessed at the diodes can anybody help me with what size diode to use for a 24v system set up like this. probably about switch timing but i dont know. 2nd lua script is something i am working on (side note some of the manuals and examples for lua look very different to do the same thing, confusing) so this is what i set up for the 3 push buttons in screen load script.
---------------------------------------------------------------
-- Signal Library
---------------------------------------------------------------
SigLib = {
[mc.OSIG_MACHINE_ENABLED] = function (state)
    machEnabled = state;
    ButtonEnable()
end,
[mc.ISIG_INPUT1] = function (state)
    if (state == 1) then
        Cycle()
     end
end,
[mc.ISIG_INPUT2] = function (state)
    if (state == 1) then
        Cycle()
    end
end,

---------------------------------------------------------------
-- Cycle Start, Feed Hold, Cycle Stop function
---------------------------------------------------------------
function Cycle()
--function CycleStop()
    local hsig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT1)
    local Input1, rc = mc.mcSignalGetState(hsig)
    local hsig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT2)
    local Input2, rc = mc.mcSignalGetState(hsig)
    --Cycle Stop
    if Input1 == 1 and Input2 == 1 then
    mc.mcCntlCycleStop(inst);
    mc.mcSpindleSetDirection(inst, 0);
    mc.mcCntlSetLastError(inst, "Cycle Stopped");
    end
    if Input1 == 0 and Input2 == 1 then
    mc.mcCntlFeedHold(0)
    end
    if Input1 == 1 and Input2 == 0 then
    --function CycleStart()
    local rc;
    local tab, rc = scr.GetProperty("MainTabs", "Current Tab")
    local tabG_Mdione, rc = scr.GetProperty("nbGCodeMDI1", "Current Tab")
    local tabG_Mditwo, rc = scr.GetProperty("nbGCodeMDI2", "Current Tab")
    --See if we have to do an MDI command and if so, which one
        if ((tonumber(tab) == 0 and tonumber(tabG_Mdione) == 1) or (tonumber(tab) == 2 and tonumber(tabG_Mditwo) == 1 )) then
            local state = mc.mcCntlGetState(inst);
            if (state == mc.MC_STATE_MRUN_MACROH) then
            mc.mcCntlCycleStart(inst);
            mc.mcCntlSetLastError(inst, "Do Cycle Start");
            else
                if (tonumber(tab) == 0) then  
                scr.ExecMdi('mdi1');
                mc.mcCntlSetLastError(inst, "Do MDI 1");
                else
                scr.ExecMdi('mdi2');
                mc.mcCntlSetLastError(inst, "Do MDI 2");
                end
            end
        elseif tonumber(tab) > 2 then --No G Code or MDI panel is displayed so Do Nothing
            mc.mcCntlSetLastError(inst, "Nothing to Start");
        else --Do CycleStart
            mc.mcCntlSetLastError(inst, "Do Cycle Start");
            mc.mcCntlCycleStart(inst);      
        end
    end
end

this works well and doesnt false start except when you press the third switch which is stop you can get a quick cycle start first then stop in the history i dont know if this is a problem or will be and it could be related to the diodes or i need to add a capacitor of .01 across my switches. i tried adjusting filtering but that didnt seem to help. i think the solution is in lua but i dont know enough lua. my next piece of code is for mpg jog X Y Z and A axis.

[mc.ISIG_INPUT4] = function (state)
    if (state == 1) then
        Mpg()
    end
end,
[mc.ISIG_INPUT5] = function (state)
    if (state == 1) then
        Mpg()
    end
end,
[mc.ISIG_INPUT6] = function (state)
    if (state == 1) then
        Mpg()
    end
---------------------------------------------------------------
--Mpg Axis Increment
---------------------------------------------------------------
function Mpg()
    local hsig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT4)
    local Rotary1, rc = mc.mcSignalGetState(hsig)
    local hsig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT5)
    local Rotary2, rc = mc.mcSignalGetState(hsig)
    local hsig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT6)
    local Rotary3, rc = mc.mcSignalGetState(hsig)
    --Mpg X
    if Rotary1 == 1 and Rotary2 == 0 and Rotary3 == 0 then --Mpg X
        mc.mcMpgSetAxis(inst,0,0)
        mc.mcCntlSetLastError(inst,"X Selected")
    elseif Rotary1 == 0 and Rotary2 == 1 and Rotary3 == 0 then --Mpg Y
        mc.mcMpgSetAxis(inst,0,1)
        mc.mcCntlSetLastError(inst,"Y Selected")
    elseif Rotary1 == 0 and Rotary2 == 0 and Rotary3 == 1 then --Mpg Z
        mc.mcMpgSetAxis(inst,0,2)
        mc.mcCntlSetLastError(inst,"Z Selected")
    elseif Rotary1 == 0 and Rotary2 == 1 and Rotary3 == 1 then --Mpg A
        mc.mcMpgSetAxis(inst,0,3)
        mc.mcCntlSetLastError(inst,"A Selected")
    elseif Rotary1 == 0 and Rotary2 == 0 and Rotary3 == 0 then --Mpg off
        mc.mcMpgSetAxis(inst,0,-1)
        mc.mcCntlSetLastError(inst,"No Axis Selected")
    end
end
i haven gotten to coding the last switch which is a rotary for increment x1 x10 x100. the mpg jog code works somewhat it will turn on X then Y then Z then A then go back as long as i dont go to fast. however it doesnt like to shut off mc.mcCntlSetLastError(inst,"No Axis Selected") i have only checked it with set last error so far my thought if it doesnt pass there how is it going to work. so i turn the switch to x then y then z then a then back fast slow ridiculous speed and is doesnt confuse to bad however it doenst like to shut off the last block of code i have done two ways as you see it and like this
else
        mc.mcMpgSetAxis(inst,0,-1)
        mc.mcCntlSetLastError(inst,"No Axis Selected")
    end
end
this was better in that i got "No Axis Selected" from the outer switches y z a if i moved quickly but when i was on X and turned it to off it stayed X axis selected or should i say it didnt change to no axis selected as X was just the last axis selected and the others could be slugish. i thought about using the PMC for ladder logic and for speed might solve my problem however after looking it over unless somebody helps me set up the first rung for one input on and two inputs off jogs mpg i havent the foggiest idea of how to do it. also there is probably a better way with screen load script or maybe i should be using plc and dont know it. if i /we can find a way to make this work i can have my full blown control with inputs for probe and spindle A B I encoder. and i am sure others can benefit from this solution. thank you
mark

55
Mach4 General Discussion / Re: Goto work 0
« on: February 07, 2018, 09:37:40 PM »
hello i like the new with autotune features thats huge i have been doing this for long enough that tuning pid loop you need a weji board and spiritual assistance. and even then i am never sure i am right or way off. i know there are people out there that can do the math and are great pid tuners but i am not one of them lol. autotune takes five minutes the drives do it themselves all i do is click and i can go onto other problems such as goto work zero. i do want to give a shoutout to ESS teck support they are great to work with. luck
mark

56
Mach4 General Discussion / Re: Goto work 0
« on: February 05, 2018, 08:51:09 PM »
hi
i use DMM ac servo drives they are very easy to program and the only thing i had to buy to program was a cable. there tech support has been very knowledgeable and helpful. the can configure step/dir, quadrature, analog and i think something else. and they have configuration software. if thats not enough they will output a full encoder output. i use them in 1/2 of the machines i rebuild.

57
Mach4 General Discussion / Re: Goto work 0
« on: February 05, 2018, 08:08:18 PM »
thanks for the reply and i see what you mean by trouble shooting. fortunately i found the problem the latest ESS plug in is at fault the machines i believed to be almost exactly the same are except for one thing the plug in the one with the problem has the latest ESS plug in the one that is working had v193 i didnt catch this when i was writing paper work. so i tried 193 and it works fine goto zero no problem. for this machine i am going to stick with 193 and move up when i can verify them to work. the important thing is i have a working controller and a functional machine. i use ac servo drives with quadrature signal and home to the index pulse so that takes care of accuracy. my fault output is hooked to an input although that might not have been programmed at the time. the drives themselves have led's to tell you fault. that was one of the problems i had troubleshooting the board led's were working exactly as they should.luck
mark

58
Mach4 General Discussion / Goto work 0
« on: February 05, 2018, 02:15:17 PM »
Hello i have a puzzle. i am running a Ethernet Smooth Stepper with a MB2 and three AC servo drives on a small mill. i have another mill that is almost exactly the same it doesnt have this problem. history 1st i tried to install the latest mach4 release and the latest build on the smooth stepper. this worked until i tried to jog then it wouldnt jog above .01" if you tried i made like it was moving the dro's changed but the machine didnt move. note my setup has a relay set to run the oiler whenever and axis is moved the relay clicked on like it was moving. so after allot of back and fourth i decided to use mach4 install 3233 as this is on the other machine and works fine the problem with the mpg jogging went away. think i am home free think again.
now the mpg jog works in all increments. i can home to the index pulse. but when i try to goto zero the machine moves a small increment and bumps to an abrupt stop, if i hit the button again it will move another small increment and abrupt stop, if i hit the button the right amount of times with abrupt stops sometimes it will continue all the way to zero. note i am not doing z yet so just x and y. i can see the leds on the MB2 and havent seen anything wrong they all light up as expected no flicker except on the index pulse and that is expected. i have my own lua scripts and also was using a pokeys board but for my latest tests i went back to windows 7 mach4 build 3233 ESS build 216 no pokeys and installed a complete virgin mach4 with no script modifications. homing went well goto zero same problem. also i get no errors mach thinks it is doing the right thing. i turned on logging and am attaching file of homing, trying to goto zero, and on the last press actually going all the way to zero
if you have a work around know what i have done wrong or can just define the problem please help
i am desperate
thank you
mark

59
CS-Lab / Re: HELP new to csmio-s and MPG module.
« on: December 03, 2017, 12:42:44 AM »
hello i dont know because i dont have it set up at the moment. but two questions did you set it up in the mach mpg tab i believe the mpg must be enabled there. and in the diagnostics for the controller there might be a place to see if it getting pulses. also the plug in for the ip-a has settings for the mpg which must be configured i believe the same applies to the ip-s. check the paperwork even if it is for mach 3 it may clue you in it has for me in the past. good luck
mark

60
CS-Lab / Re: CSMIO IP/M - No connection / Problem with IP Adress?
« on: October 21, 2017, 12:19:12 AM »
hi i dont know if this will help or not but i have set up a few csmio/ip-a and they dont require a cross over cable just straignt through however if you are using a cross over cable and dont need one that could be your problem.
mark

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