Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Shopbot Talking to Arduino

  1. #1
    Join Date
    Apr 2013
    Location
    Montreal QC
    Posts
    8

    Default Shopbot Talking to Arduino

    I have been playing around with an idea to attach a laser to the shopbot head for etching and cutting. In order to make controlling the laser (on/off/pulse width modulation) a little easier and more flexible, I am using an Arduino board set to receive commands from a serial port. So for example, if I send an "L100" command over the serial port to the Arduino (echo L100>com5) the laser turns on at 100%. That part is fine.

    Now, being a newb at the whole shopbot control except for using the usual part files, here is the problem. How can I create a custom command and incorporate it into the G-code? How do I map that command to windows command/DOS command?

    I read a bit on virtual tools.The programing guide says something about "TC, 1500, small, 2 " as a custom command but the virtual file looks more like "'VT = [&T]oolName, PathFile, autostart(1=yes), persist(1=yes)"

    Is this the route I have to go or are there other ways to create custom commands? So if anyone can give me some guidance, it would be greatly appreciated. I`m running version 3.6.46.

    I think if we get this working it will open up a whole bunch of other possibilities!

  2. #2
    Join Date
    Apr 2013
    Location
    Montreal QC
    Posts
    8

    Default

    Quote Originally Posted by jsolos View Post
    I read a bit on virtual tools.The programing guide says something about "TC, 1500, small, 2 " as a custom command but the virtual file looks more like "'VT = [&T]oolName, PathFile, autostart(1=yes), persist(1=yes)"
    Sorry, by this I mean I`m not sure how to get from a TC command to a virtual tool. Or are they even related?

  3. #3
    Join Date
    Mar 2008
    Location
    Tulsa Oklahoma
    Posts
    1,238

    Default

    Hi Eric-

    The Arduino and Shopbot are two of my favorite toys! (Especially the ARM based Arduino's like the Due.)

    Shopbot unfortunately does not provide a built-in interface to auxiliary controllers like an Arduino. That does not mean you cant outwit it and do it through the back door.

    One way would be to implement a synchronous serial link using 2 of the TTL outputs. One for clock, one for data. Then a short subroutine in the SBP file can output commands over the cobbled up protocol link.

    Another way is talk to an Arduino is to write a communications program that has to be run in parallel with the SB3 program. Shopbot does allow communication through the PC registry. That is also very klunky but its at least supported by the SB3 software directly. That is documented in the SB programming documentation. SB3 does not provide any mechanism to launch your program however, so do it the other way. Launch your program and have it launch SB3.

    Its a real shame the "open SBP" format does not allow user defined functions, as that would allow convenient calling of your subroutine, but again you can simulate it by using a set of global variables to hold the calling parameters. (I have had to use this method for some of my "active" SBP files.)

    Lastly there is the issue of changing the post processor(s) to call your laser controller for "cut" or "engrave" settings. Impliment any protocol you like on top of either of the above communications methods.

    I have advocated using UDP communications between the host and ShopBot, that would allow any number of intelligent controllers, but no support has been provided. Arduino's love UDP (so does everything except shopbots), as the Wiznet 5100 chip they use implements network communications in hardware, including TCP/IP connections. If you tinker any at the low level, check out that chip, it makes life so easy and is hacker proof, since hackers cannot change the hardware! Get a network shield and see what they are doing.

    That is probably information overload, but that might help get you going. Sounds like a cool project! Keep us up to date.

    (A fair note of caution, using a Laser on a shopbot is risky, as there is no safety mechanisms appropriate for high powered lasers built-in. Between glints, toxic exhaust issues, and eye safety, among others.)

    Hope that helped-

    D
    "The best thing about building something new is either you succeed or learn something. Its a win-win situation."

    --Greg Westbrook

  4. #4
    Join Date
    Mar 2008
    Location
    Tulsa Oklahoma
    Posts
    1,238

    Default Arduino post- addendum

    I just re-read the programmers handbook "ProgHand.pdf" (under [H]elp:[P]rogramming and Developers Resources) section regarding using the PC registry for data exchange with external programs. Section "Windows Registry Interface…Controlling the ShopBot software from outside programs (b)", page 34 in my copy of the pdf.

    My comments regarding getting data from the SB3 were mis-stated: you cannot get custom user information out of the SB3 program through the registry. You can send commands to the SB3 program that way. You can read the state of the shopbot, so appropriate commands can be generated (perhaps for the laser movement?)?

    There is no provision for setting or reading global variables, or passing parameters to your program from within a toolpath command list.

    The registry feature is something I have experimented with, but not recently. That neuron was taking a sigh-nap

    Sorry for the mistake! The synchronous serial interface will certainly work, but will require some clever coding! It can be bi-directional as well with two output lines and one input line.

    I fear that Arduinos were not a "twinkle in the eye" at the time of the SB3 program design, so the SB3 program is showing its age.

    Wonder when SB4 will be out? Any hopes of support for communication with intelligent peripherals? Why not mount a handi-bot on the gantry.. and use it as "smart drill".. or an array of them? That would require a much more powerful control program than SB3.

    Wouldn't it be cool if the SB4 toolpath "SBP" command language was dot-net based.. allowing compiled intelligent toolpaths! How could that help the average user? How about determining that the tool is cutting air, and speeding up? How about machine vision? Maybe allow the bot to do pick-and-place for assembly as well as cutting? When a 3D print-head finally arrives, the machine could switch from cutting to deposition mode dynamically. Or engrave serial numbers in parts automatically. Have the touch probe work during cutting operations so the tool would know it is about to encounter material instead of air. Or find Z0 dynamically!

    So many ideas come to mind for a next generation "SB4" program. The possiblities for 4+ axes boggles the mind.

    Hmm, enough day dreaming. Back to income producing- I may need an upgrade if some of these features every come to pass..

    D
    "The best thing about building something new is either you succeed or learn something. Its a win-win situation."

    --Greg Westbrook

  5. #5
    Join Date
    Dec 2009
    Location
    WiLL PACK, LLC, Franconia NH
    Posts
    74

    Default

    Eric -I have a laser set up on my SB-but I use a different controller.
    tom

  6. #6
    Join Date
    Jul 2005
    Location
    Brookline, New Hampshire
    Posts
    434

    Default

    A few years ago I looked at a shopbot to microcontroller interface using the shopbot discretes. I ran some tests using my PRT Alpha control box and discovered that I could change output discretes at 8,000 times per second. Including overhead, it looked like 2K bits per second were possible from the shopbot to the microcontroller. Might be able to get 1K bits per second in the reverse direction.

    The results were too slow to move much data but fast enough to send commands and such. I wanted to move large amounts of data from the microcontroller to the shopbot so I dropped the effort.

    Paul Z

  7. #7
    Join Date
    Dec 2000
    Location
    Thorp, WI
    Posts
    2,862

    Default

    I don't know anything about Arduino, but could something like the way the spindle control works be applied to this situation? Instead of a TR,12000 command, sending out an equivalent L,100. Or for the lack of making a new SB command, cross referencing TR commands (TR,100 or something like that). Then it would just be a matter of making a custom post processor for it.

    I read this last night and fell asleep thinking about it and my last thought was, Dana Swift.
    Scott




  8. #8
    Join Date
    Mar 2008
    Location
    Tulsa Oklahoma
    Posts
    1,238

    Default

    Another thought that occurred to me, how about open COMx as a file, then use INPUT and WRITE statements to communicate with the Arduino? The Ardunio shows up as a COM port when it is plugged in via USB. That could make the communication issue trivial.

    Something along the lines of:

    OPEN "COM1:" FOR INPUT AS #1

    then..

    WRITE #1,"Command Text String"
    INPUT #1,&AcknowledgeMessage

    and finally:

    CLOSE #1

    The serial port would have to be configured elsewhere of course. The open could be done in the SBP header when the spindle/router is turned on. Close could be called when the spindle/router is turned off.

    In the toolpath WRITE #1 commands can be used to send specific commands to the Arduino.

    Just getting the rust out of the mental machinery..

    Paul- that was the idea I was suggesting, but I have never tried it, its just clear that it would work.

    Thomas- I would love to hear more about how you setup your laser.

    D
    "The best thing about building something new is either you succeed or learn something. Its a win-win situation."

    --Greg Westbrook

  9. #9
    Join Date
    Jan 2004
    Location
    iBILD Solutions - Southern NJ
    Posts
    7,986

    Default

    Not to steer away from using an Arduino, but have you checked out the VH command in newer versions of SB3? It is made to interface with laser using PWM control.

    -B
    High Definition 3D Laser Scanning Services - Advanced ShopBot CNC Training and Consultation - Vectric Custom Video Training IBILD.com

  10. #10
    Join Date
    Dec 2009
    Location
    WiLL PACK, LLC, Franconia NH
    Posts
    74

    Default

    Dana - not sure I can be much help...I had a tech guy integrate my laser. But certainly - if you have specific questions - I can try to answer them or post pics.

    I believe it was Brady in a past thread that suggested it was not his preference to combine both laser with router/spindle - and I have to agree with that opinion. Although my setup has worked for me - it does require care to shield the laser from dust and debris when the router is running....so Eric if you're seriously entertaining this as an option....I may rethink that (depending upon your application - it was costly to integrate and may make more sense to simply purchase a stand alone laser machine.)

    I think it was in 2007 that I looked into changing my PRT rails to round linear with pillow block and ball screw which would give much smoother action and reduce the vibration of the laser considerably, but could not afford it.

    My limited understanding of some of the issues with integrating laser on the SB and controlling it - is when vector cutting - reducing the power of the laser as it comes into a corner to avoid burning. The controller has to do this smoothly and I believe has been one of the major obstacles....so I'm not sure if the Arduino setup can handle this.

    One of the limitations of my controller - when raster cutting .bmp images is doing them one at a time. Ideally - I'd love to set up 50 small plaques on the table and be able to run all 50 at once. Instead, I have to set up a jig and run one at a time and continually replace as it completes.

    On positive note - my controller does allow the adjustment of both power and feed rate to 'dial-in' a precise control - but it was not inexpensive. With the addition of PhotoGraV software for raster images has extended my capabilities and offerings to clients - which has been very helpful.

    Tom

Similar Threads

  1. Update shopbot control computer with VCarve Pro Shopbot edition
    By Greybarn in forum ShopBotter Message Board
    Replies: 6
    Last Post: 11-16-2016, 11:55 AM
  2. Arduino LED's
    By Keyco Wood in forum ShopBotter Message Board
    Replies: 13
    Last Post: 12-03-2013, 01:00 PM
  3. My comments and ways of talking on the forum
    By genek in forum ShopBotter Message Board
    Replies: 19
    Last Post: 10-02-2013, 11:10 PM
  4. More fun with an Arduino and stepper motors
    By richards in forum Variations & Modifications of ShopBots
    Replies: 7
    Last Post: 06-18-2013, 09:11 AM
  5. Using an Arduino for quick interfacing
    By richards in forum Variations & Modifications of ShopBots
    Replies: 7
    Last Post: 12-13-2011, 06:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •