No announcement yet.

Cutting a part manual on a cnc, joystick control that writes gcode

  • Filter
  • Time
  • Show
Clear All
new posts

  • ibewgypsie
    Program posted for all to play with..

    It uses a dual axis joystick, with POV hat, A 4 button trigger that simulates the mouse buttons and one is a enter key, Uses 4 other buttons as configurable in Vbscript inside the program of your choice.

    I have it throwing MOUSE commands and using the lefthand stick as a screen x-y control. It works with any program. THE other buttons throw a ascii 1-14 number direct to the "other" program running. You simply start the joystick program and it will simulate a trackball or mouse. Since I am using a DirectX driver it should run with any USB or recognized joystick.

    In Mach2/3 you configure your program with the numbers it throws as hot-keys to move the axis'es..

    This is the exe file.. Not sure if you have Microsofts directx on your computer.(if you have games you probably already do) It is a simple download.. but have fun playing with it.. if you know someone who is old and sick, it is much easier to use than a trackball or mouse, they can sit the gamepad in thier lap.
    It does everything a mouse does and more. You can see the keys it throws if you open notepad, cursor over onto the page and click each button and see the control button keys appear. It runs in the background. Once you click the Start button (9th) button.. Repeat-key delay is on the sliders on the right side of the page. Exit is on the top.

    It'll work with any cnc program. I am using a sony PS2 controller and a smart-joy usb adapter. You must have a joystick hooked to it that windows recognizes or it will error out.. show you the PHTTTT... page...

    Free, what else can you ask for? Bobcad is still kicking my butt in the vbscript.. Kinda a queer basic.

    [This message has been edited by ibewgypsie (edited 06-19-2005).]

    [This message has been edited by ibewgypsie (edited 06-19-2005).]

    Leave a comment:

  • ibewgypsie
    RTLinux is not a part of EMC, EMC is running a RTlinux kernel. It is a seperate OS kernel. The "other kernel calls back to it for timing issues". It is the Main reason why EMC won't work in most applications since the home-user can't figure out how to untar and install the kernel properly with "thier" machine configuration. I can run it on the machine here in the house but my shop puter refuses it. Plenty of problems.

    It is a seperate company creating a OS with proper timing intervals for telecomm. is the one site I know of.

    Holler if ya need me.. I am off in the morning to burn some welding rods on the old ford frame.

    'declare use of dll

    'Private Declare Function Out8255 Lib "c:\WINDOWS\8255.dll" (ByVal portaddress As Integer, ByVal portdata As Integer) As Integer
    Private Declare Function timeGetTime Lib "c:\windows\SYSTEM\winmm.dll" () As Long

    These are two calls I use a lot in VB, one is a old 8255 driver that you can write bits to a specific address, be that a parallel port or a Pamux DMA board with bit/word addressing. The second is a windows function that returns a microsecond timer. It is not a interupt, just a timer thou.

    DirectX has some neat functions in it. A really nice microsecond timer and some 3d file, showing, manipulating, viewing 3d world by simple functions, Lighting and jpg wrap onto models, simple triangle building of primitives, and pixel COllision detection. All the programming was done for gamers.. but works well in the cnc world of modeling and gcodes too.

    I suck at C++ programming. It is mostly worded in the examples I find in C. I have to convert that into VB6.

    My joystick cnc works. Just about one time in several hours does the accel/decell subroutine fail.


    [This message has been edited by ibewgypsie (edited 06-18-2005).]

    Leave a comment:

  • hammerhead74000
    >Old issue of Nuts and volts has a story on reading the cpu inside the
    >sony hand controller with a simple commands via a serial link.

    Nuts and Volts is where I read about it; I've got that issue around here somewhere also...

    >Not sure how the "smartjoy" adapter works..

    I'm almost sure that it's an HID device... requiring an HID stack to use.

    >I'm the kid who can't leave things alone.

    Oh, you too? I used to take locks apart when I was a little kid... drove my Mom nuts...

    >There is usb/Cdrom/extended memory drivers on the New dos.. Freedos..

    My development machine is running FreeDOS off of a CF card... but the only USB drivers I've found so far are storage device drivers; and they don't support all the other things USB does (or, at least, they didn't say that they did, or how to access any such functionality).

    >Windows timing sucks.

    Doesn't it now, though...
    > I thought about using a external clock piped into
    > the parallel port and a software interupt each clock cycle.

    The problem with that is a) it's not a high-priority interrupt, and b) Windows (especially device drivers) sometimes turn off interrupts for long periods of time, so as a result you still get stuck with Windows' poor isochrony performance.

    >Art uses a RTLinux kernel external to his program.

    I did look, but didn't find any mention of RTLinux? What was mentioned was his own proprietary driver (which basically does the same thing)... and given what I do know of the Linux kernel, and RTLinux, I don't think that he's using the *actual* RTLinux kernel on Windows... Could you provide a specific link, as I'm not finding it?

    >they have packages they sell and free kernels.

    Umm... you're not, by any chance, thinking of EMC, are you? As that *does* run on RTLinux, and they do have packages, and free kernels (and lots of other stuff, too).

    Leave a comment:

  • ibewgypsie
    Old issue of Nuts and volts has a story on reading the cpu inside the sony hand controller with a simple commands via a serial link. I have it here somewhere. Not sure how the "smartjoy" adapter works.. That is pretty easy to do with a serial link in low level programming.

    I smoked my first one. I am not perfect. I opened it up and there was a cpu that looks like a black blob of epoxy there on the circuit board. I traced pins, solder traces for two days, only to come to the wrong conclusion. I smoked it. If you open something up you don't know anything about there is always that chance. It was a X-box controller now that I think about it.

    I could've put grampa's railroad watch back together if I could have found all the parts. I'm sure of it.. I got a whipping, from mom, grandma, grampa, and my brothers tortured me for weeks. I'm the kid who can't leave things alone.

    There is usb/Cdrom/extended memory drivers on the New dos.. Freedos.. look it up on the net. All the sublevel programming I did years ago is still here on disks.. It works with it.

    WIndows timing sucks. I thought about using a external clock piped into the parallel port and a software interupt each clock cycle.

    I liked to have went plumb nuts trying to make it work.

    Art uses a RTLinux kernel external to his program. Search out thier website.. they have packages they sell and free kernels.

    If it is "CHEAP" Plentiful, easy to use, easy to work on and makes it easier I love it.

    I have a bug in my code as of this moment. Am working on it. It uses a common dialog wrote in C directly to the windows OS. Writes the joystick data directly to the keyboard buffer and the Mouse/screen location Behind Windows OS's back.

    I can do that too in Assembly, High level? Poke,Peek(1036??,1056??) Flushes that puppy.

    If I can help you along, holler.

    David Cofer, Of:
    Tunnel Hill, North Georgia

    Leave a comment:

  • hammerhead74000
    Well, if it's the same DiamondBack that I'm thinking of, I am indeed the author of DiamondBack; if not, then could you please give me a link, so I can decide if I need to change the name of my program?

    Under Windows, you would basically need to completely take over the timing, interrupt, and task engine in the kernel to get good, isochronos performance - which Art does with some serious black magiks involving VxDs, secret incantations, and ritual sacrifices of old motherboards in an underground cave with a lava pit...

    I deal with the issue by not running any OS at all (DOS is used only for file system access, and only when the machine is not in motion). I have my own timing engine (based on the Pentium Time-Stamp register) and manage the time-slice allocation myself; with pulse generation being the top priority (and if there is any time left over, and it's greater than the maximum time for a process to run, then and only then is a process run). Once DiamondBack starts, it completely takes over the machine (it is designed to be run on dedicated hardware; much like a proprietary control, such as a Haas - the idea is that unless somebody told you, you wouldn't know that it has a PC motherboard at it's core).

    Oh, yeah - that also makes DiamondBack immune to Windows Issues (viruses, spyware, etc)...

    Due to the nature of USB, it's basically incompatible with my real-time engine. Consequently, my input devices must either be connected via the PS2 port, or hook to a spare RS232 or some parallel port lines (it's not too hard, however, to gin up an adapter for one of the brands of controller... I forgot which one, but I think it was the Nintendo?). My current jogging code uses something connected with a DOS mouse driver; such as a PS2 trackball (actually, the trackball works quite well for this; as compared to a handwheel).

    I don't need your VB code; as a) the concept is simple enough to for me to "get it" from your posting (as most good ideas are), and b) DiamondBack is written in a completely different environment and language (Object Pascal, with a handful of assembler thrown in for good measure); so I would end up re-writing it anyways... but thanks for the offer.

    P.s. - OK, I'm kidding about the lava pit part.

    Leave a comment:

  • ibewgypsie

    Yeah, I am going to do several other programs with the sony playstation2 controller. ($22) and the Usb adapter ($11) and this, believe me is the pinnacle of hand controls. They made it "kid tough".
    I am using directX to read the sticks, the buttons. In VB if you decide to use a Microsoft controller, well they have a ActiveX control interface that does all the work for you. You just pop it onto the form and read the variables off in Gamecntrl.value 's. (project, component, insertable objects, Microsoft Sidewinder cntrl)
    Using a NO-KEYBOARD at all enables you to do complex moves to write multiple code lines. Just write each movement every time you change directions, or speed. With the stick you need some deadband for minor changes. Probably a time-averaging like you do a thermocouple.

    Whatever example VB6 code-packet you need, just lemme know and I'll email it to you.

    I have not found a decent way to "time" the movements of a "real machine". It needs something like RtLinux to run in the background or possibly a external dongle/crystal to pulse a pin on the parallel port.

    Are you the author of diamondback?

    Leave a comment:

  • hammerhead74000
    Good idea. Well, if Art won't put it in, I will.

    DiamondBack already has the capability that Art mentioned - just hook a procedure to a F-key, that appends the current position to a file (along with a seek command). Then, jog the machine, and hit the F-key. However, I'll have to add something (probbably a jog-terminus procedure hook; and use the same procedure as mentioned above for writing the code out).

    Is a trackball OK for you, or do you really, really, want dual joystick inputs, with a gamepad?

    Hmm... Also, I'll add a readout for the position plus the cutter radius (in the direction of travel) - it'll simplify doing a pocket of a specific size.

    Leave a comment:

  • ibewgypsie

    A lot of robotics have controls like that with joysticks. Not many cnc softwares.

    the Mach3 Manual is telling me I still am not going to get what I want. The ability to "fly" my end mill like a microsoft flight simulator airplane. The welding robots I worked on for a while were like that.

    I am playing and trying to find my old software. Not feeling good enough today to crawl around and do the "nasty" work under the old ford. Most the welding today should be the all-position stuff where you allow the sparks to dribble down your forearms and grin and bear it. In a jittery, bad mood already I don'tt hink I need that. I did raise it up to neck level last night and the frame didn't break off.. *(ha ha..) so.. the sideplates will make it all right. I may raise it up to waist level and get me a stool, tomorrow.

    check out this..

    This is a vb6 word processor, graphical interface that allows you to plot your movements on the screen window, set Z height by bar on left, set feed speed by bar on left, select the endmill, go a g77 sequential movement (writes lots of back and forth strokes in gcode) using the amount of cut per pass. No circles, no fancy crap. It takes it all from a clipboard and pokes it to the word processor running in the background.

    I am adding in 3d w camera, graphical modeling by sprite multiplication and a visual end mill collision-deleteing them as it passes through. In other words, carving from a block into a shape using a joystick to carve.

    If I had spent the time I wasted on Bobcad programming I'd have all this done. Notice RiP's name at top, he had a pretty strong hand fixing some of my newbie programming mistakes.


    [This message has been edited by ibewgypsie (edited 06-10-2005).]

    Leave a comment:

  • Michael Moore
    I think a lot of the CNC controls have a "teach" function like that. It sounds like it works like a word-processing macro, where it records the movements and saves them for later playback.


    Leave a comment:

  • ibewgypsie
    Art's reply.........


    Already included in MAch3 as the Teach Wizard. Try it out. You can jog
    using jotstick or anything to get to places, hit the button for "Arc to
    here" or "feed to here" and the GCode is written..including G2/G3 arcs!!. It
    will write thge program AND display it as it is written, you then can save
    the program to run over and over again. I know of one person who "traced"
    the outline of a car grill with it and got a complete grill program in less
    than 15 minutes with arcs and all being perfect. Try it out, its a little
    used feature of MAch3 that is very powerfull, and simply hanging in till
    people figure out its there..
    (Its really one of the most powerfull wizards in the arsenal.. )


    Leave a comment:

  • ibewgypsie

    Imagine, the carving of metal. Under a flourescent magnifier. MOving .001 at a time cutting away the hind end of a animal deeply carved into a gun reciever.

    Imagine doing that with a $2,000 Sherline cnc mill. Producing a $20,000 gun with a $2,000 mill and a $175 cnc package.

    I am a artist. A very frustrated one. I tattoo, carve, paint, bend metal, carve metal. I used to kickbox to relieve my frustrations. Health has taken that away from me so they exist to further my stress level.

    Leave a comment:

  • jkilroy
    Sounds like a great idea. With just a little additional time in smarts the program could clean up the G code after the user was done.

    Leave a comment:

  • Cutting a part manual on a cnc, joystick control that writes gcode

    My open letter to Art of

    Howdy Art, (and crew)

    I am working on various things again here. Somethings you'd be a lot better at.
    The main drawback to having a cnc is the code creation: For "one-off parts" it is easier to just do them up on manual machine.

    About two years ago I wrote a joystick program in visual basic that would allow you to move your axis's on the mill and as you did it wrote gcode movements. This was using a single stick joystick. I was using the triggers as the up/dn Z axis. My accelleration subroutine was crude but it worked. (what did I do with the program? I have it on cd) I crashed and burned up the geckos then powering my bridgeport with the mass-inertia of the 200 plus pound slide. Heat killed them. I got onto Marriss pretty bad and since have apologized.

    I'd turn over all the code to you if you can write a supplemental program and market it.

    Using a 2 axis joystick (playstation 2) and A Smart-Joy adapter to USB I have figured out the stick, the buttons, using directX as a input co-ordinator.

    It'd open new worlds at my shop and other home-crafters to be able to cut a part in manual (stick control), then "run" the gcode program over and over and over and over.. if you wanted to.

    The way the software worked? each time a speed, or direction changed it wrote both the beginning and the end of the gcode movement. No circles, no arcs, no nutso complications. Just G01 x?? y?? z?? F??

    If the "others" here agree it is a valuable asset it will help my case. I proposed this to you once before. Adding it to Mach2/3 would just complicate things. I suggest you do it seperate using the Kiss principle.

    Imagine the benifits of the "new" sherline mill owners, who really just want to create parts. Cutting the models out by hand-manual-joystick then being able to rerun thier programs over and over and over.. even production shops where the intense parts demand requires something "right now" and not time to write all the movements needed to create it.

    With your programming skills it is a simple project. Brings about the "teach command" from the robotics world to "cnc".

    David Cofer [email protected]

    David Cofer, Of:
    Tunnel Hill, North Georgia