GUI for TinyG controller

Home Forums TinyG TinyG Support GUI for TinyG controller

Viewing 15 posts - 1 through 15 (of 30 total)
  • Author
    Posts
  • #1481
    saci
    Member

    Hi, I greatly appreciate your professionalism and all of your hard work to acheive this project.
    I looking to develop an extremely simple GUI for the TinyG controller, I want to do something to simplify setting-up the controller, exporting, importing settings files, offer a simple manual control, and streaming gcode file to it without need to a serial terminal software! Here is a sample of what the finished GUI might look. If you find this tool to be useful, I need help and any suggestion is highly appreciated.

    http://dl.free.fr/jNO87e9x7/tinygo1.JPG
    http://dl.free.fr/rhX1ozGQA/tinygo2.JPG

    Thanks again for doing such a great job.

    #1482
    alden
    Member

    We appreciate the feedback. This has definitely been a process, and a lot of work. I like the panels you laid out

    We are working on a GUI and would love to collaborate, or just have more than one available if that’s the way you want to go. We are trying to make things as “real” as possible. To that end, we are following Thomas Kramer’s RS274NGC v3 standard for Gcode that can be found here: http://www.isd.mel.nist.gov/documents/kramer/RS274NGC_3.pdf We are also following “CNC Programming Handbook, Third Edition” by Peter Smid. This is as close to a reference manual as exists for CNC control, and is considered the gold standard for CNC machines by many in the field. You can find it on Amazon new and used. The book has the conventions for naming, control layout and behaviors, and other aspects of making realistic controls. Some other info that might be useful may be found on the project wiki under: http://www.synthetos.com/wiki/index.php?title=Projects:TinyG-Developer-Info:

    With that in mind, here are some comments (rather lengthy – I’ll try to break it up). These are based on the latest version on the github, version 0.92 (Crocs)

    – TinyG handles 6 axes; X, Y, Z, A, B, C. The 0.9x versions allow mapping motors to axes to support common (and uncommon) machine configurations, e.g. XYZA, XYZC, XZC, and dual gantry machines like the lumenlabs (XYYZ). While the board supports 4 motors, the firmware design allows multiple boards to be slaved together for more than 4 axis control. Displays should take these mappings and all 6 axes into account. A common XYZA like you have is a good starting point.

    – As of 0.92 the firmware can return a running status report. I typically set it to respond every 50ms when running, and at the end of each gcode block. This is designed to update the display. It returns a line in JSON format like below. Units are in prevailing mode. In the example mm=1, so units are in mm and mm/min. If ABC axes were used it would also return an “abc”: tuple, returning in degrees.

    tinyg[mm] ok> g0 x10
    tinyg[mm] ok> {“ln”:204, “xyz”:[0.017,0.000,0.000], “vel”:28.88, “mm”:1}
    {“ln”:204, “xyz”:[0.136,0.000,0.000], “vel”:121.68, “mm”:1}
    {“ln”:204, “xyz”:[0.648,0.000,0.000], “vel”:537.52, “mm”:1}
    {“ln”:204, “xyz”:[1.745,0.000,0.000], “vel”:796.72, “mm”:1}
    {“ln”:204, “xyz”:[3.200,0.000,0.000], “vel”:991.92, “mm”:1}
    {“ln”:204, “xyz”:[4.486,0.000,0.000], “vel”:800.00, “mm”:1}
    {“ln”:204, “xyz”:[5.771,0.000,0.000], “vel”:800.00, “mm”:1}
    {“ln”:204, “xyz”:[7.056,0.000,0.000], “vel”:798.56, “mm”:1}
    {“ln”:204, “xyz”:[8.277,0.000,0.000], “vel”:715.36, “mm”:1}
    {“ln”:204, “xyz”:[9.253,0.000,0.000], “vel”:504.16, “mm”:1}
    {“ln”:204, “xyz”:[9.801,0.000,0.000], “vel”:219.04, “mm”:1}
    {“ln”:204, “xyz”:[9.983,0.000,0.000], “vel”:46.24, “mm”:1}
    {“ln”:204, “xyz”:[10.000,0.000,0.000], “vel”: 0.16, “mm”:1}

    – Some comments on the buttons, and some naming conventions from Smid:
    If “Stop” is a command to pause program execution it’s CNC name is “Feedhold”. Not very intuitive, but accurate.
    “Resume” is “Cycle Start”. This starts the program as well as resumes after feedholds. Perhaps this is also the Start Process button
    TinyG currently does not do flood. We can add this in if people need it.
    Not sure what Set Outputs and Read inputs does
    You will want a Zero button to set the current position to 0,0,0

    – General items

    We are maintaining close contact with the grbl project and want any GUI we do to be able to work with both grbl and TinyG. This involves some compatibility measures that are too lengthy to go into here.

    What language / framework are you using or planning and what are you cross-platform goals? We are aiming for full cross-platfom support. many current GUIs suffer from very difficult installations due to this. Serial libs are different, UI is different, etc. This also deserves further discussion.

    Thanks for the work on this. Looks great.

    – Alden

    #1483
    saci
    Member

    Thanks for all the suggestions and comments. This has given me greater clarity. also I find the doccuments very helpful and I will study it carfully.

    I would like to know if there is a spécial character used to call cm_async_stop() and cm_async_star() routine in canonical_machine.c ? I use the “!” character to stop motion during manual control but this will reset automaticaly all position counters (x, y, z…) because it call the same ISR used for limit switches. Is it possible to save this values before calling mp_async_end() and restore them after ? this will be very usefull.
    Also I found a small problem with homing axis, when I send the G28 or G30 code, the controller don’t respond no move on axis no respond to other gcode or command other than a software reset “!” until performing a hard reset. the same problem when enabling on-power homing ( in this case I can’t do anything, erasing eeprom with the AVR programmer is necessary ! ) do you have any idea on what can cause this problem ? ( I use the atxmega256a3 whith TinyG v0.92 firmware )
    thanks.

    #1484
    alden
    Member

    Saci, I saw your post and I’m going to write a longer response later. Got to get to work now.

    #1485
    alden
    Member

    Saci, Please refer to the following section on the developers wiki. (sorry if this wraps)
    http://www.synthetos.com/wiki/index.php?title=Projects:TinyG-Developer-Info:#Starting.2C_Stopping.2C_Feedhold_and_Rate_Overrides_-_Design_Notes

    This is the spec I am working from to implement stops, starts, feedholds, etc. The cm_async_stop() and start() functions are holdovers from before I had acceleration planning in place, and don’t currently work. They may be removed in favor of new implementations that work with the planner for feedhold and restart.

    The next item I have on my list is to go back through the homing cycle, at which point I will look at G28 and G30.

    #1486
    saci
    Member

    Alden, Now I better understand when you say you are trying to make things as real as possible ! I’m really impressed and I appreciate how you do things.

    I will temporarily use the “@” character to stop all axes movement, and to maintain the actual positions, I wrote a little code in the routine st_stop () in stepper.c as follows:

    void st_stop()
    {
    cli(); // disable global interrupts

    double s_vector[AXES];
    mp_get_runtime_position(s_vector); // save current positions in s_vector

    double s_vel= mp_get_runtime_velocity(); // save current velocity in s_vel

    st_init(); // stepper subsystem
    sw_init(); // limit & homing switches
    mp_init(); // motion planning subsystem
    sei(); // enable global interrupts
    gc_init(); // gcode-parser

    cm_set_feed_rate(s_vel);
    cm_set_origin_offsets(cm_set_vector(s_vector[X],s_vector[Y],s_vector[Z],s_vector[A],s_vector[B],s_vector[C]));

    }

    This allowed me to continue the development of my little GUI until implementation of the famous Starting, Stopping and Feedhold commands.
    Now I can control manually my cnc, set current position to 0 and independently set current Z position to 0.

    #1487
    alden
    Member

    Good deal. As for G28 and G30, I did remove them from the list of supported Gcode commands on the developers page, but left them active in the code. So they failed. The function isn’t even correct – as it would just start the homing cycle which is not what you want it to do. Refer to 3.5.8 in RS274NGC. G28 is pretty straightforward – just make the robot return to 0,0,0,0,0,0. It’s in machine coordinates, which is not a distinction we make yet. G30 requires a way point to be specified. I’m not sure who actually needs that, so I may leave G30 alone and disable it.

    #1488
    Riley
    Keymaster

    Saci,

    Your screen shots are not working for me?

    Also, I have been working on a xplatfom javafx 2 based gui. I choose fx as its the one stop shop for drawing, ui’s and 3d. That works across all os’es. Right now linux javafx2 support is coming soon. But it will be here soon. Either way what are you developing in? I will work on getting my gui on github soon. Perhaps we can both work on this together. Split up the work etc. I have been looking at how replicatorG is modeled and I think its a good starting place. This gui will work with grbl too BTW.

    Riley

    #1489
    saci
    Member

    Riley,

    Sorry, I’m not familiar at all with xplatfom javafx programming language, I use the C++ builder on Windows platform, I now it’s not the best choice to make cross-platform applications ( working for Linux, Mac OS X, and Windows). My goal is just have more than one GUI available for TinyG and the GRBL controllers. I need as simple as possible solution and the easiest way to make it.
    if you want I can send a copy to your personal email. it is functional with TinyG controller with 0.92 version and a limited support for the GRBL.

    #1490
    saci
    Member

    Alden,

    Enabling Status Report fonctionality causes some difficulties in handling feedback messages from the controller because it is free running . I added ( not replaced ) a little code in _gc_printsate() function in gcode_parser.c as follows:

    mp_get_runtime_position(vector);
    double velocity = mp_get_runtime_velocity();
    uint8_t distance_mode = 1;

    if (gm.inches_mode == TRUE)
    {
    vector[X] = vector[X] / MM_PER_INCH;
    vector[Y] = vector[Y] / MM_PER_INCH;
    vector[Z] = vector[Z] / MM_PER_INCH;
    velocity = velocity / MM_PER_INCH;
    distance_mode = 0;
    }

    if ((block[1] == ‘s’)||(block[1] == ‘S’))
    {

    fprintf_P(stderr,PSTR(“{“));
    fprintf_P(stderr,PSTR(“”ln”:%1.0f, “), mp_get_runtime_linenum());
    fprintf_P(stderr,PSTR(“”xyz”:[%1.3f,%1.3f,%1.3f], “), vector[X], vector[Y], vector[Z]);

    fprintf_P(stderr,PSTR(“”abc”:[%1.3f,%1.3f,%1.3f], “),vector[A], vector[B], vector[C]);

    fprintf_P(stderr,PSTR(“”vel”:%5.2f, “), velocity);
    fprintf_P(stderr,PSTR(“”mm”:%d}n”), distance_mode);
    }

    with this, I can get the status report asynchronously with the “?s” or “?S” command.
    Is it possible to implemente this code in your firmware or some thing like this ?

    Can you please give me your email address, I want send you a copy of my GUI just to give me your oppinion .
    thanks.

    #1491
    alden
    Member

    I can add a asynchronous status report to the ? section.

    #1492
    saci
    Member

    Alden,

    The GUI verify only if all lines of the gcode file are well transmitted, but it can not verify the end of the process especially when the last lines are long distance moves, the “ln” key in JSON frame of the Satus Report does not give accurate information ( or I probably misunderstood what it represents! ) so I would like to now if there’s a way to check if the buffer is empty and all commands are executed ? This is essential to know if the machine has really finished the process, or just reporting number of gcode lines still available in the buffer (not executed) . for example add a new key or a flag to the JSON frame to indicate machining status as folows:

    {“ln”:204, “xyz”:[0.000,0.000,0.000], “abc”:[0.000,0.000,0.000], “vel”:28.88, “mm”:1, “flag or other”:0}

    what you suggest about this ?

    thanks.

    #1493
    alden
    Member

    Saci,

    Good idea. I have a run state in the ? command that currently always says “running”. This state will reflect running, stop and feedholds (run, stop and hold). This state should be (a) completed, and (b) brought out to the status report. I will find a compact way to do this that doesn’t use a lot of characters.

    Alden

    #1494
    saci
    Member

    I send all my best wishes for Christmas to everyone, and hope you all have a prosperous 2012 !!! Merry Christmas & Happy New Year to all.

    saci

    #1495
    alden
    Member

    Thank you so much, and a Merry Christmas and Happy New Year to you as well. I look forward to continuing to move forward in 2012 – Alden

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