Can I add slicing engine?
drmike last edited by unlimitedbacon
I'm using a RoBo 3D+ with MatterControl under Ubuntu 14.04. My object is very complex - MatterSlice can process it, but Slic3er errors out (and the standalone version crashes). The Cura engine slices just fine (well, it looks ok on the screen) but I'd like to have the MatterControl preheat and jog commands available. Is there a way to use the Cura slicing engine in MatterControl?
If not, is there a way to load G codes that some other engine creates for motion into MatterControl so I can have MatterControl execute the commands?
Thanks for any hints or observations.
I found I can export G code from Cura and load it directly into MC. Cura says there are 21 layers, MC says there are 23. The first layer is blank - and this seems consistent with what Cura does because it does not lay down the first layer as a smooshed version of all other layers the same way MC does. So what constitutes a layer? I would think a G1 Z would be obvious, there there only 21 of those, yet MC sees 23 layers.
So I think I have an answer to my question as to "can I load Cura code into MC" - it looks like the answer is yes. But now I want to get rid of the first blank layer - what IS a layer?
unlimitedbacon last edited by
There is information on the wiki about getting CuraEngine to work through MatterControl on linux.
As for the layering issue, could you post the gcode file so we can see what is going on?
drmike last edited by drmike
Thanks for the reply!
To execute the command
ln -s /usr/share/cura/CuraEngine /usr/lib/mattercontrol/CuraEngine.exe
I first had to do
sudo mkdir /usr/lib/mattercontrol
and then it worked. However, MC does not see that as an engine choice.
The G code from Cura is long, but it starts like this:
M190 S60.000000 M109 S238.000000 G28 X0 Y0 Z0 G92 E0 ; M565 Z-.5 ; G1 Z0.1 F5000 ; G0 X0 Y0 ; G29 ; ;Layer count: 21 ;LAYER:0 M106 S255 G0 F9000 X52.204 Y44.522 Z0.300 G0 X51.909 Y45.238 ;TYPE:SKIRT G1 F840 X52.204 Y44.522 E0.11590 G1 X54.461 Y42.265 E0.59363 G1 X56.698 Y41.339 E0.95600 G1 X57.411 Y41.045 E1.07143 G1 X60.594 Y41.045 E1.54783 G1 X60.987 Y41.208 E1.61151 G1 X60.987 Y38.804 E1.97132 G1 X61.905 Y36.588 E2.33032 G1 X62.204 Y35.862 E2.44784 G1 X63.902 Y34.163 E2.80735 G1 X64.462 Y33.603 E2.92589 G1 X66.055 Y32.945 E3.18385
The next layer starts some 4400 lines later:
G1 X111.848 Y49.057 E1145.81086 G1 X110.151 Y49.057 E1145.93786 G1 X108.454 Y49.057 E1146.06485 G1 X106.757 Y49.057 E1146.19185 G1 X105.060 Y49.057 E1146.31885 G1 X103.912 Y48.757 E1146.49644 ;LAYER:1 G0 F9000 X103.988 Y50.902 Z0.700 ;TYPE:WALL-INNER G1 F840 X103.972 Y50.940 E1146.50055 G1 X102.312 Y50.250 E1146.67993 G1 X101.980 Y51.048 E1146.76617 G1 X100.991 Y52.036 E1146.90566 G1 X99.600 Y52.612 E1147.05588
Cura thinks there are 21 layers, MC thinks there are 23. If I can get rid of the "problem layer" I bet MC can execute this perfectly fine. And if I can get MC to use the Cura engine, then life is really good!
I seem to have failed to do something correctly because MC does not see the CuraEngine.exe. Maybe I have a wrong version?
If the Cura engine still creates the blank layer inside the MC UI, then I have a more fundamental problem with Cura. Looking at the G code, I don't see what it might be.
Thanks for helping!
Edit: fix spelling
I found the problem with CuraEngine - the wiki says /usr/lib/mattercontrol, but my actual directory is /usr/lib/MatterControl. I deleted mattercontrol, made the sym link to MatterControl, and MC is now happy. Off to play and see what it does!
drmike last edited by drmike
Zowie!!! MC using CuraEngine generates 1577 layers with the same settings as before!! All these layers are just small sections of the whole.
I did not want to write my own G code generator, but it might be easier. I had to write a program to generate all the shapes for BRLCAD so it could place everything in exactly the right spot. It is clearly a very complex shape, and brute forcing it might be a reasonable thing to do.
Even if I did that, I still need to know what a "layer" is. The MC slicer puts down a perfect first layer in terms of height, but it chops up the shape into too many perimeters and misses the solid sections (BRLCAD is a solids method, so surfaces cross in a union). Cura seems to find the perimeters but does not know where the platform is. Cura in MC is, well, insane.
So - what does MC think a layer is? As long as I can keep it happy, I can make the printer do what I want.
unlimitedbacon last edited by
Trust what the code says. MatterControl's layer view is a little weird.
MatterSlice adds comments to the gcode designating every layer, like this:
The Layer View uses these comments to determine what each layer is. Other slice engines do not add these comments to the gcode, so instead the layer view takes a more naive approach. It recognizes every change in the Z coordinate as a different layer. This approach falls apart under certain circumstances. For instance, if you have Z Lift enabled, the Z axis will move up and down every time there is a retraction. This causes the layer view to recognize these areas as separate layers, even though that is not actually the case.
With Slic3r, you can get it to add the same comments that MatterSlice does by putting the following line in the custom Layer Change G-Code (Settings > Printer > Custom G-Code > Layer Change G-Code).
With CuraEngine, there is no such option. You will simply have to live with the fact that the Layer View is not representing things accurately, and trust that the gcode will do the right thing. You can also use another program to visualize the gcode, like gcode.ws.
That makes sense. So every time it moves to a new place, it changes z, and that is counted as a "new layer" when the reality is the layer comment is right.
So here is the blank layer:
G1 Z0.500 G0 F9000 X68.609 Y46.335 Z0.300
Two z moves with no extrusion. This might actually work ok, I just didn't trust the display. That is climbing the learning curve
Thanks for your help! I may still want to create my own G code eventually, but if I can get this to work without that level of insanity my wife will probably see me more often...
Keeping the wife happy: one of the best investments to your 3D printing future that you could make.
Bottom line: Slic3r fails completely, MCslice works but has problems where solids cross, CuraEngine works but fails to connect some cross bars. Since I can load G code directly I will probably end up creating my own.
What makes this shape so difficult is the number of interior walls. It is essentially 60 rings held together with bars. Each ring has an interior, and all the cross bars connecting the rings create interiors. Where the bars cross each other the slicing engine has to decide what is inside and what is outside - MCslice calls the solid in between crossed bars "outside" because the surfaces cross there. So it does not print there. CuraEngine does it half the time, and the other half it simply ignores the bar altogether. It gives rows of bars and rings disconnected so the full shape is not one piece.
I've learned a lot, and I like the fact I'm pushing this technology to its limits. I know it can do what I want. It's just going to take a while. Especially since keeping the wife happy is a major factor!