Abel Michael wrote: > Hello List, > > I have a question about the usage the axes A and B in EMC, can I use > them in the same way as the linear axes X and Y? > Is there another possibillity to control 4 independent axes in EMC? > > I'm asking about 4 axes because I'm thinking about to support G-Code and > EMC in my hot-wire foamcutting application FoamBlade > (http://foamblade.sourceforge.net). > > At this time the process in FoamBlade is as follows: at first a Python > program is used to create, edit and interpolate the cut-path. Then a > simple C program is used to do the motor control. This program does only > read bytes from a file and writes them in realtime (rtai) to the > parallel port. Currently I'm thinking about to add a lot of features to > the C prog. or to leave it away completely. In the latter case I would > use EMC to do the machine controling. > > I'm neither used to G-Code nor to EMC but I tried to write some G-Code > in the way I would create with FoamBlade. > > G93 600 #new parameters every 100ms(worst case) > G01 X+0.4 Y-0.4 A+0.0 B-0.0 > G01 X+0.0 Y-0.4 A+0.1 B+0.4 > G01 X+0.4 Y-0.4 A+0.6 B-0.4 > ... > .(lots of them (maybe thousands)) > ...
If the above (output points at some time intervals) is really all you want to do, you don't need g-code or most of EMC. By splitting the shape into points at specific time intervals, you are doing the job of a trajectory planner. Converting that into g-code, so you can send it through EMC's interpreter and trajectory planner, seems strange. If you are using g-code, it seems like you might as take advantage of EMC trajectory planner - use arcs and lines in your g-code, not just periodic samples. On the other hand, if you'd really prefer to generate a sequence of points in your program, you can use HAL tools to send that sequence to the motors (stepper or servo, your choice). There is a hal component called "streamer", which works with a user space program called halstreamer. You load the streamer component, then do "cat myfile >halstreamer" (or pipe the output of your program directly to halstreamer.) Each line in "myfile" is just a series of numbers (in ascii format). Halstreamer converts the lines to binary and writes them into a FIFO. Then streamer reads the FIFO and writes the values to HAL pins in a realtime thread. It would be quite easy to stream a new set of values every millisecond. As long as cat and halstreamer keep the FIFO from running dry, the duration of a run is limited only by disk size. Once in HAL, you can do anything you want with the values, specifically you can route them to stepgen modules, or to a PID loop driving a DAC and then a servo motor, or any other motion control solution that works with EMC. In your case, each line would have four values, for the four linear axes. You might want to add some additional values - you could use other HAL pins to turn your hot-wire power on and off for example. The decision to use EMC vs. HAL alone would be based on any other requirements you have besides basic motion control. If you want a GUI, then you want EMC proper. Likewise, the HAL only approach won't have any provisions for homing axes, unless you build those provisions into your HAL configuration. The HAL version also doesn't explicitly coordinate the motion of the axes - but it sounds like your Python program does that already. Regards, John Kasunich ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
