View Full Version : Cnc#


GregMM
09-15-2005, 11:54 PM
I have started working on a machine controller software written in C# called CNC#, but will have plugin support so plugins can be in any .NET language so I can use Managed C++ for the actual machine control, so far the plugin interfaces planned are for Renderers to preview the toolpath, Machines so your not limited to parallel port step/dir commands, file importers, and generators to generate common gcodes liek gears and whatnot, I got basic renderings working with Direct 3D, the program is going to be free and the sources posted once it gets a little more matured, heres a screenshot of what its at so far, the screenshot is showing a zoomed in circuit board that was exported to gcode from EAGLE, its the first app ive done with 3d graphics, so I havnt actually figured out how to show it as a solid like the machine actually cut it, just the toolpaths for right now

heyarnold
09-19-2005, 09:52 AM
Outstanding! I think your idea and program are great! Please keep posting your updates.

Evodyne
09-19-2005, 02:39 PM
Greg,

Looks real nice! Definately keep working on it. And I applaud you for deciding to post the code as open source. Thanks!

Lance

anoel
09-19-2005, 02:53 PM
Very cool. I'm a noobie with C# and just got back from the Microsoft PDC conference and attended several sessions on C#.

Writing a Gcode back plotter was to be my first excercise in graphics programming with C#. You beat me to it.

Can you give a basic idea of what you used to implement the 3d stuff? I was thinking of using DirectX or OpenGL (probably DirectX, since I'm looking at making use of the Windows Presentation Layer "Avalon" and that's all DirectX implemented. I've got all of the Windows Vitsa and VS2005 betas now and want to get in a little deeper into the new stuff they've slated for the Vista relase.)

Also there was a really cool demo at the PDC show where there was a company that was doing "Realtime" OS with windows by running WindowsCE underneath Windows XP and the software was marshalling commands from XP to CE which in turn commanded a really cool milling robotic arm in realtime.

GregMM
09-19-2005, 09:28 PM
Thanks for the feedback, for 3D stuff im using Direct 3D, or more specificly Managed Direct 3D, its pretty easy to learn, I got the "Managed DirectX 9 Kickstart" book from my college book store and its really very good, although the samples are the same as in the DirectX SDK as the author is the one who programmed the DirectX SDK samples, I would definilty start with Managed D3D over normal D3D unless you have a very good understanding of matricies/linear algebra

Switcher
09-22-2005, 11:50 AM
GregMM, Great Job! I can't wait to see a demo, of what you've done so far. I've just started working with VB .NET, I think an open source controller, is just what this site needs! They already have tons of people that know the mechanical & electrical, side of cnc. Now all they need is people working on a open source controller. Are you planning on using this site, to host your code, or do you have your own site? Again, great work!

