Program linuxcnc?

More
26 Sep 2019 18:23 #146294 by MaHa
Replied by MaHa on topic Program linuxcnc?
The question is, are you using the mill and foamcutter? If just the foamcutter is used, it would be easy, as the gcode
for control is there already.
M3/M5 could be used for the hotwire on/off even with timedelay for warmup
M7/M8 turn on Laser, M9 turn off both
I think in terminal halcmd show pin > pinlist.txt give a list of available pins. Just find the ones needed
and copy paste to avoid typos.
In this case would be spindle as mentioned before, and coolant, example:

net coolant-mist <= iocontrol.0.coolant-mist => hm2_7i76e.0.7i76.0.0.output-15
net coolant-flood <= iocontrol.0.coolant-flood => hm2_7i76e.0.7i76.0.0.output-07

about the relay, from a certain dimension a freewhelin diode is needed. 1n4xxx

Actually reading your post again, about the requirement. If you want to control that with keyboard key,
shure pl7i92 has the answer how to map keys and do halui call.

Eventually have 3 switches installed near your keyboard, then you can turn on off anytime as desired. From
keyboard it might be locked while active running file.

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

More
26 Sep 2019 20:16 #146298 by tjd
Replied by tjd on topic Program linuxcnc?
I'm intending to have foam cutter and mill spindle running independently so using spindle pin for control is not really an option. Will take a look at available pins as suggested.

At the moment, from 'Axis' i can press F9 and turn on/off the spindle and press F7 to start/stop mist coolant. I'm ideally looking for similar control over lasers and foam cutter. For example, press 'x' for one laser, 'y' for the other and possibly 'f' for the foam cutter.
These controls potentially being locked out while running a program is not an issue.

With regard to having 3 buttons next to the keyboard, that's kinda what I've already got, as mentioned previously they are powered separately from the milling machine so am looking to move control directly to the keyboard itself.

Many thanks for all the help thus far...
The following user(s) said Thank You: MaHa

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

More
27 Sep 2019 07:35 #146348 by MaHa
Replied by MaHa on topic Program linuxcnc?
Another option, just change the hm2 part according your config.

Use M64 P00 to turn on, to turn off M65 P00
net laser1 <= motion.digtal-out-00 => hm2_7i76e.0.7i76.0.0.output-07

Use M64 P01 to turn on, to turn off M65 P01
net laser2 <= motion.digtal-out-01 => hm2_7i76e.0.7i76.0.0.output-08

Use M64 P02 to turn on, to turn off M65 P02
net hotwire <= motion.digtal-out-02 => hm2_7i76e.0.7i76.0.0.output-09


In the .ini file,
[HALUI]
MDI_COMMAND = M64 P00 ;command 0
MDI_COMMAND = M65 P00 ;command 1
.....
How to assign a keyboard key to this commands, please ask someone else, as i dont know.

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

More
27 Sep 2019 07:50 #146350 by tjd
Replied by tjd on topic Program linuxcnc?
Ok, thanks for the info.

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

More
27 Sep 2019 16:24 #146410 by tjd
Replied by tjd on topic Program linuxcnc?
Having just read this

am I right in thinking I can have the controls for said lasers and Hot Wire Cutter on a virtual control panel, assuming I can't as yet work out how to do it from the keyboard??

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

More
27 Sep 2019 17:48 #146420 by JohnnyCNC
Replied by JohnnyCNC on topic Program linuxcnc?
Yes, I added buttons on the screen to control my coolant (Air blast) and a button to cause the machine move all axis to what I consider the "parked" position before I shut it down.

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

More
28 Sep 2019 07:35 - 28 Sep 2019 07:52 #146464 by MaHa
Replied by MaHa on topic Program linuxcnc?
Just found a easy way to do your keyboard stuff. It worked on my sim, debian stretch testing.
On the desktop goto properties, keyboard. There i was able to enter commands, with keyboard shortcuts.
After starting Axis, this were executed by shortcut. Have a look in axis, help, keyboard, because there are so many keyboard shortcuts already, avoid a colision. So just enter the mdi command call ,example in screenshot. 1 at the end sets true, if 0 is there, nothing happen.
All you need to do, are the .ini file entrys in Halui section, as shown in previous post (M64,M65) and connect your relay to the switched pins.
And also edit the .hal file, net motion.digital-out as example.
enjoy
Attachments:
Last edit: 28 Sep 2019 07:52 by MaHa. Reason: incomplete

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

More
01 Oct 2019 00:29 #146775 by MaHa
Replied by MaHa on topic Program linuxcnc?
Even it seems the interrest in this problem is fading, i could not leave a half finished solution behind, which confuses more than help.
Ok, here is the final, pretty easy to do. I choose User defined M funktion to simulate momentary switch. So with the before shown way, assigning keyboard keys to M function, halcmd or whatever Laser1 Laser2 and Hotwire can be turned on off by the same Key combination, because toogle used. Even it's a bit ugly, the same M function can be used from MDI or Gcode.
The M function must be made executable. And .txt must be removed.
The toggle part is in custom.hal, you need to do the entry in .ini, as

[HAL]
HALFILE = custom.hal

In the your-machine.hal file toogle needs 3 entrys. In my case i had count=2, so changed to count=5. And each needs addf.
And in custom.hal the hm2 part enter your output to switch. If your relay has more than 60ma, maybe a flyback diode required.

loadrt toggle count=5
addf toggle.0 servo-thread
addf toggle.1 servo-thread
addf toggle.2 servo-thread
addf toggle.3 servo-thread
addf toggle.4 servo-thread
The following user(s) said Thank You: tommylight

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

More
01 Oct 2019 08:50 #146790 by tjd
Replied by tjd on topic Program linuxcnc?
Brilliant - thanks for all the help. Very much appreciated.

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

Time to create page: 0.109 seconds
Powered by Kunena Forum