output with interval on/off timerelay flip flop

More
5 years 9 months ago #195529 by BoBe28
hello,
I´m new to linuxcnc.
I recently changed my system from mach3 to linux due to signal (USB) issues.
It took quite a while to set everything up, but now it runs fine. (MESA 7i76e)
I'm runnig a diy mill and only machinig wood.

Maybe someone could help me with my current project.

I connected my coolant signal "net coolant-mist" (M7) with a magnetic valve to blast air on to my tool.
Now I would like to open (1sec) and close (5sec) the valve in this example.
So if I run "M7" in my programm the air blast should go on and off giving my small air-compressor time to refill.
Would the flip flop function be the right thing to achieve my goal?

Thanks,

Bob

Please Log in to join the conversation.

More
5 years 9 months ago #195587 by chris@cnc
Hi Bob,
I wrote short modul for this.
Its pretty easy to use.
Timer Could adjust by setp timeron and off
If you have compile , install and load Take a Look in halshow.
You will found new Modul with pin In, pin out And timer
Code:
description """ //Compile : //halcompile --compile mist.comp //sudo halcompile --install mist.comp //Halfile load : //loadrt mist //addf mist.0 servo-thread //setp mist.0.TimerOn 30 //setp mist.0.TimerOff 300 /* 4 way input Modul with Timercontrol output Input 0 = output 1 Input 1 && Input 2 = output 1 Input 2 && Input 3 = Timer On output 1 && Timer Off output 0 */ """;

forum.linuxcnc.org/10-advanced-configura...w-hal-modul?start=10

Hope it helps Christian

Please Log in to join the conversation.

More
5 years 9 months ago #195649 by BoBe28
hello Christian,
thank you for your quick response.
Because I'm new to linux and am not a programmer, I don't understand were to put in the code. Does it all go in den *.hal file or do I create a new *.comp file?
I couldn't install the mist.comp file.

thanks,
Bob

Please Log in to join the conversation.

More
5 years 9 months ago #195658 by chris@cnc
Hi Bob,
file mist.comp is the code file. In file header you can see how to compile and install it. If you want to use finish work rename the file mist.so.comp in mist.so and install to folder /usr/lib/linuxcnc/modules/.
Now you can use this module in hal file. Howto use in hal is also decriped in header. Basicaly you have 4 input and one output. short writen
if mist.0.in0 -> mist.0.on
else if mist.0.in1 && mist.0.in2 -> mist.0.on
else if mist.0.in2 && mist.0.in3 -> mist.0.on for mist.0.TimerOn and off for mist.0.TimerOff

my hal example:
Code:
loadrt mist # load module setp mist.0.TimerOn 5 # Set Timer on setp mist.0.TimerOff 10 # Set Timer off net sauger-button-m mist.0.in0 pyvcp.status-sauger-m pyvcp.sauger-an-m # If button "M" true mist is on net sauger-button-a mist.0.in1 pyvcp.status-sauger-a pyvcp.sauger-an-a net programm-run mist.0.in2 halui.program.is-running # If button "A" true and program run mist is on net sauger-button-i mist.0.in3 pyvcp.status-sauger-i pyvcp.sauger-an-i # If button "I" true and program run mist intervall net absaugung mist.0.on hm2_7i76e.0.7i76.0.0.output-01

Attachment not found

Please Log in to join the conversation.

More
5 years 9 months ago #195814 by BoBe28
hello Christian,
thanks again. I copied your file in the diretory and found the function in the hal configuration.
Next I will try to figure out, how to connect it to the mist-coolant.
I I'll give it another try on the weekend.
bob

Update,

So I gave it another try this sunday, figuring out how to make the connections work.
Still trying to understand this HAL file. :)

# ---Interval---

net mist.is-on mist.0.in2 halui.mist.is-on
net mist.is-on mist.0.in3 halui.mist.is-on
net collant-mist mist.0.on hm2_7i76e.0.7i76.0.0.output-00

Works really good.

Thanks,

Bob

Please Log in to join the conversation.

Time to create page: 0.899 seconds
Powered by Kunena Forum