CNC Lathe and 4th-axis milling...

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
roerich_64
Veteran
Posts: 1465
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: CNC Lathe and 4th-axis milling...

Post by roerich_64 »

Russ4262 wrote: Wed Mar 27, 2019 10:18 pm Walter,
Good afternoon, Sir. Thanks for running tests using the modified 3d Surface Op. In response to your post,

The solution to align Model-Body and Stock001 with the original Body object is to set Z placement values of these to objects equal to that of the Body object base - in this case, 0.0 mm. Doing so will yield the second picture below. I don't know how your Model-Body and Stock001 z position values were changed. If you did not alter them, there may be a bug in the Create Path Job tool during the setup.

Hoping this helps you.
Thanks for testing.
Russell
Good morning Russel,
from the other side of our little planet ;)

Based on this picture i will show you my workflow and i think others who reading this helps it:
3D-Surface_III.jpg
3D-Surface_III.jpg (116.33 KiB) Viewed 1934 times
WCS = Work-Coordinate-System
MCS = Machine-Coordinate-System

Let us have a look to where we can found these Coordinate-Systems in Freecad:
3D-Surface_IV.jpg
3D-Surface_IV.jpg (174.39 KiB) Viewed 1934 times
3D-Surface_V.jpg
3D-Surface_V.jpg (146.99 KiB) Viewed 1934 times
When we set the WCS: Z=0 at the top of the part then the post processor generates g Code with -Z values. So the spindle steps down to engrave it.

@Sliptonic gave us a nice tool (Setup) to take the Model-body to the right place:
3D-Surface_VI.jpg
3D-Surface_VI.jpg (194.08 KiB) Viewed 1934 times
1. Click on the top of the body
2. take Z-Axis
3. take Z=0. The Model-Body flips down
4. You have to refresh the stock.

Now let us take a look what we now see:
3D-Surface_VII.jpg
3D-Surface_VII.jpg (197.3 KiB) Viewed 1934 times
This is the startpoint to generate the gcode ;)
to be continued... (not more than five attachments)
Die Liebe wird siegen, denn sie ist unzerstörbar :) ;)
User avatar
roerich_64
Veteran
Posts: 1465
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: CNC Lathe and 4th-axis milling...

Post by roerich_64 »

Now we can generate the gCode with 3D-Surface but with depth offset = 10mm:
3D-Surface_IX.jpg
3D-Surface_IX.jpg (181.88 KiB) Viewed 1930 times

The result is: the paths are to high ;)

Code: Select all

(Exported by FreeCAD)
(Post Processor: grbl_post)
(Output Time:2019-03-28 11:15:00.533000)
(begin preamble)
G21
(begin operation: T2: T2_2mm_flach)
(Path: T2: T2_2mm_flach)
(T2: T2_2mm_flach)
(begin toolchange)
M6 T1
M3 S17900.0000
(finish operation: T2: T2_2mm_flach)
(begin operation: Surface)
(Path: Surface)
(Surface)
(Beginning of layer 0)
G0 Z3.5000
G0 X0.0000 Y-0.0000
G1 Z5.1132 F800.00
G1 X0.9677 Y-0.0000 Z5.0989 F800.00
G1 X1.9355 Y-0.0000 Z5.0782 F800.00
G1 X2.9032 Y-0.0000 Z5.1221 F800.00
G1 X3.8710 Y-0.0000 Z5.0749 F800.00
G1 X4.8387 Y-0.0000 Z5.1022 F800.00
G1 X5.8065 Y-0.0000 Z5.0981 F800.00
G1 X6.7742 Y-0.0000 Z5.0790 F800.00
G1 X7.7419 Y-0.0000 Z5.1213 F800.00
G1 X8.7097 Y-0.0000 Z5.0741 F800.00
G1 X9.6774 Y-0.0000 Z5.1030 F800.00
G1 X10.6452 Y-0.0000 Z5.0973 F800.00
G1 X11.6129 Y-0.0000 Z5.0799 F800.00
G1 X12.5806 Y-0.0000 Z5.1204 F800.00
G1 X13.5484 Y-0.0000 Z5.0733 F800.00
G1 X14.5161 Y-0.0000 Z5.1038 F800.00
G1 X15.4839 Y-0.0000 Z5.0964 F800.00
G1 X16.4516 Y-0.0000 Z5.0807 F800.00
G1 X17.4194 Y-0.0000 Z5.1196 F800.00
G1 X18.3871 Y-0.0000 Z5.0725 F800.00
G1 X19.3548 Y-0.0000 Z5.1047 F800.00
G1 X20.3226 Y-0.0000 Z5.1186 F800.00
G1 X21.2903 Y-0.0000 Z5.0936 F800.00
G1 X22.2581 Y-0.0000 Z4.9065 F800.00
G1 X23.2258 Y-0.0000 Z4.5020 F800.00
G1 X24.1935 Y-0.0000 Z3.7559 F800.00
G1 X25.1613 Y-0.0000 Z2.0905 F800.00
G1 X26.1290 Y-0.0000 Z0.0000 F800.00
G1 X30.0000 Y-0.0000 Z0.0000 F800.00
G1 X30.0000 Y1.0000 Z0.0000 F800.00
G1 X27.0968 Y1.0000 Z0.0000 F800.00
G1 X26.1290 Y1.0000 Z3.8972 F800.00
G1 X25.1613 Y1.0000 Z5.0692 F800.00
G1 X24.1935 Y1.0000 Z5.7775 F800.00
G1 X23.2258 Y1.0000 Z6.2280 F800.00
G1 X22.2581 Y1.0000 Z6.5095 F800.00
G1 X21.2903 Y1.0000 Z6.6303 F800.00
G1 X20.3226 Y1.0000 Z6.6414 F800.00
G1 X19.3548 Y1.0000 Z6.6350 F800.00
G1 X18.3871 Y1.0000 Z6.6358 F800.00
G1 X17.4194 Y1.0000 Z6.6245 F800.00
G1 X16.4516 Y1.0000 Z6.6422 F800.00
G1 X15.4839 Y1.0000 Z6.6408 F800.00
G1 X14.5161 Y1.0000 Z6.6356 F800.00
G1 X13.5484 Y1.0000 Z6.6365 F800.00
G1 X12.5806 Y1.0000 Z6.6239 F800.00
G1 X11.6129 Y1.0000 Z6.6416 F800.00
G1 X10.6452 Y1.0000 Z6.6402 F800.00
G1 X9.6774 Y1.0000 Z6.6361 F800.00
G1 X8.7097 Y1.0000 Z6.6371 F800.00
G1 X7.7419 Y1.0000 Z6.6233 F800.00
G1 X6.7742 Y1.0000 Z6.6410 F800.00
G1 X5.8065 Y1.0000 Z6.6396 F800.00
G1 X4.8387 Y1.0000 Z6.6367 F800.00
G1 X3.8710 Y1.0000 Z6.6378 F800.00
G1 X2.9032 Y1.0000 Z6.6227 F800.00
G1 X1.9355 Y1.0000 Z6.6403 F800.00
G1 X0.9677 Y1.0000 Z6.6390 F800.00
G1 X0.0000 Y1.0000 Z6.6431 F800.00
G1 X0.0000 Y2.0000 Z7.7036 F800.00
G1 X0.9677 Y2.0000 Z7.6910 F800.00
G1 X1.9355 Y2.0000 Z7.6989 F800.00
G1 X2.9032 Y2.0000 Z7.6771 F800.00
G1 X3.8710 Y2.0000 Z7.6968 F800.00
G1 X4.8387 Y2.0000 Z7.6891 F800.00
G1 X5.8065 Y2.0000 Z7.6915 F800.00
G1 X6.7742 Y2.0000 Z7.6995 F800.00
G1 X7.7419 Y2.0000 Z7.6776 F800.00
G1 X8.7097 Y2.0000 Z7.6963 F800.00
G1 X9.6774 Y2.0000 Z7.6886 F800.00
G1 X10.6452 Y2.0000 Z7.6920 F800.00
G1 X11.6129 Y2.0000 Z7.7000 F800.00
G1 X12.5806 Y2.0000 Z7.6781 F800.00
G1 X13.5484 Y2.0000 Z7.6957 F800.00
G1 X14.5161 Y2.0000 Z7.6881 F800.00
G1 X15.4839 Y2.0000 Z7.6925 F800.00
G1 X16.4516 Y2.0000 Z7.7005 F800.00
G1 X17.4194 Y2.0000 Z7.6786 F800.00
G1 X18.3871 Y2.0000 Z7.6952 F800.00
G1 X19.3548 Y2.0000 Z7.6876 F800.00
G1 X20.3226 Y2.0000 Z7.6930 F800.00
G1 X21.2903 Y2.0000 Z7.6875 F800.00
G1 X22.2581 Y2.0000 Z7.5810 F800.00
G1 X23.2258 Y2.0000 Z7.3597 F800.00
G1 X24.1935 Y2.0000 Z6.9859 F800.00
G1 X25.1613 Y2.0000 Z6.4420 F800.00
G1 X26.1290 Y2.0000 Z5.6608 F800.00
G1 X27.0968 Y2.0000 Z4.4817 F800.00
G1 X28.0645 Y2.0000 Z1.8768 F800.00
G1 X29.0323 Y2.0000 Z0.0000 F800.00
G1 X30.0000 Y2.0000 Z0.0000 F800.00
G1 X30.0000 Y3.0000 Z0.0000 F800.00
G1 X29.0323 Y3.0000 Z0.0000 F800.00
G1 X28.0645 Y3.0000 Z4.5244 F800.00
G1 X27.0968 Y3.0000 Z5.8663 F800.00
G1 X26.1290 Y3.0000 Z6.7718 F800.00
G1 X25.1613 Y3.0000 Z7.4036 F800.00
G1 X24.1935 Y3.0000 Z7.8594 F800.00
G1 X23.2258 Y3.0000 Z8.1802 F800.00
G1 X22.2581 Y3.0000 Z8.3709 F800.00
G1 X21.2903 Y3.0000 Z8.4654 F800.00
G1 X20.3226 Y3.0000 Z8.4741 F800.00
G1 X19.3548 Y3.0000 Z8.4692 F800.00
G1 X18.3871 Y3.0000 Z8.4644 F800.00
G1 X17.4194 Y3.0000 Z8.4612 F800.00
G1 X16.4516 Y3.0000 Z8.4691 F800.00
G1 X15.4839 Y3.0000 Z8.4737 F800.00
G1 X14.5161 Y3.0000 Z8.4697 F800.00
G1 X13.5484 Y3.0000 Z8.4649 F800.00
G1 X12.5806 Y3.0000 Z8.4607 F800.00
G1 X11.6129 Y3.0000 Z8.4686 F800.00
G1 X10.6452 Y3.0000 Z8.4732 F800.00
G1 X9.6774 Y3.0000 Z8.4701 F800.00
G1 X8.7097 Y3.0000 Z8.4654 F800.00
G1 X7.7419 Y3.0000 Z8.4603 F800.00
G1 X6.7742 Y3.0000 Z8.4682 F800.00
G1 X5.8065 Y3.0000 Z8.4728 F800.00
G1 X4.8387 Y3.0000 Z8.4706 F800.00
G1 X3.8710 Y3.0000 Z8.4658 F800.00
G1 X2.9032 Y3.0000 Z8.4599 F800.00
G1 X1.9355 Y3.0000 Z8.4677 F800.00
G1 X0.9677 Y3.0000 Z8.4723 F800.00
G1 X0.0000 Y3.0000 Z8.4726 F800.00
G1 X0.0000 Y4.0000 Z9.0616 F800.00
G1 X0.9677 Y4.0000 Z9.0513 F800.00
G1 X1.9355 Y4.0000 Z9.0406 F800.00
G1 X2.9032 Y4.0000 Z9.0533 F800.00
G1 X3.8710 Y4.0000 Z9.0389 F800.00
G1 X4.8387 Y4.0000 Z9.0530 F800.00
G1 X5.8065 Y4.0000 Z9.0509 F800.00
G1 X6.7742 Y4.0000 Z9.0410 F800.00
G1 X7.7419 Y4.0000 Z9.0537 F800.00
G1 X8.7097 Y4.0000 Z9.0385 F800.00
G1 X9.6774 Y4.0000 Z9.0534 F800.00
G1 X10.6452 Y4.0000 Z9.0504 F800.00
G1 X11.6129 Y4.0000 Z9.0415 F800.00
G1 X12.5806 Y4.0000 Z9.0541 F800.00
G1 X13.5484 Y4.0000 Z9.0381 F800.00
G1 X14.5161 Y4.0000 Z9.0538 F800.00
G1 X15.4839 Y4.0000 Z9.0500 F800.00
G1 X16.4516 Y4.0000 Z9.0419 F800.00
G1 X17.4194 Y4.0000 Z9.0545 F800.00
G1 X18.3871 Y4.0000 Z9.0377 F800.00
G1 X19.3548 Y4.0000 Z9.0543 F800.00
G1 X20.3226 Y4.0000 Z9.0590 F800.00
G1 X21.2903 Y4.0000 Z9.0474 F800.00
G1 X22.2581 Y4.0000 Z8.9641 F800.00
G1 X23.2258 Y4.0000 Z8.7871 F800.00
G1 X24.1935 Y4.0000 Z8.5075 F800.00
G1 X25.1613 Y4.0000 Z8.1013 F800.00
G1 X26.1290 Y4.0000 Z7.5548 F800.00
G1 X27.0968 Y4.0000 Z6.7790 F800.00
G1 X28.0645 Y4.0000 Z5.7135 F800.00
G1 X29.0323 Y4.0000 Z4.0324 F800.00
G1 X30.0000 Y4.0000 Z0.0000 F800.00
G1 X30.0000 Y5.0000 Z2.6082 F800.00
G1 X29.0323 Y5.0000 Z5.1473 F800.00
G1 X28.0645 Y5.0000 Z6.4831 F800.00
G1 X27.0968 Y5.0000 Z7.4240 F800.00
G1 X26.1290 Y5.0000 Z8.1114 F800.00
G1 X25.1613 Y5.0000 Z8.6113 F800.00
G1 X24.1935 Y5.0000 Z8.9890 F800.00
G1 X23.2258 Y5.0000 Z9.2338 F800.00
G1 X22.2581 Y5.0000 Z9.4052 F800.00
G1 X21.2903 Y5.0000 Z9.4638 F800.00
G1 X20.3226 Y5.0000 Z9.4820 F800.00
G1 X19.3548 Y5.0000 Z9.4785 F800.00
G1 X18.3871 Y5.0000 Z9.4630 F800.00
G1 X17.4194 Y5.0000 Z9.4757 F800.00
G1 X16.4516 Y5.0000 Z9.4670 F800.00
G1 X15.4839 Y5.0000 Z9.4746 F800.00
G1 X14.5161 Y5.0000 Z9.4781 F800.00
G1 X13.5484 Y5.0000 Z9.4634 F800.00
G1 X12.5806 Y5.0000 Z9.4753 F800.00
G1 X11.6129 Y5.0000 Z9.4666 F800.00
G1 X10.6452 Y5.0000 Z9.4750 F800.00
G1 X9.6774 Y5.0000 Z9.4777 F800.00
G1 X8.7097 Y5.0000 Z9.4638 F800.00
G1 X7.7419 Y5.0000 Z9.4749 F800.00
G1 X6.7742 Y5.0000 Z9.4662 F800.00
G1 X5.8065 Y5.0000 Z9.4754 F800.00
G1 X4.8387 Y5.0000 Z9.4773 F800.00
G1 X3.8710 Y5.0000 Z9.4642 F800.00
G1 X2.9032 Y5.0000 Z9.4745 F800.00
G1 X1.9355 Y5.0000 Z9.4658 F800.00
G1 X0.9677 Y5.0000 Z9.4758 F800.00
G1 X0.0000 Y5.0000 Z9.4772 F800.00
G1 X0.0000 Y6.0000 Z9.7653 F800.00
G1 X0.9677 Y6.0000 Z9.7618 F800.00
G1 X1.9355 Y6.0000 Z9.7696 F800.00
G1 X2.9032 Y6.0000 Z9.7509 F800.00
G1 X3.8710 Y6.0000 Z9.7688 F800.00
G1 X4.8387 Y6.0000 Z9.7603 F800.00
G1 X5.8065 Y6.0000 Z9.7622 F800.00
G1 X6.7742 Y6.0000 Z9.7697 F800.00
G1 X7.7419 Y6.0000 Z9.7513 F800.00
G1 X8.7097 Y6.0000 Z9.7684 F800.00
G1 X9.6774 Y6.0000 Z9.7599 F800.00
G1 X10.6452 Y6.0000 Z9.7626 F800.00
G1 X11.6129 Y6.0000 Z9.7697 F800.00
G1 X12.5806 Y6.0000 Z9.7517 F800.00
G1 X13.5484 Y6.0000 Z9.7681 F800.00
G1 X14.5161 Y6.0000 Z9.7595 F800.00
G1 X15.4839 Y6.0000 Z9.7630 F800.00
G1 X16.4516 Y6.0000 Z9.7697 F800.00
G1 X17.4194 Y6.0000 Z9.7521 F800.00
G1 X18.3871 Y6.0000 Z9.7677 F800.00
G1 X19.3548 Y6.0000 Z9.7591 F800.00
G1 X20.3226 Y6.0000 Z9.7634 F800.00
G1 X21.2903 Y6.0000 Z9.7593 F800.00
G1 X22.2581 Y6.0000 Z9.7049 F800.00
G1 X23.2258 Y6.0000 Z9.5558 F800.00
G1 X24.1935 Y6.0000 Z9.3188 F800.00
G1 X25.1613 Y6.0000 Z8.9793 F800.00
G1 X26.1290 Y6.0000 Z8.5067 F800.00
G1 X27.0968 Y6.0000 Z7.8801 F800.00
G1 X28.0645 Y6.0000 Z7.0162 F800.00
G1 X29.0323 Y6.0000 Z5.8376 F800.00
G1 X30.0000 Y6.0000 Z3.9708 F800.00
G1 X30.0000 Y7.0000 Z4.6432 F800.00
G1 X29.0323 Y7.0000 Z6.2774 F800.00
G1 X28.0645 Y7.0000 Z7.3669 F800.00
G1 X27.0968 Y7.0000 Z8.1831 F800.00
G1 X26.1290 Y7.0000 Z8.7706 F800.00
G1 X25.1613 Y7.0000 Z9.2240 F800.00
G1 X24.1935 Y7.0000 Z9.5439 F800.00
G1 X23.2258 Y7.0000 Z9.7736 F800.00
G1 X22.2581 Y7.0000 Z9.8758 F800.00
G1 X21.2903 Y7.0000 Z9.9358 F800.00
G1 X20.3226 Y7.0000 Z9.9351 F800.00
G1 X19.3548 Y7.0000 Z9.9310 F800.00
G1 X18.3871 Y7.0000 Z9.9359 F800.00
G1 X17.4194 Y7.0000 Z9.9241 F800.00
G1 X16.4516 Y7.0000 Z9.9387 F800.00
G1 X15.4839 Y7.0000 Z9.9348 F800.00
G1 X14.5161 Y7.0000 Z9.9314 F800.00
G1 X13.5484 Y7.0000 Z9.9363 F800.00
G1 X12.5806 Y7.0000 Z9.9237 F800.00
G1 X11.6129 Y7.0000 Z9.9386 F800.00
G1 X10.6452 Y7.0000 Z9.9344 F800.00
G1 X9.6774 Y7.0000 Z9.9317 F800.00
G1 X8.7097 Y7.0000 Z9.9367 F800.00
G1 X7.7419 Y7.0000 Z9.9233 F800.00
G1 X6.7742 Y7.0000 Z9.9385 F800.00
G1 X5.8065 Y7.0000 Z9.9340 F800.00
G1 X4.8387 Y7.0000 Z9.9321 F800.00
G1 X3.8710 Y7.0000 Z9.9371 F800.00
G1 X2.9032 Y7.0000 Z9.9230 F800.00
G1 X1.9355 Y7.0000 Z9.9383 F800.00
G1 X0.9677 Y7.0000 Z9.9336 F800.00
G1 X0.0000 Y7.0000 Z9.9386 F800.00
G1 X0.0000 Y8.0000 Z10.0000 F800.00
G1 X0.9677 Y8.0000 Z9.9999 F800.00
G1 X5.8065 Y8.0000 Z9.9997 F800.00
G1 X6.7742 Y8.0000 Z10.0000 F800.00
G1 X7.7419 Y8.0000 Z9.9995 F800.00
G1 X9.6774 Y8.0000 Z9.9994 F800.00
G1 X10.6452 Y8.0000 Z10.0000 F800.00
G1 X11.6129 Y8.0000 Z9.9995 F800.00
G1 X12.5806 Y8.0000 Z9.9995 F800.00
G1 X13.5484 Y8.0000 Z10.0000 F800.00
G1 X14.5161 Y8.0000 Z9.9996 F800.00
G1 X19.3548 Y8.0000 Z9.9999 F800.00
G1 X20.3226 Y8.0000 Z10.0000 F800.00
G1 X21.2903 Y8.0000 Z9.9998 F800.00
G1 X22.2581 Y8.0000 Z9.9653 F800.00
G1 X23.2258 Y8.0000 Z9.8624 F800.00
G1 X24.1935 Y8.0000 Z9.6841 F800.00
G1 X25.1613 Y8.0000 Z9.3579 F800.00
G1 X26.1290 Y8.0000 Z8.9290 F800.00
G1 X27.0968 Y8.0000 Z8.3482 F800.00
G1 X28.0645 Y8.0000 Z7.5661 F800.00
G1 X29.0323 Y8.0000 Z6.5202 F800.00
G1 X30.0000 Y8.0000 Z4.9941 F800.00
G1 X30.0000 Y9.0000 Z5.1156 F800.00
G1 X29.0323 Y9.0000 Z6.6101 F800.00
G1 X28.0645 Y9.0000 Z7.6498 F800.00
G1 X27.0968 Y9.0000 Z8.4119 F800.00
G1 X26.1290 Y9.0000 Z8.9936 F800.00
G1 X25.1613 Y9.0000 Z9.4255 F800.00
G1 X24.1935 Y9.0000 Z9.7247 F800.00
G1 X23.2258 Y9.0000 Z9.9084 F800.00
G1 X22.2581 Y9.0000 Z9.9881 F800.00
G1 X21.2903 Y9.0000 Z10.0000 F800.00
G1 X21.2903 Y9.0000 Z10.0000 F800.00
G1 X22.2581 Y9.0000 Z9.9881 F800.00
G1 X23.2258 Y9.0000 Z9.9084 F800.00
G1 X24.1935 Y9.0000 Z9.7247 F800.00
G1 X25.1613 Y9.0000 Z9.4255 F800.00
G1 X26.1290 Y9.0000 Z8.9936 F800.00
G1 X27.0968 Y9.0000 Z8.4119 F800.00
G1 X28.0645 Y9.0000 Z7.6498 F800.00
G1 X29.0323 Y9.0000 Z6.6101 F800.00
G1 X30.0000 Y9.0000 Z5.1156 F800.00
(End of layer 0)
G0 Z5.5000
(finish operation: Surface)
(begin postamble)
M05 G0 Z20 G04 P03
Ok. Let us have a near look to the gCode sender bcnc:
3D-Surface_X.jpg
3D-Surface_X.jpg (593.19 KiB) Viewed 1922 times
The result is: the generated gCode is not linear ;)
OCL_Surface_Test.FCStd
(28.38 KiB) Downloaded 72 times
BR
Walter
Last edited by roerich_64 on Thu Mar 28, 2019 10:49 am, edited 2 times in total.
Die Liebe wird siegen, denn sie ist unzerstörbar :) ;)
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: CNC Lathe and 4th-axis milling...

Post by Wsk8 »

Russ4262 wrote: Tue Mar 26, 2019 3:38 pm I hear you guys. Excellent arguments, and quite valid. And considering the votes are unanimous, I have a screenshot for you of fixed step over results at each layer. I'll try to post the updated code once I clean it up and do a few more tests. I've already moved on to improvements and additional input properties( like start and stop index angles mentioned by @JoshM; so, I need to get a "usable" version to post for testing.

Cheers,
Russell

OK, finally got OCL working :)
Would you please share your current script (even if it contains errrors)? I'd like to test 4th axis.

mfg
User avatar
roerich_64
Veteran
Posts: 1465
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: CNC Lathe and 4th-axis milling...

Post by roerich_64 »

@Wsk8:

You can found the script here:
https://forum.freecadweb.org/viewtopic. ... 80#p296483
Die Liebe wird siegen, denn sie ist unzerstörbar :) ;)
User avatar
Wsk8
Posts: 182
Joined: Fri Dec 07, 2018 6:24 pm

Re: CNC Lathe and 4th-axis milling...

Post by Wsk8 »

roerich_64 wrote: Thu Mar 28, 2019 10:51 am @Wsk8:

You can found the script here:
https://forum.freecadweb.org/viewtopic. ... 80#p296483
This one seems to be outdated?


I'm taking about this:
Image

mfg
User avatar
roerich_64
Veteran
Posts: 1465
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: CNC Lathe and 4th-axis milling...

Post by roerich_64 »

Edit:

better way: https://github.com/Russ4262/FreeCAD/com ... f1b613cfc6

BTW:
Nice project: GRBL-Advanced ;)
Die Liebe wird siegen, denn sie ist unzerstörbar :) ;)
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: CNC Lathe and 4th-axis milling...

Post by quick61 »

quick61 wrote: Thu Mar 28, 2019 5:11 am
Wsk8 wrote: Thu Mar 28, 2019 12:42 am Hello,

I'd like to test your Script too, but how do i get OCL? It doesn't load on 0.18

Code: Select all

Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 11:48:23) [MSC v.1900 64 bit (AMD64)] on win32
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> import ocl
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ModuleNotFoundError: No module named 'ocl'
I get the same thing, even though i have compiled and installed opencamlib and the tools that are there now work. However when I try to use the new code from Russ4262, it crashed the Path workbench, not FreeCAD, just the workbench. In doing so I get the error message once again, no module named OCL. Kind of sucks, cause I'd like to be testing this work my self.

Mark
OK, import ocl is now working for me. Must of been something with the new release that got things going. It started working right after I installed the new 0.18 stable last night. Now on to testing. :)

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: CNC Lathe and 4th-axis milling...

Post by Russ4262 »

Evening Walter,
Thank you very much for the great explanation and set of visuals. I had no problem understanding the two issues you presented. With regard to those issues, the first is the easiest fix.
roerich_64 wrote: Thu Mar 28, 2019 10:19 am Now we can generate the gCode with 3D-Surface but with depth offset = 10mm:
The result is: the paths are to high ;)
This issue involves a pre-existing bug with the 3D Surface Op. Basically, the op initializes the Final Depth with a best guess value. This value is usually a correct value, or at least useful and a great guess. However, once the user clicks OK to run the operation, that value would get reset to zero. This just frustrates the user. I know !! Up to this point I have had to manually override that value in the Heights section of the operation's settings window or properties list. This is what you would have needed to do (setting it to -10.5mm in your example provided) instead of changing the Depth Offset to 10mm.
But, thanks to your re-iteration of there being a problem, I tackled it today - at least it appears to be corrected with my tests. I am attaching the patched version of the script you downloaded. I will include this same fix in future releases. With the fixed script


As for the second issue,
roerich_64 wrote: Thu Mar 28, 2019 10:19 am The result is: the generated gCode is not linear ;)
I have made some investigations and reached the conclusion that the problem may lie within OCL, not the operation python script we are using. I attempted diminishing the tessellation tolerance greatly, with no visible result. I also reworked the OCL scan function in the script, with no visible result. Therefore, I am thinking the NON-linear paths are not a result of the python script; I am thinking OCL. Perhaps the significant digits, the number of decimal places, the nature of the OCL scan process itself, or another issue all together like the mesh, created from the solid, that is used for the OCL scan.

I will say also, that I noticed the tool used in your test, T4: T3_0.5mm_Kugel, appears to be a very small diameter. Also, the Step Over is set to 20%. This yields a 0.1mm step for each pass. When I loaded the test file, the Sample Interval shows 1.0mm. I set it to 0.01mm to see if that removed the non-linear paths, but it did not. I DON'T think the high resolution cut you are testing is problematic. I like your test!

I used your same model, same tool, same step over, and 0.1mm sample interval. I set Drop Cutter Extra Offest to .25mm for X and Y to allow the cutter to slide further down the curve of the model. I clicked OK to run the operation. I set cut direction to Y in properties list. This yielded the expected result in the first picture - nice straight, square bottoms on the paths.
Drop Cutter Extra Offset = 0.25 x&amp;y,  Y direct cut
Drop Cutter Extra Offset = 0.25 x&y, Y direct cut
non-linear-0.25 extra (Y dir).png (268.47 KiB) Viewed 1847 times
I then set Drop Cutter Extra Offest to .20mm for X and Y to raise the cutter up on the curve of the model. I clicked OK to run the operation. This yielded the very interesting result in the second picture. It looks like a sine or cosine wave on the bottom of the paths !
Drop Cutter Extra Offset = 0.20 x&amp;y,  Y direct cut
Drop Cutter Extra Offset = 0.20 x&y, Y direct cut
non-linear-0.20 extra (Y dir).png (266.72 KiB) Viewed 1847 times
I only changed the cut direction to X in properties list with the same 0.20mm extra offset as above. This yielded the expected result in the third picture - VERY NON-linear paths at the edge of the curved surface, running parallel to it.
Drop Cutter Extra Offset = 0.20 x&amp;y,  X direct cut
Drop Cutter Extra Offset = 0.20 x&y, X direct cut
non-linear-0.20 extra (X dir).png (216.45 KiB) Viewed 1847 times
I think the problem lies in OCL or beyond the 3D Surface Op python script. I notice that the non-linear quality of the paths is worse where deflection increases.

