Software bug; how to get rid of initial line?

Shop Forum Makelangelo Polargraph Art Robot Software bug; how to get rid of initial line?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #27717
    DaveDurant
    Participant

    Using 7.21.0 on a Makelangelo 5.

    I’m consistently getting a bug at the end of gcode files, which I assume is just a missing \n somewhere..

    G0 Z90G0 X-300 Y300

    Also, when I use the Sandy Noble Style, there’s always a line from the center to the ring origin. If I set it to top/right, there’s an extra line from the center to top/right. If I set it to bottom/left, there’s an extra line from the center to the bottom/left. When set to center, it looks like it goes from the center to right side.

    The start of the gcode is below. I’m not seeing where this line comes from.. Any help? I’m fine with editing the gcode manually – just not sure what to change..

    ; Makelangelo 5
    ; 2019-11-26 at 11:09:28 EST
    M06 T0
    G00 F60 A300
    M117 Change to black Click to continue
    M300 S60 P250
    M226
    M117
    G90
    G01 X0 Y0
    G01 F500 Z160
    G01 F60
    G00 X227.389 Y336.024
    G00 X225.864 Y333.462
    G00 X226.563 Y333.048
    G00 X227.264 Y332.637
    G00 X227.966 Y332.228
    G00 X228.67 Y331.823
    G00 X229.376 Y331.421
    G00 X230.084 Y331.021

    #27722
    DaveDurant
    Participant

    Related, on Spiral with SpiralToCorners set, a *huge* number of G01 travel moves are generated.

    I think this is a problem in the spiral code math generating a lot of moves off the paper but I didn’t update that. Instead, I changed MakelangeloRobotSettings.java to filter out a series of G01 move commands to only send the last one to the gcode. I’m not sure this is the right place for such a thing – maybe it should go in the FW instead? – but it was easiest and fixes the problem for all styles.

    On the file I’m trying to draw, this removed about 17k lines from the gcode and changed it from 5 hours to just over 1 hour. It hasn’t finished drawing yet but is looking really good so far.

    
    	private boolean wasTravelling;
    	private String lastTravel;
    
    	private void write(Writer out, String command) throws IOException {
    		write (out, command, false);
    	}
    
    	private void write(Writer out, String command, boolean isTravel) throws IOException {
    
    		if (isTravel) {
    			wasTravelling = true;
    			lastTravel = command;
    		}
    		else if (wasTravelling) {
    			if (lastTravel != null)
    				out.write(lastTravel);
    
    			wasTravelling = false;
    			lastTravel = null;
    		}
    
    		if (!isTravel)
    			out.write(command);
    	}
    

    edit: wait.. that last if can’t be write.. ?

    That plus changing all the lines that say “out.write(” to be “write(out,” and writeMoveTo to include isUp.

    • This reply was modified 4 years, 4 months ago by DaveDurant.
    #27724
    DaveDurant
    Participant

    Arg.. Won’t let me edit..

    That last line of code should be..

    		if (!wasTravelling)
    			out.write(command);
    

    It seems to be working fine without that but this is the correct way.

    • This reply was modified 4 years, 4 months ago by DaveDurant.
    #27733
    Dan
    Keymaster

    What version are you running, please?

    I’m looking in ImageManipulator and I see there is a Turtle (which remembers is pen up or down) and basically the same thing is being done – if there are a lot of moves while the pen is up they are ignored and only the last move before pen down is written to the file. Maybe I added that after your post? If that’s the case I apologize, I get so confused these days…

    As an aside, I feel that the way the program evolved has reached a local maximum. Each of the generator/converters produces gcode directly, which is then read back in for drawing/transmitting. This is not great:

    – can’t load multiple drawings at once
    – can’t scale or translate after the fact
    – have to reload drawings if you change machine settings
    – hard to export drawings for other apps
    – slow to render
    – can’t combine effects (filters) to do fancy new stuff.
    – can’t easily clip drawings to remove those travel moves/simplify.
    – can’t accurately estimate the time to draw for any given machine type.

    The Turtle system is one step towards generating an internal buffer of vectors that can manipulated to achieve all the above goals.

    #27734
    DaveDurant
    Participant

    It’s 7.21.0, which I think I got in September or so. I do see Turtle in the code but not in ImageManipulator.

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