Hello Guest it is March 19, 2024, 12:28:25 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 »
141
Hi,

Quote
I just need some code that does "XYismoving....turn on output"....somehow. It could be done with Mach3, so as you said, so can Mach4......I just don't know how yet :)

I've already given you three ideas, two purely software, one taking advantage of a realtime support provide by the controller
manufacturer requiring a few parts.

Clearly your vision execeeds my own...good luck.

Craig

I have not pursued the software ideas yet. I am working on several things at once and have limited time. I need to get focused on one issue at a time....which is why I made this post to knock out an easier one before going back to the oiler when X or Y is on.
 I have read what that PWM signal is intended for and it is not really for this purpose as you already know. Using that PWM in this way is not really the intention, but it could be set to work possibly. I am not sure it will work when jogging though and not running code or not. It is for a laser as you say. I just feel like my time would be better spent pursuing the software ideas before rewiring my machine and adding more parts and pursuing the setup of the PWM output to give me what I want etc.
 It would be a work around rather than the intention. I will be looking into this more over the weekend, but I am going to have to get some sleep to think better. I have been operating on about 3 .5 hours a night sleep all week. Tired...


142
Hi,

Quote
It just seems like a lot of extra hardware for something code "should" be able to do

Rubbish.......$3.00 worth of components, not counting the SSR, which you will require with either solution, hardly constitutes
a lot of extra hardware.

Yes code can do it.......its just that while you are learning I know you are heading into deep water, by all means try it out
and you too will learn what dodgy code in the PLC script can do to your day!

Craig

I am not sure if I mentioned this, but this machine has been done and running on Mach3 for about 8 years now even though I have hardly used it. So, I should not have to buy anything (other than the obsolete pokeys stuff). I already have my IO6 board driving a regular relay that is controlling the oiler. I just need some code that does "XYismoving....turn on output"....somehow. It could be done with Mach3, so as you said, so can Mach4......I just don't know how yet :)

 I am not sure how I am going to get everything else done without learning much more, reading more, asking more questions etc. Adding parts when there is a better way just goes against everything to me. It is a hill to climb I am sure. This already has been.

143
Hi,

Quote
Hmm, now that is sounding like more work than using code LOL

Two resistors, a capacitor and an op-amp and maybe a relay or SSR to amplify the signal to turn on the pump.
Really, is that more work than learning to code Lua?. Particularly as the code you'll have to write will probably be
(mainly) in the PLC script where all and any code needs to be fast, sleek, efficient and robust. A failing piece of code
in the PLC script can hang or crash Mach and it can be the devils own job to unwind it.