Thanks for your help and insights, Walter. We will continue to work on this non-linear path issue. I am attaching the patched version of the 3D Surface Op to fix the Final Depth issue.

Good night, Sir.
Russell
Attachments
PathSurface_r3i-usable_r1.py
PathSurface_r3i-usable_r1 - patched for Final Depth value being lost
(79.21 KiB) Downloaded 55 times
Russ4262
Posts: 953
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: CNC Lathe and 4th-axis milling...

Post by Russ4262 »

Wsk8,
Good evening, Sir? I'm working on the next "usable" release. I have the code pretty much in a mess at the moment. :? :o . I may have some time this weekend to put it back in order. I am trying to simplify code and really improve reliability and stability. I am encouraged by your interest and willingness to help test the script. Thanks.

@roerich_64's post was useful in highlighting some major flaws. I like collaboration, but I also don't want to send out poor code, having a vision of where I am headed, only to be bombarded with great feedback and a list of problems is quite challenging for the novice and amateur that I am. Trust me, I am just as anxious as you are!
Wsk8 wrote: Thu Mar 28, 2019 10:26 am OK, finally got OCL working :)
Would you please share your current script (even if it contains errrors)? I'd like to test 4th axis.
I'll try for this weekend. The current Rev. 3i Usable_r1 version I just posted to Walter will do 4th axis. It just doesn't have additional controls in the sample I posted - the picture you quoted. This next release will have index start/stop angle inputs and fixed step over at each layer... and whatever else I try to cram in...

Yes, I hear you @Sliptonic ! You're thinking, "There he goes, trying to put everything and the kitchen sink... LOL!"

Until then,
Russell
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: CNC Lathe and 4th-axis milling...

Post by sliptonic »

Russ4262 wrote: Fri Mar 29, 2019 4:17 am
Yes, I hear you @Sliptonic ! You're thinking, "There he goes, trying to put everything and the kitchen sink... LOL!"
I'm just thrilled to see ocl finally getting some love. Go, Russ, Go!
Post Reply