Gcode tools - lathe extension develop

cnc-club.ru for English speaking users
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Gcode tools - lathe extension develop

Сообщение Nick »

Gcode tools - lathe extension develop

Questions to discus

  1. Cutting tool parameters
  2. Additional lathe parameters
  3. Lathe's Gcode features
  4. Special places
  5. ...

Desired features list

  1. Special mode for 4axis mills
  2. Automatic flip along axis

Awaiting of realization

  1. Automatic flip along axis

Done

  1. Path calculation
  2. Export path to gcode
  3. Defailt X and Z axis remap
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

First try in real use condition of lathe extension:

The machine configuration is a Mill with a little motor for rotary axis the long of the X axis.
Gcodetool extension lathe generate gcode in XY mode remap.

Making a wood ball...
boule.png (10533 просмотра) <a class='original' href='./download/file.php?id=583&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (134.9 КБ)</a>
boule1.svg
(385.8 КБ) 1414 скачиваний
On turning...
turning_ball.jpeg (10533 просмотра) <a class='original' href='./download/file.php?id=584&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (603.58 КБ)</a>
The result.... :
turning_ball_finish.jpeg (10533 просмотра) <a class='original' href='./download/file.php?id=585&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (509.41 КБ)</a>
It have some little bug for finishing pass that doesn't subdivise the finishing width by the number of subdivision set...
It's not so easy to set the good direction for the path to tell gcodetools to go left to righ or righ to left... perhaps have you a trick... i make more try
and reports you another bugs...
The first try is nice for me ... good results to come.

Have a nice day :beer:
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение Nick »

Hi! Nice job!
Thanks for the photos!
I've been doing some 3d modelin/drawing/rendering and photo of your wooden ball looks like a material test from the Vray :).
It have some little bug for finishing pass that doesn't subdivise the finishing width by the number of subdivision set...
It's not a bug it's a feature :D! The subdivision is not needed there. If you are cutting a ball you can cut it using only one gcode command G02 because ball' projection is a circle ;).
It's not so easy to set the good direction for the path to tell gcodetools to go left to righ or righ to left... perhaps have you a trick...
Sure I have a trick :). It's in the FAQ... Oooppps I have forgot to publish it in English :oops:. But thanks to Dormouse who have made this job. So see his FAQ http://kalyaev.com/2010/20100408/inkscape-faq.html.
In a nutshell:
To check the direction of the path add middle or end markers that looks like an arrow pointing to the End. (Ctrl+Shift+F -> Stroke Style -> set stroke width more than '0', Middle markers Arrow2MEnd.)
To change paths direction do the following Path->Reverse.
That's it. Easy, isn't it?

I have some advises:
  1. Remove that vertical line from the left. Material width should be defined in the lathe window.
  2. Add horizontal line at level 0 from the right. Doing this you avoid high depth step during the fine cut at the right.
    0068 gcode tools lathe.png (10528 просмотров) <a class='original' href='./download/file.php?id=589&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (41.88 КБ)</a>
  3. Define depth step at the tools parameters.
  4. Define material width at lathe's window.
    0066 gcode tools lathe.png (10528 просмотров) <a class='original' href='./download/file.php?id=591&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (119.29 КБ)</a>
  5. Some advises how to draw your scene:
    1. Draw a circle and a rectangle.
    2. Move circle until it's center not on the rectangle's edge. It will be easy if you turn on snapping and grab circle near the left or right points.
    3. Add them together (Ctrl+Shit+"+")
    4. Add rectangle at the left to hold your ball while it's being cut.
    5. Add them together (Ctrl+Shit+"+")
    6. Using knots editing tool (F2) remove unnecessary knots.
    0067 gcode tools lathe.png (10528 просмотров) <a class='original' href='./download/file.php?id=592&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (36.58 КБ)</a>
  6. Image that just showing that reverse works:
    0070 gcode tools lathe.png (10528 просмотров) <a class='original' href='./download/file.php?id=593&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (16.16 КБ)</a>
i make more try
and reports you another bugs...
The first try is nice for me ... good results to come.
Will be waiting for new results.
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