Craig
It just seems like a lot of extra hardware for something code "should" be able to do. If I had to choose learning software vs adding unnecessary hardware....I guess I would have to choose code for the long run.....I have not even gotten to the tool changer part of this yet or switching out the pokeys 55 to the 57E:( My parts did come today though.

144
Hi,
I suspect that this output ESS, Feed Rate PWM, is actually meant to be used to control a lasers output.

You could have a  PWM-to-analogue filter followed by a comparator or Schimtt trigger to turn your oiler pump on once the XY federate
exceeds a few inches per minute....easy.

Craig

Hmm, now that is sounding like more work than using code LOL. I already have it all wired up and working with a button and M Code. I just haven't looked into the enable when moving yet.


145
Hi,
just as a side note look at the output several entries below where the Coolant outputs are:
ESS,XY Feed Rate PWM.  Could you use that for the way oiler you were talking about in another thread?

Craig

Hmm, this is a possibility, but would I also be able to operate it from my on/off button on the screen set and the M200/M201 I created? I Will definitely look at this idea. Thanks for bringing that to my attention.

Maybe I don't even need to have a button or M-Code....I just thought it would be nice to be able to manual activate it and also call it with an M-code if needed. However this may not really be necessary in real life...not sure. I do think they may be some instance or time where you could want to turn it off so it is not running during any XY move possibly.

I have to look at what that can do since it is labeled as a PWM also.

146
Oh man. Thanks so much. I am glad I asked! That just saved me some time of researching down the wrong path.

Who knows how much longer I would have overlooked going back to that "root" location. I did have it it setup in there so never thought about picking the wrong thing. I assigned it to "output#3" instead of the "Cool, Mist......"
I was looking for a place to tell it that the Mist button should be using output 3 in the screen edit...which I had no luck finding which is obvious now.

No telling how long I would have spent figuring this out or inventing a bunch of unnecessary code to make it work LOL.  I was thinking the whole time that surely this should be simple because it is already embedded in what you get....


147
Do I need to modify the start screen code and the sig library and create M code scripts to just make a button that already exists and has predefined M Code action work?

For example I just want to make the Mist button work and give it an output to turn on. Where do I do this? Is there a tutorial for this exact thing where you just want to make an existing button and Mcode work?

 I can make a new button that does this and I could make a new M code script that does this, but I would think they intend for you to use the built in action for this? mc.OSIG_MISTON? I will keep reading and reading and reading to figure it out, but hopefully someone can just give a quick link with a good simple to understand way of how it should be done for best performance.

Thanks. I looked for a couple hours so far and have not figured it out yet. Too tired from a long day I guess. I am reading through a bunch of information, but there is just so much to look at and no straight to the point of the best way and the exact code and where to put it etc. The only variable from what pretty much everyone is doing for this simple task is which output they are using. In my mnd this simple thing should not require a programmer to get working...

148
Great info. Thanks. I will be spending more time soaking this up. I think I understood half of what I just read....if I read it 3 days ago it would have been total greek and 0 comprehension...so we are making progress.

The last 12 hours has just been me trying to learn a little here and there while at work. Now I get to commute for an hour and go back to hands on for a couple hours.....if I can stay awake.

149
The wire scheme is pretty basic stuff...output 5 turns on a relay (R4 of BOB) that sends power to the oiler. The oiler has the AC main power fed from the contactor that is only turned on if the enable relay is on. That is pretty much it. It will shut down if the main contractor goes off (E-stop hit or enable relay goes off, etc). It is wired correctly. It even has a proper DIN rail mounted fuse and all!
 
However, I think the indicator in Mach will still show it on anyway (even though it is off in reality). I am only able to play with this today with the simulator and the ESS not on (not at the real machine). I don't think it will kill the indicator LED or the output LED on the screen though? I will try it tonight when I load what I was working on today in there to test.

It is not that important, just how I would like for it to work I think. It would be nice to have the indicator on the mach4 screen go out when it is actually off due to the enable relay being off. I will have to load what I worked on tonight to see how my progress works so far. 


150
I am many days of time into this changeover now with a lot of reading, watching videos (and falling asleep during them LOL), and hands on trial and error.

I already have my machine running now......except the stuff that does require learning Lua, updating some parts, and the Mach4 programming structure (Aux functions, toolchanger, etc). I do have the manual button, indicator, and M codes setup for the oiler and working (except turning off when disabled). I figured I would do those before tackling the automatic oiler stuff.

I have already learned a lot, but still have a long way to go. The one thing I am dreading is the tool change most. My old VB script is so easy to understand and follow. I had not looked at it in years, but opened it today, and it makes perfect sense and is darn near plain English the whole way through compared to Lua.

What I meant by the search not working, is that if you go into the API help file, search for some text so you can look up what something is.....it returns nothing sometimes. If you manually dig and search for it, it is in there. This is not really a "being lazy" thing. You would just expect the search tool to find you what you need so you can spend the time reading about it without scrolling through everything trying to find if it is there. This is the great thing about it not being a paperback book vs an electronic text file! :) The important part is alphabetical at least, that helps some.

Thanks for the Lua manual link. I found a PDF version that will be easier to search if anyone reads this and wants it that way....
https://jackens.github.io/downloads/Lua-5-3-Reference-Manual.pdf

I will check out your SignalScript.pdf. Thanks for the link.

I will likely discover this as I read and research more, but I am going to ask anyway...

What is the mc. for? Is this a way of calling out the custom API commands that are only for Mach? Is "mc" an abreviation for something unique to mach4?

Also in the Lua Manual. Many things starts with "LUA_" but I do not see that in any coding for Mach so far? Is that just dropped from the commands or a placeholder for something else? 



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 »