AXIS for use with Serial Controller Ports

More
01 Dec 2014 18:16 #53573 by royleith
I have just installed LinuxCNC for a friend with a normal parallel port controller although he has yet to come back to me with the machine details necessary for the setup.

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.

More
01 Dec 2014 19:26 - 01 Dec 2014 19:26 #53575 by ArcEye
Hi

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
Last edit: 01 Dec 2014 19:26 by ArcEye.

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

More
02 Dec 2014 01:04 - 02 Dec 2014 01:20 #53584 by royleith
Thanks for that. I should have researched the g-code standard. If I could expand a little, my mill references the axis with a choice of ASCII character commands; RFZXY, RF X, RF Y and RF Z sent over the serial port. The controller returns a ':' when the reference run is finished.

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.
Last edit: 02 Dec 2014 01:20 by royleith. Reason: brain dead phrasing

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

More
02 Dec 2014 01:46 #53585 by ArcEye
Hi

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.

More
02 Dec 2014 15:23 #53592 by royleith
Thanks for that. I had assumed that more of the logic was in AXIS. I will investigate the idea of a parallel controller; I seem to remember mention of an open and free version. I bought a PCI-x parallel interface card that might do the job in my computer. That replaced the old computer that died, but did have a parallel port on the motherboard.

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.

More
03 Dec 2014 06:00 #53619 by andypugh

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.

Time to create page: 0.104 seconds
Powered by Kunena Forum