{"action":"created","issue":{"url":"https://api.github.com/repos/grbl/grbl/issues/663","labels_url":"https://api.github.com/repos/grbl/grbl/issues/663/labels{/name}","comments_url":"https://api.github.com/repos/grbl/grbl/issues/663/comments","events_url":"https://api.github.com/repos/grbl/grbl/issues/663/events","html_url":"https://github.com/grbl/grbl/issues/663","id":69766230,"number":663,"title":"My visual basic controller and a grbl vs LinuxCNC head to head","user":{"login":"109JB","id":10978476,"avatar_url":"https://avatars.githubusercontent.com/u/10978476?v=3","gravatar_id":"","url":"https://api.github.com/users/109JB","html_url":"https://github.com/109JB","followers_url":"https://api.github.com/users/109JB/followers","following_url":"https://api.github.com/users/109JB/following{/other_user}","gists_url":"https://api.github.com/users/109JB/gists{/gist_id}","starred_url":"https://api.github.com/users/109JB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/109JB/subscriptions","organizations_url":"https://api.github.com/users/109JB/orgs","repos_url":"https://api.github.com/users/109JB/repos","events_url":"https://api.github.com/users/109JB/events{/privacy}","received_events_url":"https://api.github.com/users/109JB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-04-21T07:25:04Z","updated_at":"2015-09-30T18:56:16Z","closed_at":null,"body":"I've been working on my GUI in my spare time and thought I would give an update on it. It is to the point where it has just about all of the major components I wanted implemented. It is nothing special, but I needed one that would run in Windows 98 on an ancient laptop I want to use in the shop. I am not a programmer, but can do an OK hack job. Right now the GUI is all there and has the following features I wanted.\r\n\r\n![gui](https://cloud.githubusercontent.com/assets/10978476/7246649/e395be02-e7c5-11e4-861e-ace603718214.jpg)\r\n\r\n1. All major funcionality on a single page without tabs, other windows, etc.\r\n2. Small window since the computer I plan to use is an 800x600 display. I made the gui 640x480 but it can be maximized to expose more of the code panel\r\n3. Pseudo-jog buttons for each axis with pull-down increments\r\n4. Easy access to G54-G59 work coordinate systems\r\n5. Easy zeroing of each axis on each work coordinate system. On mine you just click the DRO for the axis to zero saving the room a button would take up\r\n6. Persistent settings for many things so they don't have to be set up each time\r\n7. Status line for things like coord system, Grbl run state, units, spndle state, coolant state, and tool #\r\n8. A Grbl settings interface\r\n9. A Com Port settings interface (Not on main page to save room)\r\n10. single step mode\r\n11. Start run from mid-program\r\n12. common buttons for reset, feed hold, resume, homing, etc.\r\n13. a Clock (might as well, and will also implement a cycle timer later)\r\n14. a built-in serial monitor that can run at the same time as the gui in a separate window (Doesn't have to be on for the GUI to operate.\r\n15. MDI Input on the main page\r\n16. support for ALL grbl responses\r\n\r\nAll of the above is done and here are some of the future enhancements\r\n1. cycle timer\r\n2. link to open current file in a G-code editor (Notepad++)\r\n3. Machining calculator (separate window)\r\n4. Canned cycle support (pretty close on this. Hopefully within a week)\r\n5. Manual tool change and tool table support (Similar to how LinuxCNC implements it)\r\n6. Some other stuff I either forgot or haven't thought of yet.\r\n\r\nAs for how well it works. It does very well. I have a video of it up on Youtube at the following link. Not the prettiest, but does well. I have been testing it with everything from 10 line programs to 10,000 line programs. The video shows my mill running on grbl with my gui, doing the roadrunner program at 120 inches per minute. There is also an identical run by linuxCNC running the same program at the same programmed feedrate. The results are very interesting.\r\n\r\nProgram: Roadrunner CNC G-code program\r\nProgram lines: 4,471 lines long\r\nprogram feed rate 120 IPM\r\nRapid feed rate 150IPM on GRBL, 180 IPM on LinuxCNC\r\nCycle time with my GUI/GRBL - 3 minutes, 20 seconds\r\nCycle time with LinuxCNC - 5 minutes 35 seconds\r\n\r\nDuring the runs I noticed that LinuxCNC has a much more pronounced deceleration between programmed moves compared to GRBL. My version of LinuxCNC is a few years old, and I know that there is a new trajectory planner for LinuxCNC, so the differenc gap would likely close up but it is still impressive what GRBL was able to do. I have checked both extensively with regard to lost steps, and neither loses steps with the setup as i have it now. \r\n\r\nIncidentally, I also compared the run of my GUI against GRBL Panel and Universal G-code sender. In both cases, I am about 5% slower than either of them, but I haven't built my project yet and am still running in debug mode. Hopefully it will be a bit faster after building it.\r\n\r\nI am interfacing with the machine using an Arduino NANO through my standard parallel port breakout board. here is that interface\r\n\r\n![img_0408](https://cloud.githubusercontent.com/assets/10978476/7246695/555b197e-e7c6-11e4-9356-cdb19a024272.JPG)\r\n![img_0409](https://cloud.githubusercontent.com/assets/10978476/7246696/5780edbe-e7c6-11e4-982a-ddcf0afe4f93.JPG)\r\n\r\n\r\nHere is the link to the video of the GUI along with the GRBL and LinuxCNC head to head runs.\r\nhttp://youtu.be/c1mxS7WI-tg"},"comment":{"url":"https://api.github.com/repos/grbl/grbl/issues/comments/144506649","html_url":"https://github.com/grbl/grbl/issues/663#issuecomment-144506649","issue_url":"https://api.github.com/repos/grbl/grbl/issues/663","id":144506649,"user":{"login":"109JB","id":10978476,"avatar_url":"https://avatars.githubusercontent.com/u/10978476?v=3","gravatar_id":"","url":"https://api.github.com/users/109JB","html_url":"https://github.com/109JB","followers_url":"https://api.github.com/users/109JB/followers","following_url":"https://api.github.com/users/109JB/following{/other_user}","gists_url":"https://api.github.com/users/109JB/gists{/gist_id}","starred_url":"https://api.github.com/users/109JB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/109JB/subscriptions","organizations_url":"https://api.github.com/users/109JB/orgs","repos_url":"https://api.github.com/users/109JB/repos","events_url":"https://api.github.com/users/109JB/events{/privacy}","received_events_url":"https://api.github.com/users/109JB/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T18:56:16Z","updated_at":"2015-09-30T18:56:16Z","body":"Just an update of where my GUI is at right now.  I have not had a whole lot of time to work on it due to work and family stuff, but have carved out some time recently.  I am seeing light at the end of the tunnel for the initial phase of the program. A lot of the stuff for the initial phase is to set it up for the next phases.\r\n\r\nHere is what the GUI looks like right now and I think I have finalized on the look.\r\n![new grbl ui](https://cloud.githubusercontent.com/assets/10978476/10201496/fb6806f8-6771-11e5-851d-741f910993fb.png)\r\n\r\nDescription of main window features:\r\n\r\n![new grbl ui 3](https://cloud.githubusercontent.com/assets/10978476/10202228/8a490554-6775-11e5-9b45-95a84359efe6.png)\r\n\r\nThe top 2 menu lines are pretty self explanatory with:\r\nFile - open or save G-code file\r\nConnect - to GRBL\r\nSettings - for GRBL settings, User setting, port settings\r\nEdit tool table - brings up a tool table for tool changes (explained later)\r\nChar Count - this is a temporary button for character counting streaming that will go away\r\n\r\nThe second line has common GRBL command buttons, along with 5 user definable buttons (Macros)\r\n\r\n![new grbl ui 4](https://cloud.githubusercontent.com/assets/10978476/10202252/9ec56d1a-6775-11e5-8ddb-86a8f569f2f7.png)\r\n\r\nThe DRO panel has work and machine coordinates. To zero an axis, you click on the axis numbers and a window comes up where you can set the desired coordinate for the present location. For example, if using an edge finder, you may want to enter -0.100\" rather than entering 0. The default is 0.000.\r\n\r\n![new grbl ui 5](https://cloud.githubusercontent.com/assets/10978476/10202260/a6fe564a-6775-11e5-94a9-6cf9aa8dbe11.png)\r\n\r\n\r\nThe jog button panel has buttons for each axis along with a button to select incremental or continuous jogging. Right now only incremental works. Once GRBL V1.0 is released with continuous jog this will be fixed. The pull down box has graduated values for jogging, but you can type in that box  for whatever jog increment you want.\r\n\r\n![new grbl ui 6](https://cloud.githubusercontent.com/assets/10978476/10202265/acab994a-6775-11e5-94e1-727b6c66cb29.png)\r\n\r\nThe lower left controls are for spindle and coolant. Pretty self explanatory.\r\n\r\n![new grbl ui 8](https://cloud.githubusercontent.com/assets/10978476/10202282/cd1e8e76-6775-11e5-94c3-1bf077342c7f.png)\r\n\r\nOn the right side of the main window is a tabbed box. One tab is for MDI input and Serial port monitoring. The upper MDI Input panel works very much like the MDI in LinuxCNC. The single line box is the current MDI entry box where you type and the upper box shows the MDI history. You can use up/dn arrows or click in the history box to get previous lines into the current MDI entry box.\r\n\r\nThe lower serial monitor shows what GRBL is sending back. There is a checkbox so that you can turn off the continuous stream of status reports.\r\n\r\n![new grbl ui 7](https://cloud.githubusercontent.com/assets/10978476/10202294/d53dcc2a-6775-11e5-84a6-65113736e611.png)\r\n\r\nThe G-Code File tab is where your G-code file to run is placed. There are 2 boxes. The upper is the G-code file and the bottom shows the run progress once \"run\" is selected. The G-code can be edited right inside the text box.\r\n\r\nAll of the boxes are resizeable\r\n\r\nFinally, the status strip has the current GRBL state, progress bars for the sending of the file, planner buffer state,  receive buffer state, a cycle timer, and a clock.\r\n\r\nWhat is working now:\r\nG81 - drilling cycle\r\nG82 - drilling cycle with dwell\r\nG83 - peck drilling cycle\r\nG85 - Boring cycle (feed in - feed out)\r\nG89 - Boring cycle (feed in - dwell - feed out)\r\n\r\nThe above canned cycles are fully implemented in both G90 and G91, and remember modal values, so for example, the following 2 lines of code will result in 2 drilled holes, one at x=2, y=4, and to a depth of z=-1\", and the other at x=5, y=7.\r\n\r\nG90G98G81X2Y4Z-1R0.1\r\nX5Y7\r\n\r\nTool change is working using a tool table.\r\n\r\n![tool table](https://cloud.githubusercontent.com/assets/10978476/10202622/5c1d4026-6777-11e5-8f6a-9805164b3e5a.png)\r\n\r\nYou enter the descriptions, and save the tool table. During program run, a M6T# command will pull the tool length from the table. It differs from NIST/LinuxCNC practice a bit. For example, all that this program needs is an M6T# command to both change the tool and set the offsets, whereas NIST/LinuxCNC requires a M6T# to change the tool, followed by a G43H# command to set the offsets. I have also made it so that you can store tool tables for multiple jobs (10 right now)\r\n\r\nM1 optional stop support is working.\r\n\r\nIt has been a long road to get all this working. Canned cycles requires tracking of modal values, tracking of programmed position, etc. since the line the GUI is working on may be many lines behind what GRBL is working on, and the fact that the machine may be in-motion during calculations meant that I had to track all of that within the GUI rather than being able to query GRBL.  Also the GRBL equivalent movements for a canned cycle proved somewhat tedious to get programmed correctly. Think of a G91G83 peck drilling cycle. each hole can have hundreds of linear moves and if there is an L repeat value you can easily be into the thousands of commands sent to GRBL for one canned cycle line. But it's working!!!!\r\n\r\nFuture plans, if I ever get around to it are:\r\nCutter diameter compensation (pull out the vector math!!!)\r\nWizards for pocketing and drilling\r\n\r\nI have a several minor bugs to work out and then I want to get this into the hands of a few people to do some beta testing. Don't have a timetable for that as there are a few family/work things that need to be done before I can attack those remaining minor bugs.\r\n\r\nCheers,\r\n\r\nJohn B."}}