Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: jevs on August 02, 2019, 09:59:04 PM
-
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...
-
Hi,
yes there is.
In the ESS/Config Pins tab assign a pin or pins of your ESS as output pins and then on the ESS/Outputs attach the pin
or pins to the predefined Mach outputs.
Craig
-
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
-
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....
-
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
-
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.
-
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.
-
Hi,
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
-
Hi,
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.
-
Hi,
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
-
Hi,
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.
-
Hi,
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
-
Hi,
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...
-
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...
Not sure what the problem is. The mist toggle button toggles the state of the mist output (as it should) in the default screens. Even has an LED beside it to indicate its status. Executing a M07 and M09 turns the mist on and off as well. Not sure how much simpler it could be. There is even a dedicated output labeled "Mist On" (the only way you can control any output is to know what output your controlling). You aren't trying to control your mist with a general purpose output are you?
-
This issue is already resolved. I was assigning this incorrectly in the ESS setup. I had my pin mapping set to Output Signal "output#3" instead of "Coolant, Mist (M07, M09)".
Now I am back to figuring out making the oiler run when X and Y is moving. The topic of this thread is complete and solved.
Thank you.
-
OK, yeah let's talk about that other thread in that other thread. I will clean this one up.