GregMM
09-27-2005, 10:41 PM
Hey switcher, I do have a site, however there isnt anything there right now, the first couple betas will probly just be posted here, but it will probly be a little bit before its ready for a beta, im actually taking a robotics course in college right now, and I am experimenting with a more universal approach to the program, rather then making it 3 axis/4 axis/etc, im going to try and make it support unlimited axes using a machine configuration file which will be able to hold wither the Denavit-Hartenburg Notation paramaters for generating the coordinate frame transformation matrix, or the transformation matrix itself, but using these matricies, I should be able to generate a jacobian matrix to do inverse kinimatics (figuring out how much to move along the axis in the axis's coordinate plane, in order to get tot the point in the base frame, or real world coordinates) should make things pretty interesting and should only need three types of joints, prismatic (linear actuator type joints, like normal X, Y, Z axes), revolute (rotational axes, like a fourth/fifth/etc axis), and a special case of the revolute joint that will rotate based on time like the rotating part of a lathe, although the last is actually only used in simulation), I also want the machine description to include 3d parts for the simulation, as it would look cool to have a good looking solid simulation with the machine and all, instead of just the toolpath

CJL5585
09-28-2005, 11:52 AM
Great Job.
Looking forward to the demo and code.

Jerry

kurt_m
10-07-2005, 11:54 PM
Very cool. I am a Newbie to C# what a great project. Every thought of looking at EMC source code to get some ideas? I am going to download it and look at it to see how complex it is. Maybe you can can use and improve on the code when converting over to C# language and structure.

It amazes me that people crank out this stuff. Still working on getting my mill CNC converted. See www.bestbots.us

ger21
10-08-2005, 01:27 AM
Very cool. I am a Newbie to C# what a great project. Every thought of looking at EMC source code to get some ideas? I am going to download it and look at it to see how complex it is. Maybe you can can use and improve on the code when converting over to C# language and structure.

I believe Mach1 was based on EMC code, but has evolved considerably while becoming Mach3.

GregMM
11-06-2005, 08:54 PM
just letting people know that Im still working on it, although progress has been a little slow with the school work, Ive figured out how to get it to generate the necessary step pulses for movements, although there is no timing implemented yet, its going to be using two stage compiling, first stage takes all the commands and will interpret them so there is only linear interpolation ex (the Gcode the draw a circle/arc and drill routines, etc will be converted to the coordinates to move in order to generate toolpath rendering easily, and the machine plugin interface can either request this level in order to send coordinates to the machine, for non-step/dir machines, or the next level which compiles to step dir pulses for machines that use step/dir), I chose to do it this way so that step/direction pulses are only generated in one place, to avoid bugs/unimplmenetations throughout the different plugins, and also make plugin development easier, so the plugin will only have to handle step/dir pulses or linear interpolation coordinates, unfortunatly I dont have a machine yet, hopefully ill get some stepper drivers soon, and I can start implementing/verifiny the step pulse generation and timing, heres a screenshot of where its at right now

CJL5585
11-06-2005, 09:48 PM
Your efforts are looking good.

Jerry

John_PE
11-09-2005, 01:21 PM
...Also there was a really cool demo at the PDC show where there was a company that was doing "Realtime" OS with windows by running WindowsCE underneath Windows XP and the software was marshalling commands from XP to CE which in turn commanded a really cool milling robotic arm in realtime.

The robot controller was actually running Windows XP along with the VxWorks RTOS. There was a computer sitting next to the robot controller running MasterCAM piping the path data over a NULL modem connection. The robot was a 250KG model manipulating a router spindle type end-effector. You can read more about the control software at www.kuka-controls.com

/ Disclaimer - I do work for KUKA Robotics and was the engineer supporting the PDC display.

John_PE
11-09-2005, 01:33 PM
Hey switcher, I do have a site, however there isnt anything there right now, the first couple betas will probly just be posted here, but it will probly be a little bit before its ready for a beta, im actually taking a robotics course in college right now, and I am experimenting with a more universal approach to the program, rather then making it 3 axis/4 axis/etc, im going to try and make it support unlimited axes using a machine configuration file which will be able to hold wither the Denavit-Hartenburg Notation paramaters for generating the coordinate frame transformation matrix, or the transformation matrix itself, but using these matricies, I should be able to generate a jacobian matrix to do inverse kinimatics (figuring out how much to move along the axis in the axis's coordinate plane, in order to get tot the point in the base frame, or real world coordinates) should make things pretty interesting and should only need three types of joints, prismatic (linear actuator type joints, like normal X, Y, Z axes), revolute (rotational axes, like a fourth/fifth/etc axis), and a special case of the revolute joint that will rotate based on time like the rotating part of a lathe, although the last is actually only used in simulation), I also want the machine description to include 3d parts for the simulation, as it would look cool to have a good looking solid simulation with the machine and all, instead of just the toolpath

Good luck with your project. Don't spend too much time deriving a completely general kinematics model - just cover the basic machine configurations. Also don't forget about joint singularities where applicable.

Windows is notoriously inconsistent for motion control applications. I would not recommend attempting to update motor positions/velocities with a period less then 50 milliseconds.

GregMM
01-02-2006, 10:21 PM
ok still working on it, got a little side tracked with all the .net 2.0 stuff, but its looking pretty good, converted all collections to generics which sped up the code a lot, worked a little bit on solid generation (although its still pretty crappy right now, its really just a surface the moves to lowest z on the tool path, im going to be taking a simulation course this semester so hopefully ill be able to get some sort of actual solids going, if anyone knows of a good tutoiral on solids from a programming perspective, it would be cool if you could post the links here) worked on the interface a little bit, .net 2.0's toolbars are soo much better then the originals, changed to only supporting 6 axes instead of a variable number for speed reasons and also GCode only supports 6 axes XYZABC, plus im sure most of the machines here arent running more then 6 axes heh, well heres a screenshot of what it looks like so far

turmite
01-06-2006, 01:40 PM
Greg,

I need a little clarification. Is this a cam program or a motion control i.e., mach2/3/4? I first though you were doing a cam program but it seems now it is a motion controller. ?? Edited to add Duhhhhhh! I just went back and re-read your original post! Sorry.

John_PE,
Do I understand correctly that the program will control a robot like we see doing welding and things? Does it use gcodes, output signals for the motors?
More info please,such as, is the program available, now and how expensive or affordable?

Mike

GregMM
03-10-2006, 07:47 PM
Just wanted to say that this project is not dead, its been put on hold for a while, Im taking a game programming class in college so most of my time lately has been working on that, probly going to order some motor controllers soon, so ill be able to actually test movement (atleast as rotation is concerned, dont know when im going to get around to building the actual machine, hopefully not too long after the semesters over though)

GisMo
07-31-2006, 07:22 PM
GregMM,
I am VERY interesting in your project. What's the status? If your interested, I've got tons of suggestions.

GisMo

rozanc
03-18-2009, 04:08 PM
very nice:) I can't wait to see the code