TinyG with uC for stand-alone CNC

Home Forums TinyG TinyG Feature Requests TinyG with uC for stand-alone CNC

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #7131
    Ultron
    Member

    Can i connect to TinyG a uC (ex. PIC32) that reads the gcode from a SDcard and ship them via serial, interrupting the flow, for a moment, when it receives a signal buffer full?

    #7132
    cmcgrath5035
    Moderator

    I’ll say the answer is yes, since tinyG simply receives and responds to tinyG Commands and Gcode received via USB or serial (via the serial headed pins).
    As you can imagine, flow control is essential.
    Also good to observe the tinyG response stream as it is working on your data stream.
    If you wander thru the forums a bit, you’ll see several folks developing their own Applications which are similar to tgFX
    Also have a look at the Q&A and Comments on

    There is no detailed how-to, but all the raw data seems to be available.

    #7133
    Ultron
    Member

    Ok, thanks a lot! My project started several months ago, but the G-Code interpreter has been a big obstacle (for arch and circle functions), so now i can “cut the head at the bull” (an italian slang 😉 ) and i use TinyG with my uC PIC32MZ series with 7″ TFT touch display (Human Interface Machine) and Sdcard.
    My uC for HID, and your ATXmega for G-Code Intepreter!
    I am happy! 🙂

    Simply the code reads SDcard file, and it sends lines to ATXmega, one at a time, with a little delay() among the instrunctions, or it uses the RTS line for wait every time, the buffer is full. It’s Ok?

    #7136
    Ultron
    Member

    I read the faq.

    So … my uc sends the G-Code text through the serial, meanwhile listens in receiving.
    When it receives a data, an interrupt is triggered that analyzes if the data contain the character of xoff (0x13), and the transmission stops until the PIC32 has received the data of xon (0x11) from ATxmega.

    it’s that simple?

    What kind of string (before starting) I have to send to activate the flow control?

    Thanks

    Guido from Italy

    • This reply was modified 9 years, 9 months ago by Ultron.
    #7138
    cmcgrath5035
    Moderator

    Guido
    First a Forum Comment: You started this in the tinyG/TinyG Feature Requests sub-forum. Now that I see where you are headed, I believe you should be in the tinyG/TinyG Support sub-forum. It is likely that more active developers, like yourself, will see your posts and respond. This sub-forum is sort of a wish list for future features, the Support sub-forum is for “how-do-I-make-it-work”. I suggest you continue there,

    Your project: I believe your description of an implementation of Xon/Xoff protocol is a good one. BUT it implies to me that your environment on the PIC32 has minimal ‘driver’ like support for peripherals, since flow control, buffering, etc. are usually handled by device drivers. Your approach seems correct, but readers here can only assume that your implementation has also considered any possible error cases and recovery from them.

    Have you run your CNC via a terminal application running on a PC under Windows (or Linux, or MacOS)? A very typical environment that most here understand and use is Coolterm on Windows. Running some test Gcode from that platform will reveal the steps necessary to Run a complete job. In general, you first need to configure tinyG with tinyG specific configuration commands(such as setting the Flow control to Xon/Xoff, or RTS/CTS, or….) and configure tinyG for specifics about your machine (motor setup, axis setup). All these steps are covered on the wiki, start here

    I continue to believe you can implement your PIC based machine controller, but I am not sure you have a grasp on all the steps necessary for success. Since there is no detailed how-to to guide you, the experience you would gain from running a complete (successful) job via Coolterm would seem a hands on introduction to the complete process.
    For most folks here, running tinyG from a terminal is the “lowest level” interface and most work with higher level applications such as tgFX or Chilipeppr or JCNC.
    Many folks have coded their own implementations, but you are really on your own to understand all the pieces of the puzzle

    When you continue, I do suggest switching to tinyG Support sub-forum. You will attract more input there.

    #7139
    Ultron
    Member

    Thanks a lot.

    I will open a Thread in your suggested Forum.

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