Date: 02.13.16 - 12:39am
So the project I am working on is a mix between a traditional CNC machine and an Arduino project. The short story is I want to record and train paths with rotary encoders and then replay the paths with steppers. You can read more in a seperate blog post here.
Especially for testing and calibration of the two systems I want a quick and easy way to move the steppers while taking readings from the arduino using X/Y coordinate conversions. I know I can control the steppers from Arduino, but I didnt have 2 stepper boards on hand, nor did I want to work out all the GCode details and positioning stuff. I figured I would look for a cheap shot solution.
To replay the full tool paths, I will generate a gcode file from the encoder positions and then run it in Mach3. I already have a license for it, and already had a $50 3 axis sain smart driver board for it, power supply, and old laptop with a parallel port.
I went to setup mach and got looking around the site, it turns out Mach supports a plugin model. I never knew this! You can write traditional plugins that it loads in process using C++ which could be a bit hairy, but it turns out Mach is also an ActiveX exe server and can be automated from external applications very easily !
You can find the VB6 Mach3 Automation Sample here.
This is perfect for this project, especially since I still use VB6 which is a master of simple COM integration. Controlling the steppers to goto a specific X/Y position will literally be a single line of code for me now without having to worry about any of the details.
mach.RunGCode("G0 X2 Y3.5")
Its also worth mentioning that Mach exposed its entire internal macro scripting language interface in this manner. Its very robust and you have access to basically everything. Its pretty awesome and will make for some interesting projects I am sure.
So here is some thoughts for a hybrid test machine: