rml containing curves runs incorrectly on Roland MDX-40A

Here's the place for discussion related to CAM/CNC and the development of the Path module.
filipp.sudanov
Posts: 4
Joined: Fri Dec 08, 2017 7:16 pm

rml containing curves runs incorrectly on Roland MDX-40A

Postby filipp.sudanov » Fri May 11, 2018 5:34 pm

I am trying to use freecad path module with rml postprocessor with Roland MDX-40. When there is no curves in generated code, it runs fine, but for program with curves instead of performing the curve Z axis goes up to the maximum and then goes back down to run the next straight piece of program.

Here is an example of freecad generated program for cutting out a square part 10x10 mm in size (cutter diameter 5mm). The cutting is on the outside, thus corners are round. This programs runs incorrectly as described above.

Code: Select all

PA;PA;
!MC1;
VS2.0;
!VZ1.0;
!MC0;
H;PA;PA;
!MC1;
VS2.0;
!VZ1.0;
PU;
PU470,470;
PU;
VS5.0;
!VZ5.0;
Z470,470,0;
Z500,0,0;
Z498,-17,0;
Z450,-86,0;
Z434,-93,0;
Z417,-98,0;
Z400,-100,0;
Z0,-100,0;
Z-64,-76,0;
Z-100,400,0;
Z-34,493,0;
Z-17,498,0;
Z0,500,0;
Z400,500,0;
Z450,486,0;
PU;
!MC0;
H;
And this is a program generated by Rolad's Dr. Engrave software - it is cutting a 20x20mm square with round corners (radius = 5mm as long as I remember).

Code: Select all

;^IN;!MC1;^PA;
!RC15000;^VS15;!VZ10;!PZ0,10500;^PU1500,3000;
!PZ0,50;^PU1500,3000;^PD1483,3000;^PD1465,2999;^PD1448,2997;^PD1430,2995;^PD1413,2992;^PD1396,2989;^PD1379,2985;^PD1362,2981;^PD1346,2975;^PD1329,2970;^PD1313,2964;^PD1297,2957;^PD1281,2949;^PD1265,2941;^PD1250,2933;^PD1235,2924;^PD1220,2914;^PD1206,2904;^PD1192,2894;^PD1179,2883;^PD1165,2872;^PD1153,2860;^PD1140,2847;^PD1128,2835;^PD1117,2821;^PD1106,2808;^PD1096,2794;^PD1086,2780;^PD1076,2765;^PD1067,2750;^PD1059,2735;^PD1051,2719;^PD1043,2703;^PD1036,2687;^PD1030,2671;^PD1025,2654;^PD1019,2638;^PD1015,2621;^PD1011,2604;^PD1008,2587;^PD1005,2570;^PD1003,2552;^PD1001,2535;^PD1000,2517;^PD1000,2500;^PD1000,1500;^PD1000,1483;^PD1001,1465;^PD1003,1448;^PD1005,1430;^PD1008,1413;^PD1011,1396;^PD1015,1379;^PD1019,1362;^PD1025,1346;^PD1030,1329;^PD1036,1313;^PD1043,1297;^PD1051,1281;^PD1059,1265;^PD1067,1250;^PD1076,1235;^PD1086,1220;^PD1096,1206;^PD1106,1192;^PD1117,1179;^PD1128,1165;^PD1140,1153;^PD1153,1140;^PD1165,1128;^PD1179,1117;^PD1192,1106;^PD1206,1096;^PD1220,1086;^PD1235,1076;^PD1250,1067;^PD1265,1059;^PD1281,1051;^PD1297,1043;^PD1313,1036;^PD1329,1030;^PD1346,1025;^PD1362,1019;^PD1379,1015;^PD1396,1011;^PD1413,1008;^PD1430,1005;^PD1448,1003;^PD1465,1001;^PD1483,1000;^PD1500,1000;^PD2500,1000;^PD2517,1000;^PD2535,1001;^PD2552,1003;^PD2570,1005;^PD2587,1008;^PD2604,1011;^PD2621,1015;^PD2638,1019;^PD2654,1025;^PD2671,1030;^PD2687,1036;^PD2703,1043;^PD2719,1051;^PD2735,1059;^PD2750,1067;^PD2765,1076;^PD2780,1086;^PD2794,1096;^PD2808,1106;^PD2821,1117;^PD2835,1128;^PD2847,1140;^PD2860,1153;^PD2872,1165;^PD2883,1179;^PD2894,1192;^PD2904,1206;^PD2914,1220;^PD2924,1235;^PD2933,1250;^PD2941,1265;^PD2949,1281;^PD2957,1297;^PD2964,1313;^PD2970,1329;^PD2975,1346;^PD2981,1362;^PD2985,1379;^PD2989,1396;^PD2992,1413;^PD2995,1430;^PD2997,1448;^PD2999,1465;^PD3000,1483;^PD3000,1500;^PD3000,2500;^PD3000,2517;^PD2999,2535;^PD2997,2552;^PD2995,2570;^PD2992,2587;^PD2989,2604;^PD2985,2621;^PD2981,2638;^PD2975,2654;^PD2970,2671;^PD2964,2687;^PD2957,2703;^PD2949,2719;^PD2941,2735;^PD2933,2750;^PD2924,2765;^PD2914,2780;^PD2904,2794;^PD2894,2808;^PD2883,2821;^PD2872,2835;^PD2860,2847;^PD2847,2860;^PD2835,2872;^PD2821,2883;^PD2808,2894;^PD2794,2904;^PD2780,2914;^PD2765,2924;^PD2750,2933;^PD2735,2941;^PD2719,2949;^PD2703,2957;^PD2687,2964;^PD2671,2970;^PD2654,2975;^PD2638,2981;^PD2621,2985;^PD2604,2989;^PD2587,2992;^PD2570,2995;^PD2552,2997;^PD2535,2999;^PD2517,3000;^PD2500,3000;^PD1500,3000;

