System: running webcontrol on RPI 3B
Gcode Generator: Inkscape:
This is my first non ground-control cut. I’ve been driving the sled around and verifying it works before trying anything else.
So here’s the code (the comments in the parentheses are mine) :
M3 (begin)
G21 (All units in mm)
G00 Z 5.0000 (raise Z axis to travel height)
G00 X 331.3930 Y 131.5208 (move to first cut position)
G01 Z -4.0000 F 1000.0000 (Penetrate)
G02 X 333.3425 Y 131.2956 Z -4.0000 I -0.6426 J -14.1182 F 800.0000
It failed at the space and never actually cut after the plunge. I didn’t screenshot the error, so I can’t tell you exactly what it said but something about a gcode error… The router won’t retract now and I can’t tell if it is in fake servo mode. The serial port shows up, so it didn’t disconnect and the device is connected.
My Questions:
What is wrong with the Gcode?
my guess is the 1000 mm/min plunge speed is higher than recommended by the firmware, but it is a direct drive, so no chain jumping there - checked the webcontrol setting and it was maxxed at 800, but it plunged and then stopped.
How do I reset the system without doing the 12:00 reset? The system is plunged at 4 mm at X 331.3930 Y 131.5208 How do I tell it that is where it is and then unplunge and have it go home?
Looks like the problem is that the gcode doesn’t include a positioning command (G90 or G91). Webcontrol does some fancy things and ‘needs’ that to be in the gcode file to do them. In the gcode ‘standard’ is there a default value (i.e., absolute or relative) when positioning is not specified?
One of the issues with webcontrol is that a thread can crash (this time, the serial port thread) and you don’t really know since part of the program is still responsive. Maybe I need a watchdog thread that checks the status of threads so an error message can be reported.
Right, so you should be able to tack a G90 onto the front of the file and it should work. Most programs which export gcode will do that by default, often times you will see something like G90 G21 to specify the units (inches or mm) and if they are relative or absolute coordinates
Cool Thanks so much for the quick response! You guys are amazing! I added a header file in the directory where inkscape writes the gcode file and it gets put in there now. So the first question is answered (pending verification run).
The second question was: How do I get the system functional or must I reset the chain lengths?
It rebooted and showed up at the right coordinates (show sled position in webcontrol - ON).
Thanks. I think it will be fine. Inkscape lets you put a file named “header” in the gcode write directory and it will prefix your gcode with whatever is in there. I’ll hopefully get to run it a little later today, if not tomorrow morning.
So it cut, but on the second try. It went part way, failed due to
ALARM: The sled is not keeping up with its expected position and has halted. Click the ‘Stop’ button to clear the alarm. More information at: https://github.com/MaslowCNC/Firmware/wiki/Keeping-Up
4183.04: [Forward Calculating Position]
In a moment of insanity I started it again and it retraced the first few cuts, which was painfully slow to watch and then it fully completed.
This issue crops up mostly with maxed feedrates with the sled near the top center of the board (that’s where the motors are working the most). Try slowing the feedrate down. Also, webcontrol has the ability to start from an arbitrary point in the gcode. You just need to click through the gcode or enter the gcode index line number. Webcontrol was written so to make sure the machine is in the proper state when starting at an arbitrary point (units, positioning, spindle control) and move to the starting point at safe height. I’ve tested it a lot, but with everything I can’t guarantee success. Ground control uses a much simpler method (just starts sending gcode) and it’s up to the user to make sure everything is correct.
To disable it, I think it’s under advanced settings -> positional error limit (or something like that) increase it to a large number to effectively disable it. The default is 2 mm.
What the alarm does is tells you the sled isn’t where it should be after completing a move. After every gcode move in the file, the controller calculates it’s position based upon the motor encoders and compares it to the gcode’s end coordinates. If the difference is greater than the positional error limit, it throws an alarm.
Clarification, it’s not after every gcode move, it’s several times a second.
So when you have g-code that tells the machine to go from stopped to full speed,
and it takes time for the machine to get to full speed (in part because the PID
loop ramps up the power rather than slamming it to full power instantly, in part
because of mechanical inertia), it is very easy to trip this alarm.
Yeah, I was confusing it with something I was working on. The controller only does a check to determine if the chain length error is greater than the limit, not the position of the sled… and it does it a couple times a second (when it reports error values to webcontrol/ground control)