Question: What is HAL2Arduino?
Answer: HAL2Arduino is by itself (no mods) is just a communication framework that allows an Arduino to communicate to LinuxCNC, this allows users that are familiar with an Arduino micro-controller to make a DIY CNC machine without having to write a custom gCode interpreter. After all, some really bright people over at linuxcnc.org have already done that. It’s a great piece of open-source software for running CNC machines big and small. It has a unique breadboard-like way of connecting to the real world and that’s where HAL2Arduino comes in. HAL2Arduino just exposes this breadboard-like interface to the Arduino platform so users may harness it without have to do any extra background coding.
Question: How does the HAL2Arduino tool-chain work actually?
Answer: On the PC side it contains a Python script that LinuxCNC runs upon start up, this script finds any arduino that is attached via serial USB cable, handshakes with the arduino firmware, queries it for info and the generates the requested HAL pins that LinuxCNC might be configured to use prior to actually starting up the LinuxCNC GUI itself. If the associated HAL interface pin is already defined in the custom.hal file LinuxCNC will put it to use.
Question: Can I make “Das Uber” CNC machining center work using HAL2Arduino to handle the whole thing over USB?
Answer: Yes, but please don’t. Instead, use the parallel port for moving the machine’s axes and reading the encoders. Why? Be cause its easier to configure that part traditionally AND it will perform faster too. If you have that class of machine chances are the general motion controls are intact and very well documented. HAL2Arduino should be sufficient to handle everything else like switches, DRO’s, jog wheels, joysticks, pumps, lights, tool-changers, indexers, control panels, touch probes, part shuttles, or even that 3-phase line conveyer.
Question: Can I use LinuxCNC/HAL2Arduino to make an automated production line?
Answer: In theory yes. LinuxCNC I think can be made signal other CNC machine controllers, if not HAL2Arduino easily can.
Question: Can HAL2Arduino be used over Ethernet? Does it support SD cards?
Answer: I don’t see why not, though no mod has been made for it yet.
Question: My computer does not have a parallel port, should I go out and get an Arduino to make my CNC machine work?
Answer: You are better off to go out and get a 9 dollar parallel port card. It will perform better than a 30+ dollar Arduino. Plus, the parallel card is likely to be directly supported by LinuxCNC without any need for this HAL2Arduino monkey business.
Question: I have a CNC machine that I would like to add something to. Can HAL2Arduino do that?
Question: I read that HAL2Arduino supports more than one Arduino simultaneously. How is that possible?
Answer: It does this on the computer-side via Python by running separate threads, one per connection.
Question: I downloaded this stuff now what?
Answer: Read the README.txt follow the directions to get it installed. Afterwards, there should only be two files you should have a need to play with.
- The custom.hal where LinuxCNC will look for the pins you will need to define. Don’t worry there is an example file included to give you some clues. (In the future this might get automated too.)
- The Arduino sketch where you will need to do some actual coding. But don’t worry, I’m building up a list of modules to make this an easy (nearly) cut and paste experience.
Question: Will there ever be a non-LinuxCNC version of HAL2Arduino?
Answer: I’m only (somewhat) familiar with LinuxCNC’s HAL interface. Its also the only CNC host software I have. If someone else has Mach3 or some other CNC software that they added HAL2Arduino to, and would like to share how they did it I would be happy to link to their site or even setup a page with their instructions, walkthrough or howto on it.
Question: I made a module (or ‘mod’) that I think might help others. Or a better version of one. Would you like a copy?
Answer: Yes I would, just bare in mind. This is a survival of the fittest type of thing. If I list a module and you send me a better one, or link to a better one. I’ll relegate the old one to the archives and give yours the spotlight, with credit of course. That goes for new mods too. If you think someone could put it to use, even if its your very first bit of code and your worried that its not very good or its just plain ugly. Send it to me. Someone might actually need it. If your shy just credit to it ‘Anonymous’, that person is legendary. 😉
Question: Ccan I use LinuxCNC in a Virtual Machine (VM) such as VirtualBox?
Answer: Yes. Normally you would not be able to, this has to do with LinuxCNC thinking that it absolutely requires at least one parallel port. Not true.
You can omit using parallel ports all together by commenting out all the lines in my-mill.hal that contain the word parport in them. When LinuxCNC starts up it literally has to be instructed to look for a parallel port, if the config file never tells it to look for one, it won’t. Then we can supplant the whole mechanism with HAL2Arduino or even good old EMC2Arduino.
Question: How can I use LinuxCNC in a VM with a parallel port and HAL2Arduino?
Answer: Not currently possible, at least not without a VM that supports emulating an old-school parallel port. I know as of the time I wrote this FAQ that VirtualBox does not support parallel port emulation.