!PZ0,10500;^PU;!MC0;



OS: Ubuntu 16.04.4 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.18.13671 (Git)
Build type: None
Branch: master
Hash: c36026358222da48a1a8ab3eec87a4a4a5166b7e
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
User avatar
sliptonic
Posts: 1570
Joined: Tue Oct 25, 2011 10:46 pm

Re: rml containing curves runs incorrectly on Roland MDX-40A

Postby sliptonic » Fri May 11, 2018 6:19 pm

Hmm,
I'm afraid I'm not much help here. I've never run one of these roland machines and the dialect is quite different from gcode. Fortunately Jon Nordby, the author of the post, linked to some helpful references in the tooltip:

FreeCAD Path post-processor to output code for the Roland Modela MDX-## machines.
The machine speaks RML-1, specified in 'Roland RML-1 Programming Guidelines'
https://itp.nyu.edu/classes/cdp-spring2 ... Manual.pdf
http://altlab.org/d/content/m/pangelo/i ... n_v100.pdf
The format has some overlap with HPGL:
https://en.wikipedia.org/wiki/HPGL
http://paulbourke.net/dataformats/hpgl/
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: rml containing curves runs incorrectly on Roland MDX-40A

Postby roivai » Tue May 22, 2018 8:03 pm

I spent a few minutes looking at this.. I don't have any experience in Roland machines or that control language. Wow, what a language. :) But I may have a clue about what is going on. Two things: First, there is no support for arc movements in the language, so the post processor tries to split them into short linear segments. This is supported by the post processor in theory. Second thing: It seems that the rml dialect has different commands for doing a planar move in XY plane, or "3D move", i.e moving Z axis or all three axes at a time. The post processor uses the "3D" command if it finds a Z parameter from the G-Code and "planar" command if there is only X and/or Y. Also, it seems that the post processor simply ignores arc commands which have Z parameter because it thinks it is a helix and does not even try to do that.

Now what is making that work wrong is that it seems that the G code generated by the Path Ops is not modal, so all commands sent to the post processor have the Z parameter and the post processor handles them all as "3D" moves and ignores all the arcs.

This is a pure assumption by just skimming through the documents and the post processor code. Now the question: Has the modality of the FreeCAD "native" G-Code changed at some point? At introduction of Path.Area maybe? To make the post processor work again, one should do the distinction between "planar" and "3D" operations based on actual Z parameter values and not simply by the existence of the Z parameter in the command. Anyone with a Roland machine willing to try? I can try to do something, but I have to do it blind as I don't have any way to verify the generated code.