Hello Guest it is February 17, 2020, 07:51:57 PM

Author Topic: How to make the Mist Coolant button & M07 M09 actually turn on an output?  (Read 289 times)

0 Members and 1 Guest are viewing this topic.

Offline jevs

*
  •  312 312
    • View Profile
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
My wife left with my best friend...
     and I miss him!
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
My wife left with my best friend...
     and I miss him!

Offline jevs

*
  •  312 312
    • View Profile
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
« Last Edit: August 02, 2019, 10:28:04 PM by joeaverage »
My wife left with my best friend...
     and I miss him!

Offline jevs

*
  •  312 312
    • View Profile
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.

Offline jevs

*
  •  312 312
    • View Profile
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,

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
My wife left with my best friend...
     and I miss him!

Offline jevs

*
  •  312 312
    • View Profile
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.
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
My wife left with my best friend...
     and I miss him!