HAL2Arduino 0.4 – preRelease

Well, after looking around for a good non-blocking multi-instance stepper library that has hooks I can exploit with input speeds from LinuxCNC (a very tall order) I found one that could do it. AccelStepper, so I put my coding hat on, brewed some coffee and banged out rough implementation of HAL2Arduino 0.4 (the preRelease version).

For those of you that have been waiting ever so patiently for the next generation of EMC2Arduino, here is the first version of HAL2Arduino that is actually useful to the average end-user.

This version has a couple of bug fixes:

  • Bi-directional communications fix. (Coding typo)
  • Init spam bug fixed.

Added features:

  • Support for plugin based mod files, for drag-n-drop/compile add on features.
  • Pre-compiler optimized code (modFiles too!) to keep the memory footprint lower, saving more room for your code. Unused code won’t be added to your final build.
  • Added “Green Light” signal so Arduino clients can synchronize with each other.

Added modFiles:

  • modAccelStepper: 0~9 axises of speed sensing motion control, default config is for 3-axis machine suitable for routers, plasma tables, basic mills, etc.
  • modLimSwitch: support for min/max/home switches, both physical and/or virtual (based on stepper positions).
  • modLcd: Updated to run on HAL2Arduino-0.4 (Still just a basic example of a DRO.)

In the pipeline:

modButtons: A control panel collection for the basics like E-Stop, start, stop, pause, step, etc.

Config LinuxCNC from Arduino. ie: Edit/upload HAL2Arduino to your arduino, run the host side python script and the custom.hal files get generated for you, based on the configuration of the arduino(s).

If you like, you may grab an early copy of it here.

Future thoughts

Playing with the compiler in the Arduino IDE, I realized that I could make setting up a new machine a LOT easier.

By making plugins/mods self loading on the Arduino side and on the PC host-side of things, perhaps with some luck I can make the background python script check and possibly auto-modify the custom.hal file on start up so that it will link/unlink halPins as requested by the one or more Arduinos in use.

So I made this post as a To Do List:

  1. Make mods self-loading via #ifdef
  2. Make HAL2Arduino.py  scan the custom.hal for used/unused pins and add/remove them. (Under its own section).
  3. Make a first-run virgin setup routine for the HAL2Arduino.py script. (Or just a simple install/uninstall script.)
  4. Speed tweaks. (Currently HAL2Arduino has an un-acceptibly high ~75ms latency.)

Like I said, this is a To Do List and right now I’m in college, so while this is planned; I’ll have to work on it when I can.

If anybody has feature requests, now would be a good time to suggest them.

HAL2Arduino 0.3 released.

Ok, per popular request I have uploaded the initial framework release of HAL2Arduino. I have a busy semester and my time is tight right now. It’s not going to run anything out of the box except until you mod it.

There is no readme file no doc’s just raw code. Play with it at your own risk!

You can read more about it here and download it here.

Finally, just to be clear… This code won’t run a CNC machine as is. It’s just a wiring breakout interface to expose LinuxCNC’s HAL interface pins to an Arduino. So one may easily add there own Arduino code to make or add on to an existing CNC machine.

Teachers, this would be a challenging project for students as the actual “make it move code” will need to be entered by the students.

Hack it, Branch it, Share it.

Taking a concensus:

With so many dimensions of expansion available, which way should we go next. Have a request? Vote!

Emc2Arduino 0.07b has been released.

I’m slowly working on adding new features as often as I can.

So far it features: (as of 0.06b)

  • 0~9 Axises of synchronous motion using non-blocking stepper motor control.
  • Full support for both virtual and physical limit switches. (Use ‘em if you got ‘em.)
  • Inputs for E-Stop, Power, Start, Stop, Pause, Resume and Program Step switches.
  • Software controllable microStepping down to 1/16th step.
  • Simple ASCII serial based control makes it usable for general robotics enthusiasts.

Features added just recently in 0.07b:

Outputs for:

  • Spindle controls; on/off, direction, RPM control.
  • Coolant control. Both flood and mist are supported.
  • Power Supply control.
  • Status indicators for E-Stop and Power. (More coming soon.)

In the pipeline:

  • LCD Support.
  • Encoder Support.
  • Jog Wheel & Joystick Support.
  • Arduino CNC swarm tactics. (Think LEGO-style CNC/Robotics!) Implemented in HAL2Arduino
  • Micro-builds. (Swarm) Implemented in HAL2Arduino

That’s all for the moment.

Emc2Arduino, How it begins…

After looking at RepRap, MakerBot, grbl and others. I found that while they were very cool projects by really clever people, they didn’t seem to have the features I was looking for in my CNC build.

I wanted to be able to use a real, full featured, CNC control software interface like the one LinuxCNC provides.

Since its open-source its totally free, and since its been around for a while its a very mature piece of software. Its even openGL accelerated.

Why not use it. The heavy coding is already done.

Its free. There’s tons of user support as well as guides out there on how to setup pretty much any CNC combo one can think of.

Perfect, now where do I begin? I thought, well I have an Arduino (or two) laying around here. A couple of tutorials to learn from.  Lets put something together. Thus Emc2Arduino was born.

A tribute to those before me…

One thing I’ve always admired is the creative ingenuity of people. Doubly so for those that go through the effort to post it for others to learn about their exploits as well. So in respect to all those before me that were gracious enough to share their knowledge with others. I will share with you, mine as well.

Things that got me started:

Dan Royer from marginallyclever.com has a really good sketch for Controlling your Arduino through the Serial Monitor.

Jeff Epler’s Etch-a-Sketch CNC his work inspired Colin Kingsbury.

Colin took Mr.Epler’s work, posted a Basic Arduino-EMC HOWTO simplified enough for a mere mortal like me to sorta understand it and begin poking at it with the proverbial stick.

Once I got enough confidence to put the pieces together Emc2Arduino was born. A few weeks later EMC changed its name to LinuxCNC but by that point I was already getting a few hits on the blog and github as people were beginning to use it. So I guess the name stuck ever since.

Follow

Get every new post delivered to your Inbox.