CAD CAM EDM DRO - Yahoo Group Archive

RE: [CAD_CAM_EDM_DRO] turbo pascal

on 2002-01-05 07:06:53 UTC
TurboPascal is well capable of writing a G-Code interpreter. Witness Dave
Kowalski's TurboCNC, which is written in TurboPascal Release 7.

Now, how would you go about writing a G-Code interpreter in TurboPascal (or
any language, for that matter)?

1. Read and understand the action of the G-Codes, realizing that everyone
modifies the "standard" a little bit. Perhaps the EMC manuals, available on
the net, are a good starting point. Remember, you must know what each G-Code
does before you can write any useful program.
2. Once you understand all of the G-Codes, decide which G-Codes your program
will implement. Most G-Code interpreters do not implement all of the G-Codes
in the EMC document, and also, some G-Codes implement additional G-Codes
that are not in that document.
3. Decide on a set of "implementation" functions and write these. For
example, you'll need a routine that moves three axes (maybe four if you're
putting a rotary table on a mill) simultaneously such that each axis starts
and finishes at the same time. This is called linear interpolation. You'll
also need routines that can draw a circle in two axes.
4. Write these functions and write a small "driver" to test them.
5. Now, write a routine that parses a line of G-Code into its parts - Code
#, X location, Y Location, etc.
6. Write a routine that executes a line of code. This routine would call the
implementation functions that you wrote in step 3. If you find that you want
to do something that can't be done with a combination of the functions that
you designed in step 3, go back and implement additional functions till you
can accomplish the task.
7. Write the routines to read files for both program and tool offsets, if
you're going to use tool offsets.
8. Write the human interface.

Sounds easy, doesn't it? Deceptively so, as it takes a lot of work to assure
that all contingencies are covered and that the pulse rate sent to the
stepper motors is both correct and smooth. Too much jitter in the pulse
train, and you'll find that the motors will stall much sooner than they
should.

Hope this helps. Good luck!

|-----Original Message-----
|From: sdiken.rm [mailto:sdiken@...]
|Sent: Saturday, January 05, 2002 5:56 AM
|To: CAD_CAM_EDM_DRO@yahoogroups.com
|Subject: [CAD_CAM_EDM_DRO] turbo pascal
|
|
|Hi!
|I have project "Conversion of a lathe to CNC by using pc based motion
|control unit". I am using two step motors and Turbo Pascal programm.
|On my program, I should enter 1. point and 2. point. And also if it
|is line or acr. Tha programm is functioning well but my lovly prof.
|Want to enter G-Code like CNC. For exaple G01 X20 Y15. The advantage
|of this is to enter more motion commant. But how can I use it by
|turbo pascal programm.
|
|
|
|Addresses:
|FAQ: http://www.ktmarketing.com/faq.html
|FILES: http://groups.yahoo.com/group/CAD_CAM_EDM_DRO/files/
|
|Post messages: CAD_CAM_EDM_DRO@yahoogroups.com
|Subscribe: CAD_CAM_EDM_DRO-subscribe@yahoogroups.com
|Unsubscribe: CAD_CAM_EDM_DRO-unsubscribe@yahoogroups.com
|List owner: CAD_CAM_EDM_DRO-owner@yahoogroups.com, wanliker@...
|Moderator: jmelson@... timg@... [Moderator]
|URL to this page: http://groups.yahoo.com/group/CAD_CAM_EDM_DRO
|bill,
|List Manager
|
|
|
|Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|
|
|

Discussion Thread

sdiken.rm 2002-01-05 05:56:24 UTC turbo pascal Paul 2002-01-05 06:41:06 UTC Re: [CAD_CAM_EDM_DRO] turbo pascal Carol & Jerry Jankura 2002-01-05 07:06:53 UTC RE: [CAD_CAM_EDM_DRO] turbo pascal Alan Marconett KM6VV 2002-01-05 14:12:58 UTC Re: [CAD_CAM_EDM_DRO] turbo pascal ballendo 2002-01-06 00:46:44 UTC Re: turbo pascal