AXIS for use with Serial Controller Ports
I have a CNC mill (Colinbus) with a serial port controller that interprets ASCII instructions to drive the stepper motors. The driver software is OK, but LinuxCNC is much more versatile.
I've looked at the HAL manual and I see that it is all about pins and signals for the direct control of the stepper motors. If I could get access to the G-code stream coming out of AXIS I could map it to the commands for my serial controller. This would also be useful for the Arduino project that takes g-code via the USB port and presents the control signals on a parallel port interface. Any computer could then use LinuxCNC using the USB/Arduino solution and the modern breed of serial instruction controllers could also be served.
So, is there a way of intercepting the G-code stream from AXIS using a Python program? It would not be difficult to route the code from the Python program and return the responses to and from the Arduino (with some additional return pins) or to change the code for non G-code speaking serial controllers.
Please Log in or Create an account to join the conversation.
Basic answer is No
Linuxcnc is not a DNC program which outputs G Code,
it is an interpreter and machine control system which receives gcode from file and interprets into
machine movement instructions.
So it replaces the existing serial port controller.
If you want to continue using the existing controller, there are plenty of DNC programs that will output
the gcode to a remote controller.
I used to have such a controller and wrote my own DNC program to expand the file size limits and add canned routines
not programmed in the controller
regards
Please Log in or Create an account to join the conversation.
An example of the commands sent over the serial port for movement:
Drawing a square of 20x20mm at a speed of 40mm/sec, starting at the absolute location of
x=10 mm ,y = 40mm, z = 82.5 mm with a cutting depth of 1 mm and entry feed of 10mm/sec in
absolute coordinate system :
G90 G0 X10.0 Y40.0; {fast move to origin in absolute coordinates}
G0 Z82.5; {position on the material surface}
G1 Z83.0 F10; {move 1 mm down with feed of 10mm/s}
X30.0 F40; {move x-axis to 30 mm at 40mm/sec}
Y60.0; {move y-axis to 60 mm at 40mm/sec}
X10.0;
Y40.0;
G00 Z0.0; {fast move, raise z-axis}
The controller returns a ';' character to show that it has completed each line.
The manual suggests that the move commands are a sub-set of RS274/NGC, but there are other parameter set and get commands for the size of each axis from the zero reference point, the maximum spindle speeds and the maximum feed rates. This is the sort of information that AXIS obviously uses to determine when a move command is out of bounds.
The mill company provide a program that works rather like AXIS, but only displays the X and Y axis. It has icons to reference the machine just like AXIS and it provides manual movement of the spindle in all three axis. As with AXIS, it displays the feed rate to be used and it plots the progress of the milling or drilling operation on the screen. Unlike AXIS, it uses a drag and drop GUI system to position the job on the milling table. It does not, however, have the ability to execute single lines of code. The simple, if dangerous, alternative is to just stream the commands from a text file to the serial port using terminal, but there would be no way to allow for the position and height of the milled material.
If you are saying that there are programs for Linux with the power of AXIS that work over a serial port in this way, then that would be the answer for me. I suspect that is not the case, in which case, using AXIS as the starting point seems to be a possible way forward. I appreciate that it interprets the code and generates the required signals to drive the stepper motors or servos, but before the HAL stage must be a stream of g-code resulting from the operation of the AXIS controls which is interpreted and provides the basis for generating the signals. That is what I would like to use.
Please Log in or Create an account to join the conversation.
You are making a lot of assumptions and confusing Axis which is just a GUI, with the underlying libraries and executables of linuxcnc.
This is the sort of information that AXIS obviously uses to determine when a move command is out of bounds.
The interpreter determines if a move exceeds the max movement of the axis, based upon figures in the .ini file which it has read in at start up.
.........but before the HAL stage must be a stream of g-code resulting from the operation of the AXIS controls which is interpreted and provides the basis for generating the signals.
Axis passes the name of the file, the interpreter opens it, reads it and acts upon it.
You could just open the file yourself and you would have your 'stream of gcode'
G0 Z82.5; {position on the material surface}
G1 Z83.0 F10; {move 1 mm down with feed of 10mm/s}
Incidentally your code is moving 0.5 mm upwards on the Z axis not 1mm down
All plunge moves are negative, G54 Z0 should be the workpiece top datum. (under linuxcnc at least)
The optimum solution is just to junk the existing old controller and connect linuxcnc to the underlying hardware directly
That is what I did with my mill and serial connected controller previously described, I just kept the controller going for a while until I had time and could afford to be without it for a couple of weeks
regards
Please Log in or Create an account to join the conversation.
BTW, the Colinbus convention is that positive Z values are plunges and negative values are lifts. I see I will have to be careful with programs generating g-code.
The computer was bought with Windows so that I could run Picoscope software and the Colinbus sofware. Picoscope have released Linux software for their scope. I am moving towards the stage where I can be totally Linux based.
Please Log in or Create an account to join the conversation.
Thanks for that. I had assumed that more of the logic was in AXIS. I will investigate the idea of a parallel controller
Don't get too set on the parallel port, there are many other options that offer a lot more IO pins and faster response.
What sort of motors do you have on your machine? The parallel port is only really capable of driving stepper motors, but LinuxCNC can drive almost anything with the right interface cards.
Please Log in or Create an account to join the conversation.