View Full Version : turning a image/model into directions for motors


elexolman
03-28-2008, 10:32 PM
Hi, I am making my own CNC program (in order to use a USB I/O 24 from elexol, twenty four ins and outs, takes four minimum for a stepper motor, leaving plenty for other purposes (laser heat sensor, focusing lens, etc)... but anyway, I have successfully driven the motors, but now need to know how to take an image, or model, and turn them into usable directions for the motors (I am using VB .NET)... any help is appreciated...

elexolman
04-07-2008, 08:20 PM
can anyone point me in the right direction? I recently realized that since the elexol module is a virtual serial port, that might help integrate other programs, but it is a serial, not parallel, port...

mc-motorsports
04-08-2008, 04:03 AM
CAD/CAM LOL! You're over my head, that was just a joke. Good luck!

ballchain
04-08-2008, 01:01 PM
You're looking for a CAD/CAM software package.

elexolman
04-13-2008, 12:55 PM
I looked at the packages I could find, and I can't find information on using them with a homemade controller like this, or am I missing something?

chazmtu
04-13-2008, 01:15 PM
Hello,
I could be mistaken but I think windows gets in the way motor control timing. My machine runs through the parallel port but doesn't work right in windows because it doesn't pass on information right when its received. I have to use dos. All the serial systems I've seen have a controller between the machine and computer to queue up instructions. I don't have any experience with that though.

What your looking for is a G-code interpreter. It takes instructions and converts them to motor control signals usually through a parallel or serial port.

Chuck

elexolman
04-13-2008, 01:17 PM
this G-Code, I assume, can then be interpreted by my program? Is it difficult to use?

chazmtu
04-13-2008, 01:21 PM
Oh yeah,
And CAD/CAM can design the part and CAM can make instructions called G-Code for your interpreter.

chazmtu
04-13-2008, 01:23 PM
No its fairly easy, you load the g-code file and tell the machine where to start. Don't know how to set it up for a serial port though.

elexolman
04-13-2008, 01:29 PM
all the control is on the computer, the Elexol USB module merely listens and drives the motors, each motor has four power transistors, and the program, when ever it sends a movement (at least for my test version) just turns on the transistors in sequential order, making a step... main thing is that I needed something to tell my programs which way to turn the motors, and it seems that G code is the answer to that, but what I meant to ask is if making the program I am writing understand g code difficult... maybe there is a tutorial somewhere?

Switcher
04-13-2008, 01:35 PM
What you need to do is parse a DXF file.

A .DXF file is just a simple text file.

You should be able to find a bunch of info on google for vb.net etc.

Open any .DXF file in Windows Notepad, you'll see after the header it's a pattern that keeps repeating with different coordinates.

This thread (http://www.cnczone.com/forums/showthread.php?t=8814&page=2)might help?

Like chazmtu said, timing might be an issue?


.

chazmtu
04-13-2008, 01:40 PM
I've not seen a tutorial but then I wasn't looking for one. I'm not much of a programmer but it might be easier to modify an already existing program. A lot of people really like mach3. I can tell you that usb control for CNC is still experimental. I thought I saw a thread on it a few days ago. I'll see if I can find it.

elexolman
04-13-2008, 01:45 PM
I really, even though it is using USB hardware, would not refer to it as USB, since the device uses a virtual com port driver to make it as if the USB port was a COM port, making it easier to program (and simpler if I use a machine other than my own, and COM ports are going away on many comps)... and it looks like the .DXF thing would work for me, but I still would like to be able to use a 3D model... maybe I'll save that though for an update : )
right now I am looking at mach3, and it seems that there is a dev version, which might help me out a LOT!...

ger21
04-13-2008, 02:05 PM
The development version of Mach3 is just the most recent release, it won't give you any code to look at. You might want to look at the source code for EMC. Part of Mach3 was based on the EMC code. Be aware that Mach3 is the result of one person working 8-16 hours a day, 7 days a week, for almost 5 years to get where it is today. :)

elexolman
04-13-2008, 02:53 PM
I meant the SDK that appears to be available...

[ADDITION]: just thought I might put this out there, thanks to the Arduino I recently got, I also can now make the machine not need a computer (assuming the raw directions for a set, but re programmable, output are made first)...

chazmtu
04-13-2008, 02:57 PM
My mistake. Looks like Switcher and Ger21 Know a whole lot more than me about that, no surprise there.