1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Anyone use G2/G3 on RoBo?

Discussion in 'Software' started by Drmike, Apr 3, 2016.

  1. Drmike

    Drmike Member

    Joined:
    Feb 9, 2016
    Messages:
    48
    Likes Received:
    11
    I ran into trouble with my stl to gcode conversion so I decided to create my own gcode generator since my shape is essentially mathematical. After a lot of debugging, I finally got the gcode to look right using http://www.chilipeppr.com/tinyg. But when I feed it into the RoBo3D, it does not behave properly. I've noticed two things about stl generated gcode files: 1) they always use absolute mode, and 2) they never use G2 or G3.

    At this point I'm ready to dig into the Marlin code and figure out what is going wrong. To do a circle, I use the following:
    Code:
    G91
    G0 Z0.5 F2000
    G90
    G0 X64.300  Y41.000
    G91
    G0 Z-0.5 F720
    G2 X5.400  Y0.000  I2.7 J0 E0.665  
    G2 X-5.400  Y0.000  I-2.7 J0 E0.665  
    G1 X-.4 E0.031  
    G2 X6.200  Y0.000  I3.1 J0 E0.764  
    G2 X-6.200  Y0.000  I-3.1 J0 E0.764  
    
    This is supposed to move up and over to the edge of the circle in absolute mode, switches to relative mode and drops down, then does 2 halves of a circle, moves out one line width and draws 2 more halves of a circle.

    What the RoBo does instead, is go to the edge of the circle, do the top half and most of the bottom, then goes to the origin and does the bottom half, returns to the edge of circle, does the second top half (more than half way around) and goes back to the origin to finish the bottom half.

    I am going to dig into the Marlin code to see if I can figure out why this is happening, I'm just curious if anyone has seen this before in case there is something obviously wrong with the above. When I view it on ChiliPeppr it shows the paths as I expect them. So I think the gcode is correct, but the RoBo isn't doing what the gcode says - it has a different view of how to execute the commands.

    Any ideas or pointers? I expect there is a reason nobody uses G2/G3 and maybe it is time to just fix it!
    Dr. mike
     
  2. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,526
    Not a Robo issue, to use ARC I believe you need to have either a SCARA or Delta printer. I am not sure it is supported on Cartesian printers. I am not 100% on the requirement.
     
  3. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,526
    Thanks for clearing that up, Arc uses a lot of math to compute and I think we are very limited here with the Arduino. You really need to move away from Marlin and 8-bit controllers if you have any chance to support these types of functions.

    Smoothie supports ARC commands with a bunch of caveats, their stance is that this is mainly a slicer problem as most slicers do not produce 100% compliant gcode, of course both Smoothie and Marlin aren't 100% gcode compliant either. There was something on their GIT repository about modal and non-modal G2/G3 commands, I couldn't understand the whole discussion beside which it was tl;dr.
     
  4. Mike Kelly

    Mike Kelly Volunteer

    Joined:
    Mar 11, 2013
    Messages:
    6,967
    Likes Received:
    2,275
    I deleted my post because I wasn't confident in my answer. As I understand it Marlin does not support Arc's but the wiki indicates other, with a note: 1

    1 Marlin does not support Arcs for Delta or SCARA printers.

    Which confused me.

    I agree it's most likely a processing limitation, but as I understand it arcs are not intrinsically limited to non-cartesian style printing.
     
  5. Drmike

    Drmike Member

    Joined:
    Feb 9, 2016
    Messages:
    48
    Likes Received:
    11
    Thanks for responding! Like you, I am confused by that answer. Here is what it says in the Marlin_main.cpp:
    Code:
    //Implemented Codes
    //-------------------
    // G0  -> G1
    // G1  - Coordinated Movement X Y Z E
    // G2  - CW ARC
    // G3  - CCW ARC
    // G4  - Dwell S<seconds> or P<milliseconds>
    // G10 - retract filament according to settings of M207
    // G11 - retract recover filament according to settings of M208
    // G28 - Home all Axis
    // G29 - Detailed Z-Probe, probes the bed at 3 or more points.  Will fail if you haven't homed yet.
    // G30 - Single Z Probe, probes bed at current XY location.
    // G90 - Use Absolute Coordinates
    // G91 - Use Relative Coordinates
    // G92 - Set current position to coordinates given
    
    Both absolute and relative modes are supported as are ARC commands. The actual arcs drawn are really smooth, exactly what I want actually. The problem is the sequence is screwed up. It may be something to do with the absolute to relative switching and back so often. The reason I did that was to make my math computations simple - every circle is just relative to itself once you get there, so one subroutine can do all 60 circles without knowing where it is.

    But the code says it is supposed to work, so I'm off on another adventure to figure out what the hell is going on.

    This is one hell of a fun time sink. Making this do exactly what I want will be awesome. Eventually :)
    Dr. mike
     
  6. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,526
    @Drmike can you try your code on 1.1.0 RC5, the bug report you posted for Marlin is based on Robo's version of 1.0.0, so likely they will only give it a cursory look. Obviously if you could do it against the RCBugFix code it would be better. I don't think you will find the results any different but at least then you will be using currently developing code rather than something the dev team would love to deprecate.

    Whatever fix might be necessary would likely not be back ported to Marlin 1.0.0 so if new code is necessary you will likely be forced to move to 1.1.0 anyway.

    You can use whatever appropriate configuration files archive I posted in the 1.1.0 thread.

    Don't expect that Robo will jump on 1.1.0 anytime soon, I don't think they have anyone working on or even looking at Marlin firmware at the current time.
     
  7. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,246
    Likes Received:
    7,011
    I agree. Since we have no clue what is even going on (eventually) the R2 and its ilk it is hard to say if they ever will update.
     
  8. Drmike

    Drmike Member

    Joined:
    Feb 9, 2016
    Messages:
    48
    Likes Received:
    11
    It is certainly worth a try! My bet is it won't make a difference since most slicers do not generate G2/G3 codes so nobody has noticed. But looking at what this thing is capable of, I would think it is worth while having bragging rights. Too much work and too little time :)
     
  9. Drmike

    Drmike Member

    Joined:
    Feb 9, 2016
    Messages:
    48
    Likes Received:
    11
    Waldo: I get a "failed" message attempting to unpack the rar files. Can you pack them with zip or bz2 so I can try again with a different method?
    Otherwise I'll just do the same thing you did and diff those files. Thanks!
     
  10. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,526
    I just pulled them all and they work on Windows 10 with WinRAR. What extractor are you using?

    Tell me which set of files do you need and I can ZIP them for you instead.

    Ugh, you're on Linux, there is a RAR uncompress client called unrar from RARLabs in various packages, current version 5.30. There is also Gna! unrar that is a wrapper around unrarlib. If you need a GUI File Roller for GNOME and Ark for KDE are front ends for Gna! unrar.

    The UGH comment above is not shade on Linux, I use it for certain tools also, just exasperation at one more thing that shows why Linux will never be more than a second rate citizen in the consumer OS segment. And it won't make any significant impact that Microsoft and Canonical are building in BASH into Windows 10.
     
    #10 WheresWaldo, Apr 4, 2016
    Last edited: Apr 4, 2016
  11. Drmike

    Drmike Member

    Joined:
    Feb 9, 2016
    Messages:
    48
    Likes Received:
    11
    Yeah, I use Ubuntu. I think the MESH version of the R1+ is the right one.

    I have a long hate relationship with Microsoft. And Intel. But it is from over 40 years of experience, and one has to accept that change happens. I have a lot fewer problems than my wife, so I have to learn Microsoft just to ensure her computer works :)

    I just tried the gna version. It also failed. Files are files - but I guess \n vs \r screws things up.
     
    #11 Drmike, Apr 4, 2016
    Last edited: Apr 4, 2016
  12. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,526
    Here you go:

    Just so you know, you can "apt-get install unrar" from ubuntu
     

    Attached Files:

  13. Drmike

    Drmike Member

    Joined:
    Feb 9, 2016
    Messages:
    48
    Likes Received:
    11
    Awesome thanks!

    I did that, and then I removed it, and then I downloaded the gna and tried that separately. I also used the software center version. They all failed.

    Edit: I had to grab the U8glib, but it compiled just fine. Now I have to haul it home and download it to the Robo and see what happens. Hope to have a report this evening. It will be very interesting to see if there are differences in G2/G3.
     
    #13 Drmike, Apr 4, 2016
    Last edited: Apr 4, 2016
  14. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,526
    No prob, I attached the ZIP here, winRAR works under WINE, just in case you wanted to know.
    Don't try to mess with RCBugFix, those bastards added more configuration options since merging into RC5. It is apparent they do not respect the meaning of 'code freeze!' I would just test vs RC5 unless you want to add the few lines now missing in Configuration.h yourself.
     
  15. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,246
    Likes Received:
    7,011
    RC should at a minimum be a feature freeze.
    :)

    Not for those folks.
     
  16. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,526
    This is what happens when programmers think they can be Program Managers at the same time.
     
    Drmike and mark tomlinson like this.
  17. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,246
    Likes Received:
    7,011
    That... is so true.
     
  18. Drmike

    Drmike Member

    Joined:
    Feb 9, 2016
    Messages:
    48
    Likes Received:
    11
    So this is interesting. I uploaded Waldo's mods to my Robo, and I sent commands using minicom. The G2 codes were executed perfectly. Then I loaded MatterControl, and sent my full file. G29 was not executed (no bed leveling) and the G2 codes continued to return to zero! So I think I'll revert back to the original version so I have bed levelling, and I'll write my own gcode sender. Basically I just have to look for "ok" before I send the next code. It looks like the Marlin code is doing what it is told, and it is being told to return to origin by MatterControl.

    Like I said, this is an adventure!
    Dr. mike
     
  19. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,526
    You used MESH, there is no auto bed leveling. Those were the files you asked for. If you want it to use bed leveling then you need the other set of files.

    Besides I can guarantee any new code will not be back ported to Marlin 1.0.0 which is what every Robo firmware is based on. If there is a problem and the Marlin devs find it and fix it it will be in the new code. If you don't test against the latest code base then you really can't expect the devs to use their time to find and fix any issues. That is why I suggested you try your code against the latest Marlin. If it is already fixed then you can save them a lot of effort.

    Try using some other host to send your gcode files, like Pronterface or Repetier-Host or even set up Octoprint on Ubuntu and have it send the gcode file. There is simply no telling what MatterControl does with your file. Repetier and Octoprint do not interpret anything they just send it as a stream of commands with some flow control build in.
     

    Attached Files:

    #19 WheresWaldo, Apr 4, 2016
    Last edited: Apr 5, 2016
  20. Drmike

    Drmike Member

    Joined:
    Feb 9, 2016
    Messages:
    48
    Likes Received:
    11
    OK. I did not realize which version did what. The upgraded version seems like a better choice since more bugs that I have not yet run into are probably fixed. I will give that a try.

    One of the guys I work with got a printer from a company that went out of business and he said lots of people are using Octoprint to run it. Since that is native to Ubuntu I will start there. Although, it would be fun to write my own driver, I guess I do want to see the printer make my object already!

    I closed the ticket on Marlin - the Robo does what the gcode says if you just send the gcode as I wrote it. No trouble found on the Marlin code.

    I will report back on what happens with different combinations when I get a chance. Thanks for the files!!!
    Dr. mike
     

Share This Page