Permanent cnc code on TinyG

Home Forums TinyG TinyG Support Permanent cnc code on TinyG

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #5367

    Hi to everyone!

    I’m new in the TinyG world and I’m wondering if there is an easy way to use the TinyG board like a “Arduino” board. It means:
    -when you upload the gcode file the gcode is running in a loop mode;
    -when you turn off and then turn on the board, it is going to run the last uploaded code.

    Until now, what i understand is that there is only an hard way: edit the firmware. Am I wrong?

    Thank you in advance!!

    #5373
    alden
    Member

    No, you are not wrong. There is no provision to load canned gcode other than including it in the main program.

    There is a relatively simple way to do this if you are willing to recompile. Look in tinyg.h at how __CANNED_STARTUP functions. You can provide Gcode as a string array in a header file, compile it in, then have the machine run the Gcode whenever it starts up.

    I know this is a compile option, so it’s not as easy as inserting an SD card or something like that. Watch this space, however, we are continuing to add features and this in not the first time we’ve had a request for a simple way to do canned motion.

    #5377

    Thank you for the rapid reply! Really great news!
    I’m using step motors then the I/O regarding the encoders (J17 to J20) are not used in my application. So, tell me if, in your opinion, this could be a good plan:
    1. by a sd breakout board (probably http://www.adafruit.com/products/254)
    2. in order to use the board, remap the I/O encoder pins (by editing the firmware)
    3. Use the arduino sd library to manage the data inside the sd card

    PS. About point 2, the GPIO is now mapped on some screw terminal blocks for cooling, PWM and other stuffs. Then, the encoder I/Os seems the most feasible solution, imho.

    Cheers,
    Nicolò

    #5380
    alden
    Member

    Nicolo, J17 – J20 are not encoders, these are stepper signal outputs. You might be able to use the SPI outputs to drive an external SD card. The XIO system can be extended to use the SD card as a primary input.

    #5383

    Ok i read more documentation and i got to the same your conclusions. So, SPI for SD Card and J17 – J20 are output for possible external motor drivers.
    Looking at cad docs and xmega documentation, i figured out that J17 – J20 are digital programmable ports. If so, I should be able to edit the firmware in order to use the ports as an half of input and an half of output.

    Thank you!
    Nicolò

    #5384
    alden
    Member

    You could use J17-J20, except that those are the stepper driver signals, so you would be disabling the steppers if you did so.

    #5385

    Ok, now everything it’s clear to start the dirty job! 🙂

    Thanks again!
    Nicolò

    #5648
    suaveant
    Member

    Coming a little late in the game to this but I wonder if you could use a raspberry pi, which is very cheap and has a usb controller, to make something like this work for a very low cost.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.