Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: poppabear on July 03, 2016, 09:54:29 AM
-
LOVING the PMC!! Thanks Steve!!!
Scott
-
+1 on the PMC love!!!!!!!
-
I'm glad you guys like it! :)
-
;D Everybody who used brains but wanted them to be better and easier to use should be singing your praises right now. ;D
I can't wait to get my BTC-1 changed over to Mach4. Because of the PMC, I can do it without learning how to code all of my brains in LUA.
The PMC will allow me to do my toolchanger integration as well. It is so nice to be able to make a change without having to delete all the rungs below it.
PMC PMC PMC PMC PMC PMC
Thanks again Steve.
-
OK...what is a PMC?
-
Programmable Machine Controller. It is a Fanuc term. Basically, it is a ladder logic editor that spits out LUA code behind the scenes. VERY fast. It can be used instead of the regular Mach mapping of I/O or in conjunction with it.
The pros of the Mach I/O mapping is that it is event driven. The PMC runs at a defined timer interval, thus is not event driven. However, I did try to improve on that a bit at least for the Mach output signals. When any of them fire, I force a PMC cycle. So the PMC is basically event driven for the Mach output signals only. Otherwise, it runs on a cycle just like any other PLC type of thing. But... you can have insane timer intervals (depending on the PC hardware). I run my PMC object at 20ms intervals which is about the finest resolution my Atom board will do with a timer. They complete their cycles in less that 1ms. My real PC can handle 10ms intervals. The OS seems to be a limitation on timers as well because 10 ms is about the finest resolution I can get. But still! 10ms!! That is smoking.
Steve
Steve
-
This has actually made me think about looking at Mach4 again, took me long enough to get the basics of VB for what I needed and screwed if I was going to learn Lua to do the the basics in Mach4.
I am not a programmer and don't want to be, I just want to be able to get my machine working like I want and use it without having to be multilingual.
I have always liked ladder logic, it is natural to me and PMC, at first glance, seems to make having to learn Lua redundant, hope I am right ::)
Always wanted ladder logic for Mach3 but Brian doesn't seem to like it, he is a programmer and they are weird, looks like some are only half weird though :)
Hood
-
I assume you used LDmicro's Ladder Program, apparently that is the program that was 'ported' over.
i can't locate any examples from LDmicro , if there are any, i could sure use them.
Very nice job. I noticed that LDmicro has a 'make persistent' instruction, can this be added in the future ? .
Congrats on nice addition.
-
We did start with LDMicro. However, it was purely for the GUI as a starting point. To keep from having to re-invent that wheel. However, the GUI was cleaned up a bit (looks nicer without all of the dashed lines) and I added some nice features to make paralleling circuits easier, among other things. The back end guts were completely re-written for generating LUA code.
Some things that were in LDMicro just are not applicable to the Mach/LUA environment. Persistence can be done with Mach registers in the Regfile plugin. Then just use the PMC to operate on those registers that you define as persistent.
Just in case anyone is wondering, we did license the LDMicro code, so the GPL stuff does not apply. We paid the author handsomely. :) We will have to sell a LOT of Mach licenses to get a return on the investment. However, we consider it a win/win as we got the PMC a lot quicker that we would have otherwise and we like supporting guys that make cool software.
Steve
-
Thank You!!!!! For the PMC! Now I can the ATC going on my big old Fadal !!!!
-
I am trying to read a register on PMC, but cannot access the ESS encoder register. I can see in the diagnostics the encoder register just fine, but it is not accessible on PMC.
I would appreciate if somebody can help.
Thanks,
Arturo Duncan
http://cnc4pc.om
-
Arturo,
At this time, encoder registers are not included in the list of input registers. But are you needing an encoder value in the PMC? To drive an MPG? If so, you can associate an encoder to a MPG object in the Mach config.
Steve
-
Steve,
We need to read the motor encoder to compare it with commanded position when motor speed =0. To alert the user if an axis has lost its position.
I guess it can be done in a lua script, but thought a PMC would have been easier for users.
Let me know if you have any thoughts on doing this.
Arturo Duncan
-
Arturo,
I added the encoder registers in the list of input registers for the PMC. So the next build will have that in there. However, I really don't think the PMC is the proper place for it. That sounds like something the motion controller plugin should be doing.
Steve
-
Steve,
Thanks... Yes, I agree with you, it should be the ESS, we all hope that someday it will be able to process this in real time.
When do you think it will be available?
Arturo Duncan
http://cnc4pc.com
-
Well... that is hard to say. Maybe by week's end? I'm working on jogging during feed hold and it is a complex issue. :(
-
Why can't I find the PMC? I have the most recent version downloaded from the main page.
Edit* just realized I have to go to the ftp site to get the most recent builds. Is it safe to grab the latest release or should I stay back a couple?
-
The SAFE thing to do is use a general availability release from the main page. :) ANY of them from the development ftp site are likely to be bleeding edge.
Steve
-
I guess I have to play it safe. the Hicon plugin only supports up to 2914. PMC is looking good though.
-
I figured out I had to do a fresh install of the latest version to get the Hicon to communicate properly. I now have a dozen or so rungs working in the PMC. I am stuck on one right now that I just can't figure out. I have LED's that represent different jog increments (.01, .001, .0001). I have Mach4 setup to only step through these increments. I want each LED to light up when the corresponding step increment is active. I tried reading the jogincx variable into PMC using a read from register instruction, but it seems it is not reading the decimal value (I assume because the variable is long dim). How do I read this data type?
Thanks!
and BTW, I am way ahead of where I would be without the PMC.
-
Steve,
Any update on the new release?
Arturo Duncan
-
Probably not until after IMTS. :(
-
Steve,
I am now able to read the encoders in the ESS. THANKS!!!
I ran into a new issue. I cannot use decimal points on PMC. I need to do an operation where I multiply the encoder count by a multiplier to get the actual motor potion. But he operation is truncating decimals.
I did an small sample that probably illustrates the problem better. I am just diving 5 by 2 to get 2.5, but the simulation only shows 2, truncating the .5.
Let me know if you have any thoughts on doing this.
Arturo Duncan
http://cnc4pc.com
-
PMC was never meant to handle decimals as most PLCs don't have decimal registers. :( I'll see what it takes to put that in but it may not be trivial at all. It will not handle strings either, FYI.
-
Steve,
Do you have any thoughts on this? We could also move it to lua if you think PMC is not going to be the tool for this. We wanted to make it in PMC as we did one like for Mach3 using the brains that became very popular as it was very intuitive and easy to use, so users were able to do further implementation to it.
Arturo Duncan
http://cnc4pc.com
-
I think I have it working with decimals now. All of the tests I did showed good results. But I had to change a lot of code and I might have missed a path or two. It will be in the next release.
Steve
-
Steve,
Any news on the new release?
Arturo Duncan
http://cnc4pc.com
-
It should be there in the 3233 build.
-
Steve,
I cannot find that built. I am looking for it in the Development Versions Folder: ftp://ftp.machsupport.com/Mach4/DevlopmentVersions/
Arturo Duncan
http://cnc4pc.com
-
I guess they haven't posted it up then. :( I just make the builds but I don't put them up on the web site or ftp site. I'll see if can't find out what's going on.
-
Where is the PMC to be found and any docs on it?
Thanks
Keith
-
You need Mach4 version 4 ******************.3112. Under configure select PMC. Docs are in the mach4 doc folder, PMC.
Mike
-
Thanks Mike!!
-
No problem.
I am just spreading the PMC love!!!!
-
I want to fall in love too! But when to use this is in Mach4.
Is it just to deal with inputs and outputs monitoring activities or could it be used to write a probe routine for instance?
Thanks,
Keith
-
While the PMC is very powerful I am not sure if you can do that with it.
Mike
-
Steve,
It looks like PMC is still not doing calculations with decimals:
Arturo Duncan
http://cnc4pc.com
-
Arturo,
I need an example. Because what I just tested works. Can you post the PMC file?
Steve
-
Steve,
Here it is.
I had to add the .txt so it would allow to upload it.
Arturo Duncan
http://cnc4pc.com
-
Ok Arturo, I think I have it. Thanks for the example because the math portion was working correctly. The error was with reading and writing registers. The fix will be in the next build.
Steve
-
How do I get selected tool and current tool into PMC. Also how do I start a PMC file from M6?
-
You don't start a PMC file from any macro script. The PMC is running all of the time (it is a software PLC). Regulars ways of interfacing to a hardware PLC from a macro script can be used. Typically by using Mach registers to communicate. For your tool change stuff, you could load the selected tool into a register that the PMC is watching, etc...
Steve
-
Ok so how do you do that?
-
I can't possibly explain all of that in a forum post. My advice is to search this forum for PMC examples. Then familiarize yourself with the LUA scripting API to figure out how to get the selected tool, etc.. Look at some of the M6 example scripts. They might help. You may not even need the PMC, depending on what you want to do.
Steve
-
Ive been doing that for days now Im lost. I dont understand lua at all thats why Im trying to use PMC. Ive gotten a few things figured out but dont know where to start with getting the current and selected tools. Thank you though. Im trying to setup my lathe tool changer. It's a turret style 8 position that uses a combination of 5 limit switches to determine position of the turret. As to say when both limit switches 1 and 2 are tripped its in position 1 and when LS 1 and 4 are tripped its in position4. I also need to output FWD and REv to a vfd to run the motor on the turret while activating a relay to operate a hydraulic solenoid to unlock the turret and monitor its own limit switch.