Results 1 to 10 of 26

Thread: Shopbot Talking to Arduino

Hybrid View

  1. #1
    Join Date
    Apr 2003
    Location
    ShopBot Tools, Inc, Durham NC
    Posts
    187

    Default

    Hi Guys,

    Just to jump in with a bit more info ... or distraction.

    On Laser Control: As mentioned by Brady, VH (with VN activation) can be used to control a laser using a standard PWM protocol (with a V204 or later board). It deals with modulating the laser during acceleration/deceleration. We've used it on a couple of tools here and have a couple of ShopBotters who use it. We are open to more input on how to refine the system, but it will certainly work in a basic way to run a laser. (VH also has a protocol to control 3D printer temperatures; but in practice, we've found the heaters produce enough electrical noise that it is more reliable to just run them with a standalone thermal control, and that is how our 3D head will work.) The use of VH is described in the current Command Reference. Note that pinouts for the Control Card can be found at: http://www.shopbottools.com/files/ShopBotControlCardConnections.pdf

    On Arduino's: It does not make a lot of sense to me to try and serially communicate with an Arduino from the ShopBot Control Card or software -- just too big a hassle. But you can certainly interact with the Arduino by signaling to it using the an app that is monitoring the registry, a file, etc ... or better by reading a couple of ShopBot Outputs. On the new Handibot, we use an Arduino to control all the fancy LED blinking and coloring. We trigger the appropriate Arduino program by activating various combinations of Outputs (a very simple approach) which are decoded by Arduino inputs.

    On Arudino's and Open Source more generally: I don't know if you have seen our planning for the next Control Card that is discussed in some of the Handibot documents as well as here: http://www.shopbottools.com/mApplications/developers.htm. Basically the plan is to move towards the same uController that is used in the Arduino DUE. This would be a natural move in the sense of a upgrading to a more capable 32-bit ARM controller for ShopBot; it will initially run ShopBot firmware that will interact with our Control Software in the regular way. However, we are also working with a group that is developing a new, open-source, motion control system that will run on the same uC. This new system puts about 85% of what is normally done on the PC, on the uC and will offer an advanced motion control system that is under active development by a number of interested individuals and groups. With it, you will be able to run ShopBot from a much thinner application; making using a wide range of devices much more practical ... and making the whole environment for running a ShopBot much more open and expansive. We think it is pretty exciting. Just flash whatever firmware system you want on the tool -- run it as a current ShopBot, or with the new approach.

    Ted Hall, ShopBot

  2. #2
    Join Date
    May 2013
    Location
    Bennington, VT
    Posts
    4

    Default 0-5v to arduino

    Hey guys,

    I am so glad I have found this thread. So I just found the j6 header on the controller and as Ted has described it can output PWM? From what I understand I can use a low pass filter to convert that to an analog signal and read that through Arduino's input pins? Ted, do have some example code on how to use VH? The pin out diagram you posted indicates there are also analog outputs, DAC 0, DAC1 - pins 18-20... 0-5v?. What command uses those?

    what I need to do is use gcode get a 0-5v signal to the arduino which i will be output as a analog 0-10v signal to an air pressure controller. I am working on a ceramic paste extruder head for 3d printing. I want to use gcode to set and control air pressure and then modulate it with speed. The VH command sounds perfect, i am just not sure how to implement it.

    Setting up the com port as dana described in confusing to me. How do I do that in gcode? from there i can probably figure out how to get arduino to listen.

    any help would be really appreciated!

    -Guy

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

    Default

    Guy- the GCode documentation for SB is:

    http://shopbotwiki.com/index.php?title=GCodeMain

    If what you want to do is there, you are in good shape. If not, consider learning more about the SBP command language. It is documented in depth in the programming handbook.

    http://shopbottools.com/ShopBotDocs/...%2005%2001.pdf

    As to reading the signals from the arduino, it depends a bit on which arduino you are using. I would suggest you avoid the analog conversion step, as that just discards all the accuracy and precision digital data offers. The signal Ted describes is digital in nature and fully arduino compatible. Look into using the counter/timers of the arduino to recover the values from the VH command.
    "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
    Jan 2004
    Location
    , South Jordan Utah
    Posts
    1,693

    Default

    An often overlooked feature of the Arduino is the SPI and I2C interfaces. In some of my projects, I have a bunch of microprocessors connected via the I2C interface. One is the "master" and the others are "slaves". The master sends parameters and "start" signals to the slaves. The slaves send status information to the master while performing their tasks.

    By breaking up the entire task into several subtasks, a handful of little $3.00 microprocessors can be used to control feature-laden machines. For example, Kodak/Bremson sold an electronic retrofit controller based on the DEC LSI-11 cardcage for the S-Series of Professional photoprinters. The base price for that unit was $17,000, with a typical installed price about double that. My microcontroller version had more bells and whistles than the DEC model. Parts, including eight stepper motors, cost less than $2,000. I could sell my unit for half the price of the basic Kodak model and actually make more profit per unit than Kodak.

    By breaking an application into its component parts, its easy to assign an Arduino or other microcontroller a specific task. For instance, a simple LCD controller usually uses seven pins, which eats up a log of the available I/O on that board. A bunch of analog input/outputs can use up all of the analog pins. Before long, all of the Arduino's pins are used. Add to that the requirement to closely control some signals (stepper pulse string, for example), and a single Arduino can bog down. By assigning a separate Arduino or microcontroller to each stepper motor, to the display, and to the other various inputs and outputs, everything can be handled in a timely fashion without spending a fortune, There are standard libraries already written that simplify connecting multiple Arduinos via I2C or SPI.

  5. #5
    Join Date
    May 2013
    Location
    Bennington, VT
    Posts
    4

    Default

    thanks dana. I found some tutorials using counter/timer as you suggested I will give them a shot.

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

    Default

    HI, just wanted to post a quick update. Ted, from Shopbot came up with a brilliantly simple idea.

    I can use the following command from a DOS prompt to send the commands to the Arduino. For example;
    "ECHO L1>com5" (where com5 is the serial port the Arduino is listening to.)

    So Ted's idea is just to do a SHELL command in my G-code and pass the commands that way. There's a utility somewhere on the website that lets you edit G-Code based on certain conditions. I used that to insert two commands in my code. I test for changes in the Z axis. Before Z moves up, I insert
    SHELL, "ECHO L0>com5" into the G-Code. Before Z moves Down, I insert SHELL, "ECHO L1>com5" into the code.

    So using this I can send commands to the Arduino to turn the laser on or off as the spindle moves up and down.

    I'll try to test the whole thing this week and maybe post a few pictures of the Laser and 3D print heads mounted on the Shopbot.

  7. #7
    Join Date
    May 2013
    Location
    Bennington, VT
    Posts
    4

    Default

    Quote Originally Posted by jsolos View Post
    HI, just wanted to post a quick update. Ted, from Shopbot came up with a brilliantly simple idea.

    I can use the following command from a DOS prompt to send the commands to the Arduino. For example;
    "ECHO L1>com5" (where com5 is the serial port the Arduino is listening to.)

    So Ted's idea is just to do a SHELL command in my G-code and pass the commands that way. There's a utility somewhere on the website that lets you edit G-Code based on certain conditions. I used that to insert two commands in my code. I test for changes in the Z axis. Before Z moves up, I insert
    SHELL, "ECHO L0>com5" into the G-Code. Before Z moves Down, I insert SHELL, "ECHO L1>com5" into the code.

    So using this I can send commands to the Arduino to turn the laser on or off as the spindle moves up and down.

    I'll try to test the whole thing this week and maybe post a few pictures of the Laser and 3D print heads mounted on the Shopbot.
    Eric,

    Trying to talk to an arduino. I tried running a sbp file with your command line SHELL, "ECHO L0>comX" with arduino listening to that specified com port. I got nothing. Can you share more of your code? Is ECHO a file location of another program as it states it in the command reference guide? I have no idea how your system is working. Your help would be very appreciated.

    Go Habs!

    thanks,

    Guy

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

    Default

    Hi Guy,

    Although ECHO is a built in dos command, the shopbot interpreter had trouble with it. I had to find an external "echo" program that I could put in the shopbot software directory where the command interpreter for SHELL could find it.

    I think I got it from here. http://www.paulsadowski.com/wsh/cmdprogs.htm or any other similar utility.

    Once you have that, you can make sure the connection works by opening a DOS command window in the directory you put the new EXE and trying your command like "ECHO L1 0 >COMM1" or whatever comm port your arduino is listening on. Once you know that works, then try calling it from the shell command.

    Hope that helps.

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
  •