"
It have some little bug for finishing pass that doesn't subdivise the finishing width by the number of subdivision set...


It's not a bug it's a feature :D! The subdivision is not needed there. If you are cutting a ball you can cut it using only one gcode command G02 because ball' projection is a circle ;). "
Hum I think you have don't understand me for this feature....
The feature i was thinking for this is that for have a good finishing surface at the end of cut require to cut very thin depht of material...
So when the tool arrive to finishing depth for example 1 mm and if have set 10 step the tool must cut all the shape Ten time with widht of 0,1mm
depht minus each pass... until arrive to the end of the last shape cuting.

Because if i cut in one time G02 the depht is too big and for example soft wood is tear... and to suppress this tearing effect of fiber
I must cut 3 or 5 pass with very thin depht befor arrive to final pass...

Or actualy if I set 1 mm fine cut width and cut count to 10 the gcode generate do 10 time the end shape.... and doesn't subdivide
the 1 mm depht to 10 depth cutting thin pass...

Excuse me if i have bad explain you this feature on the start of work...

So another solution is to do Twice the gcode generation ... One with roughing and another one just for finish... whith two sheet in inkscapte or two gcode file...but less beautifull and practical...
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

For the reverse funtion very Nice... It's so obvious that i don't understand why i haven't see it before... :oops:
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение Nick »

Now I get it... Ok, I'll try to do it...
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

Just for illustrate and show you the errors... of no subdivide of end cutting depth and why i have a vertical line to the left of end of drawing...
because gcodetools go wrong in depht at the start or end of cutting depending the direction...

See on picture...and in gcode file were Y go to negative value....
lathe_error_end_cutting.png (10525 просмотров) <a class='original' href='./download/file.php?id=594&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (89.85 КБ)</a>
The svg...
lathe_error_end_cutting.svg
(32.72 КБ) 1289 скачиваний
The ngc...
lathe_error_end_cutting.ngc
(5.25 КБ) 1559 скачиваний
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение Nick »

alfcnc писал(а):Just for illustrate and show you the errors... of no subdivide of end cutting depth and why i have a vertical line to the left of end of drawing...
because gcodetools go wrong in depht at the start or end of cutting depending the direction...

See on picture...and in gcode file were Y go to negative value....
lathe_error_end_cutting.png
The svg...
lathe_error_end_cutting.svg
The ngc...
lathe_error_end_cutting.ngc
There was a bug... while doing fine cutting penetration g00 was path.y - fine_cutting_width instead of path.y + fine_cutting_width.
I'll correct this in some minutes...
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение Nick »

Revision 139

I've add a parameter "Create fine cut using" and two options:
"Move path" just moves original path up. And so creates a number of fine cuts. Gives worse results than offset but there should not be bugs.

"Offsets" offsets original path up. And so creates a number of fine cuts. Gives the best result but could be bugs due to offsets bugs. You can always try it first and in case of bugs try to add some knots to the path near the problem places or just use the first option.

I've changed the inx file so you'll have to run python create_inx.py before using separate lathe window.

Here's an illustration:
Вложения
0071 gcode tools lathe fine cut.png (10523 просмотра) <a class='original' href='./download/file.php?id=597&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (111.9 КБ)</a>
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

Ok ! I'll test...
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение Nick »

Oppps wait a minet I've got to do the push.... :oops:
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение Nick »

Now you can try it... Revision 140.
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

Ok ! That's come great... but little error with offset...

The fine cuting path goes out on the left...
And on the right start at curious position for some of them....
finishing_offset_error.png (10519 просмотров) <a class='original' href='./download/file.php?id=598&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (292.71 КБ)</a>
svg file with trajectory and setting...
boule1.svg
(368.04 КБ) 1439 скачиваний
if setting 1mm fine cut and 5 count the right is good... but left alwas go out...
more_thin_finishing_pass_error_on_left.png (10518 просмотров) <a class='original' href='./download/file.php?id=600&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (251.4 КБ)</a>

