Hello Guest it is March 28, 2024, 01:40:50 PM

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 - Ya-Nvr-No

201
Mach4 General Discussion / Re: Screen Set Ideas
« on: November 18, 2014, 07:23:26 AM »
liked the feature so much I created a toggle button to turn it on and off and added the other motor count values
Add toggle button, I named it togCounts
Labeled the Text Up and Down condition
set the Button Color and Text Color in both the Up and Down states
Then put this code is at the bottom of the PLC script

Code: [Select]
local togcountButState = scr.GetProperty("togCounts","Button State", "Button State",'0');
if (togcountButState = '1') then
    counts0,rc = mc.mcMotorGetPos(inst, 0, 0);
    counts1,rc = mc.mcMotorGetPos(inst, 1, 0);
    counts2,rc = mc.mcMotorGetPos(inst, 2, 0);
    counts3,rc = mc.mcMotorGetPos(inst, 3, 0);
    counts4,rc = mc.mcMotorGetPos(inst, 4, 0);
    counts5,rc = mc.mcMotorGetPos(inst, 5, 0);

    if (oldcounts0 ~= counts0 or oldcounts1 ~= counts1 or oldcounts2 ~= counts2 or oldcounts3 ~= counts3 or oldcounts4 ~= counts4 or oldcounts5 ~= counts5) then
        mc.mcCntlSetLastError(inst, "Counts".." X = "  ..tostring(counts0).." Y = " ..tostring(counts1).." Z = "  ..tostring(counts2).." A = " ..tostring(counts3).." B = " ..tostring(counts4).." C = " ..tostring(counts5));
        oldcounts0 = counts0;
        oldcounts1 = counts1;
        oldcounts2 = counts2;
        oldcounts3 = counts3;
        oldcounts4 = counts4;
        oldcounts5 = counts5;
    end
end

202
Mach4 General Discussion / Re: Screen Set Ideas
« on: November 16, 2014, 06:16:25 AM »
I set it to four because these are quadrature signals

http://www.ni.com/white-paper/4763/en/

and the functions I provided is for the MPG hand dial, has little to do with the mouse scroll wheel example, other than that was my lesson in the logic.

203
Mach4 General Discussion / Re: Screen Set Ideas
« on: November 15, 2014, 08:44:23 PM »
Did you setup encoder 0 in Darwin for the MPG A & B (like pins 11 & 12) you have the MPG hooked to 5 volts and a ground?
make sure you test in Darwin to make sure you are getting the counts to read up and down as you turned the dial?
should see multiples of 4 counts up and back.

Once that's done you just use the functions I'd provided placed in a script under a toggle button.
0=encoderid from darwin
0=X axis in mach4
1=Y, 2=Z and so on
So when the button is down it accesses the axis and mpg you want and when up make sure you set the increments back to 0.

It's pretty simple, the hard part is setting up multiple dials and mapping, but really its just time consuming. Works sweet.

204
Mach4 General Discussion / Re: Screen Set Ideas
« on: November 15, 2014, 07:01:27 PM »
Just so you can see Darwin works with MPG, thou i have to admit I was rushing it a bit and was ahead of the speed set.

https://www.youtube.com/watch?v=l715pq7cis8

205
Mach4 General Discussion / Re: Screen Set Ideas
« on: November 15, 2014, 06:36:17 AM »
Thanks Gerry
I knew it was not lost, but I sure don't remember getting it from there.   :-[ Hell to get old.

I included the folder link. Hopefully Brian will add to it soon with other cool features

ftp://machsupport.com/Mach4_Lua_Scripts/Panel_Scripts/

206
Show"N"Tell ( Your Machines) / The "Mach4" 3D Laser Build
« on: November 14, 2014, 09:31:58 PM »
No wonder she lets you have the basement as your man cave,  ;D

207
Mach4 General Discussion / Re: Screen Set Ideas
« on: November 14, 2014, 09:13:13 PM »
Brian had provided a wizzard to use the mouse scroll wheel as a MPG so I picked up a lot in that example, sorry not sure where its at as I did a search but cant find it.

208
Mach4 General Discussion / Re: Screen Set Ideas
« on: November 14, 2014, 05:56:28 PM »
If you start typing mc.mcMpg you get a whole list of functions to choose from on a drop down list. All started from some scatted files created and shared. I spent hours copying and pasting what popped up when I started the wx.wx list. And then LOTs & LOTs of trial & error to start to grasp how to use Lua. There is scattered tidbits of info all over the mach4 forum section. And my understanding is they are working on a reference doc.

http://www.machsupport.com/forum/index.php/topic,27141.0.html

209
Mach4 General Discussion / Re: Screen Set Ideas
« on: November 14, 2014, 01:05:08 PM »
I did them with function calls, I just pass the data from the button to a common function.

but this is basically what you need to set

    joginc = mc.mcJogGetInc(inst,0); -- get the present increment

    mc.mcMpgSetAxis(inst, encoderid, axisid); --mpg encoder , axis ;  encoder 0, X axis 0
    mc.mcMpgSetAccel(inst, encoderid, 15); -- 15%
    mc.mcMpgSetRate(inst, encoderid, 100); --100
    mc.mcMpgSetCountsPerDetent(inst, encoderid, 1); --one click give one incremental step
    mc.mcMpgSetInc(inst, encoderid, joginc); -- pass the increments from the MPG encoder steps

210
Show"N"Tell ( Your Machines) / The "Mach4" 3D Laser Build
« on: November 14, 2014, 11:47:37 AM »
Just did a crude test using the hanging scale, doing the best I could without stressing to failure I got the following.
The pmdx board faulted out on the lower three heights but I never pushed it beyond the third test height as I did not want to create mechanical failure.
the inch value is the overall height of the lift table, used as a reference value.

@bottom 5-1/2" pmdx stopped at 25#
6-1/2" 55#
9-1/4" 110#
11-1/4" 140# I stopped
11-3/8" 180#