Activating air blow valve M6

More
15 Oct 2017 08:38 #100371 by lesureia
How can this be done when calling M6 for toolchange activating relay for air blow valve 5-10 seconds.


Is it possible?

Thank you for your help!

Rickard

Please Log in or Create an account to join the conversation.

More
19 Oct 2017 14:10 #100552 by andypugh
Yes. You would re-map M6 to be a G-code subroutine that sets one of the G-code digital outputs for the required time, and then performs the M6.
linuxcnc.org/docs/2.7/html/remap/remap.h...s_including_tt_m6_tt
You might want to read the whole page to learn what is possible, but you only actually need section 5.6 for a G-code only remap.

Please Log in or Create an account to join the conversation.

More
19 Oct 2017 14:11 #100553 by andypugh
Or, thinking about it....

You could just use a one-shot HAL component triggered by iocontrol.0.tool-change-request.

linuxcnc.org/docs/2.7/html/man/man9/oneshot.9.html
The following user(s) said Thank You: lesureia

Please Log in or Create an account to join the conversation.

More
19 Oct 2017 14:54 #100556 by lesureia
Thank you for your reply

I have implemented manual-toolchange-with-tool-length-switch and was wondering if it was possible.

Now i have a bit of reading and learning.

Will read up on this and try try try

Please Log in or Create an account to join the conversation.

More
23 Oct 2017 09:44 #100658 by lesureia
Hi all
I have been trying with this loadrt oneshot have been partially successful
When M6T1 is activated i can get the counter to start from 8 to 0 (8 seconds)

But more trouble some to getting the relay to activate
These lines are in my HAL file

loadrt oneshot names=airblow1
addf airblow1 servo-thread
net tool-changed => airblow1.in
#net tool-change => airblow1.in
setp airblow1.rising 1
setp airblow1.width 8

# ---- AIRBLOW
net airblow1 hm2_5i25.0.7i76.0.0.output-01

#---AIRBLOW

net airblow1 <= I dont know exactly what to put here everything i put here related to tool change is already linked to signal airblow1

Can anyone see if there is anything wrong with my lines in oneshot or im way out?

/Rickard

Please Log in or Create an account to join the conversation.

More
23 Oct 2017 10:12 #100661 by andypugh
You have not connected anything to the oneshot output.
net airblow1 airblow1.out
would work, but using "airblow1" for both the signal name and the component name, whilst legal, is likely to be confusing.

Perhap
loadrt oneshot names=airblow1
addf airblow1 servo-thread
net tool-changed => airblow1.inloadrt oneshot names=airblow1
addf airblow1 servo-thread
net tool-change => airblow1.in
setp airblow1.rising 1
setp airblow1.width 8

# ---- AIRBLOW
net purge-air airblow1.out => hm2_5i25.0.7i76.0.0.output-01

You link pins together with "signals". A signal is the first word after the "net" command and you can choose these freely, there are no pre-defined signal names.
Pins and parameters, on the other hand, have to actually exist at the time they are connected, and are created by HAL components.

Please Log in or Create an account to join the conversation.

More
23 Oct 2017 10:26 - 23 Oct 2017 10:42 #100662 by lesureia
This is my first try of oneshot trying to read what i can

And yes mixing pins with signals cant be good im a beginner

If naming a oneshot rule should i avoid names and calling it oneshot.1 instead of airblow1 ?

Will read some more.

loadrt oneshot names=airblow1
addf airblow1 servo-thread
net tool-changed => airblow1.in
#net tool-change => airblow1.in
setp airblow1.rising 1
setp airblow1.width 8

#---AIRBLOW

net purge-air airblow1.out => hm2_5i25.0.7i76.0.0.output-01
now i can hear the relay switching on and off
Worked really good


/Rickard
Last edit: 23 Oct 2017 10:42 by lesureia. Reason: Adding solution

Please Log in or Create an account to join the conversation.

More
23 Oct 2017 11:10 #100666 by andypugh
I do actually think that doing this with an M65 in the G-code would be easier.
The following user(s) said Thank You: Clive S, lesureia

Please Log in or Create an account to join the conversation.

More
23 Oct 2017 11:18 #100667 by lesureia
Thats a lot more of reading.

I was thinking of a plan B a sensor sensing the tool when its in its range relay triggers and activates air valve.

But its more elegant to have everything in the HAL file and with no extra sensors.

If i go with M65 should that be more precise than previous solution ?

Time i have plenty of.

/Rickard

Please Log in or Create an account to join the conversation.

More
23 Oct 2017 12:37 #100670 by andypugh

If i go with M65 should that be more precise than previous solution ?


What do you mean by "precise"?

The oneshot will give a very exact length of activation. But it might not be exactly _when_ you want it in the tool-change sequence.

You have to trigger a oneshot from a HAL pin, and the tool-change HAL pins might not change at the right point.

You could even do both, use a G-code digital output inside your tool-change sub to trigger the oneshot. This means that you don't need a pause (G4) in your tool change subroutine, and that's probably a good thing.

Please Log in or Create an account to join the conversation.

Time to create page: 0.151 seconds
Powered by Kunena Forum