Hum Curious ! I see now with different setting all is ok... curious..perhaps this can help you to find
were is the bug..
Вложения
fine_cuting_error_ok_with_this_parameters.png (10518 просмотров) <a class='original' href='./download/file.php?id=601&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (299.73 КБ)</a>
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение Nick »

Revision 142

I've found the bug. While calculating line and Bezier curve intersection we have to solve cubic equation and take only real roots that are 0<=root<=1. But due to calculation tolerances root becomes 1.000000001 which was ignored. Now we take roots that's abs(root.imag)<1e-7 = 0.0000001 and -0.0000000001<=root.real<=1.0000000001.

Thanks for the bug report :D!
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

:cheesy: YES YES YES ....very very nice...
And I think that's correct some problem with Area....because I have some strange things look like this when working with little value... ;)
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

Hi despit the debugging another bug arrive... :think:

With some value gcodetools give a zero division error see on screen capture...
lathebug_rev142_divisionerror.png (10509 просмотров) <a class='original' href='./download/file.php?id=604&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (270.45 КБ)</a>
And with another value that's work but the before last fine cuting path is lost....
see another screen capture...
lathe_rev_142_one_line_missing.png (10509 просмотров) <a class='original' href='./download/file.php?id=603&sid=67bc1af0ed810752b826942288f3eb79&mode=view' target=_blank>Загрузить оригинал (265.66 КБ)</a>
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение Nick »

Revision 142

I think I've fixed first problem.
I've added tolerance=0.0000000001 into csp_split_by_two_points function.

The second problem caused by offset's clipping errors. I really do not know how to fix them right now. You can add some knots to path to do a "local" fix.
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

Hum rev 142 bug bug....
the fine cut count don't work any time if generate path cutting from left to right.... often division error with any settting and
when that work for example with 0.6 mm fine cut width and 3 fine cut count it have any fine cut generate...
And it's more more hard to find value that works with this direction... perhaps have you missing some subroutine for this direction... :!:
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

alfcnc писал(а):Hum rev 142 bug bug....
the fine cut count don't work any time if generate path cutting from left to right.... often division error with any settting and
when that work for example with 0.6 mm fine cut width and 3 fine cut count it have any fine cut generate...
And it's more more hard to find value that works with this direction... perhaps have you missing some subroutine for this direction... :!:

Hum else if i add more and more knot... like you have tell me to do.
Аватара пользователя
Nick
Мастер
Сообщения: 22776
Зарегистрирован: 23 ноя 2009, 16:45
Репутация: 1735
Заслуга: Developer
Откуда: Gatchina, Saint-Petersburg distr., Russia
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение Nick »

Could you post your svg and parameters please.

PS We have started to develop a Postprocessing feature. Which will enable axis flipping/remaping and other features...
Revision 145 includes beginning of Postprocessing class.

Postprocesing will look like a script with commands that are separated by semicolon.
command(parameters,..,parameter);command(parameters,..,parameter);command(parameters,..,parameter);command(parameters,..,parameter);

At the moment two one function is available: remap and remapi, they are the same but ramapi works case insensitive.
remap command has simple syntax:

remap("change from"->"change to",...,"change from"->"change to"). This function works almost the same as replace, the only difference that it do all replaces together not one after another.
I'll show the difference at the example:
lets take the code: "x 10 y 20"
remap("x"->"y","y"->"z") will give "y10 z20"
but if we'll do to consecutive replaces we'll have the following:
Original: "x 10 y 20"
after replace "x" to "y" : "y 10 y 20"
after replace "y" to "z" : "z 10 z 20"
See the difference?

Hmmmm... I thin we should start new thread to discuss postprocessing...
alfcnc
Кандидат
Сообщения: 98
Зарегистрирован: 02 апр 2010, 19:10
Репутация: 0
Заслуга: Tester
Контактная информация:

Re: Gcode tools - lathe extension develop

Сообщение alfcnc »

Ok ! process, processing...

The svg file is the same than post just previous this post... Boule1.svg...
were I have just change the direction of cutting path from "right to left" to
" left to right" with revert path... you'll have the bug with about all the value
you can set for fine cut.... very easy to reproduce...
Ответить

Вернуться в «English forum»