Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2023-02-01 Thread lcnc



Am 06.01.23 um 11:52 schrieb andy pugh:

On Fri, 6 Jan 2023 at 09:52,  wrote:

Because the nurbs code results in straight lines
and arcs it must be possible to add
cutter radius compensation.


Indeed. I wonder why it was excluded?


A other method would be to calculate an offset nurbs.
See for example:
Vinh Phu Nguyena, Pierre Kerfridena, Stéphane P.A. Bordasb,Timon Rabczukc
Isogeometric analysis suitable trivariate NURBS representation of composite 
panels with a new offset algorithm

See
https://github.com/vinhphunguyen/migfem/blob/master/delamination/offsetCurve.m
and if cutter radius is to big:
https://github.com/vinhphunguyen/migfem/blob/master/delamination/splineCubicRemovePts.m

Joachim




___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2023-01-22 Thread lcnc




Am 20.01.23 um 15:08 schrieb andy pugh:

On Fri, 20 Jan 2023 at 13:10,  wrote:


I hope to have this ready now.


I think it would be useful to rebase the patch, at the moment your repo says:

"This branch is 9 commits ahead, 916 commits behind LinuxCNC:master."

"git pull --rebase"

If the current commit structure makes sense, then leave it as it is,
but there might be an argument for squashing some or all of the
commits together.

If you think this is worth doing then:
https://hackernoon.com/beginners-guide-to-interactive-rebasing-346a3f9c3a6d
might help (though he is using a different editor to a generic
linuxcnc installation)



Thanks for the hints.
With the help of my git expert (my son)
it is rebased and squashed.

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2023-01-20 Thread lcnc

Hi,

I hope to have this ready now.

Am 06.01.23 um 11:52 schrieb andy pugh:

On Fri, 6 Jan 2023 at 09:52,  wrote:


I found values with negative exponent, but not with positive.
How to proceed?
- 1/CART_FUZZ   (#define CART_FUZZ (1.0e-8))

Probably 1/CART_FUZZ. The compiler will replace that with a constant
anyway, so it isn't any more computation.

done.
 

It's probably better to match the surrounding code than to match the
coding style.


I will do this. It takes some time.
I copy the changed code to a new file, run
indent -kr -i8
as suggested here: https://slurm.schedmd.com/coding_style.pdf
and copy it back.

done.


No, I can't say that I like that particularly. Why not use an extra
(optional) letter in the G6.2 command?


G6.2 uses now K, P, R.
The G code interpreter is a black box for me.
Suggestion Q?

Q sounds like a good choice. You would need to add the G-codes to here:
https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/rs274ngc/interp_check.cc#L342
(G5 is already in there)

done with Q.
gcode files in
https://github.com/jf/linuxcnc/tree/nurbs_G5_G6_xyz/nc_files/nurbs/G6
are modified with Q instead of #1.


/src/emc/rs274ngc/interp_convert.cc line 142.


" setup_pointer settings) //!< pointer to machine settings" ?



Persistent no. They are used only for calculations
between start of G6.2 and the last line with G6.2 Kx.


I was looking in the wrong branch.


See the examples:
https://github.com/jf/linuxcnc/tree/nurbs_G5_G6_xyz/nc_files/nurbs/G6
If in a g code file a additional nurbs curve with 6.2 starts,
they habe to be reset.


I think that they should be reset on m2 (ie the end of a G-code
program) like everything else is.
ie. in convert_stop:
https://github.com/jf/linuxcnc/blob/nurbs_G5_G6_xyz/src/emc/rs274ngc/interp_convert.cc#L4930

done.

There is a file
https://github.com/jf/linuxcnc/blob/nurbs_G5_G6_xyz/nc_files/nurbs/G6/Rhino_Convert_NURBS.rvb
which is a Rhino script. I modified it to match for the Q number.
But because I have no Rhino, I can not test it.

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2023-01-06 Thread lcnc

First thanks Andy.

Am 06.01.23 um 02:21 schrieb andy pugh:


1. "|| beta > 1e10"
There was a small error in the function biarc in
file: src/emc/task/emccanon.cc.
I added the condition "beta > 1e10" because without
the file "Ruota_dentata #1=1.ngc" is not working.
The value of 1E10 is only guessed.


There are pre-defined "Fuzz" values available, maybe one of those
would be appropriate?
https://github.com/LinuxCNC/linuxcnc/blob/2.8/src/libnml/posemath/posemath.h#L709


I found values with negative exponent, but not with positive.
How to proceed?
- 1/CART_FUZZ   (#define CART_FUZZ (1.0e-8))
- a new constant in posemath.h
- a define in emccanon.c


My debug code is still there and I fear to violate
your coding style a lot.
https://linuxcnc.org/docs/devel/html/code/style-guide.html
I suggest to use indent.


It's probably better to match the surrounding code than to match the
coding style.


I will do this. It takes some time.
I copy the changed code to a new file, run
indent -kr -i8
as suggested here: https://slurm.schedmd.com/coding_style.pdf
and copy it back.




3. Parameter #1
To select the methods from ECME14.pdf NICU, NICL and NICC
see: http://wiki.linuxcnc.org/cgi-bin/wiki.pl?NURBS
#1 in front of G6.2 is used.
See for example: /nc_files/nurbs/G6/Curva_Chitarra #1=1.ngc
Excerpt:
#1=1
G6.2 X59.171 Y23.693 R46.58333 K0 P5 F290

Do you agree with this?


No, I can't say that I like that particularly. Why not use an extra
(optional) letter in the G6.2 command?


G6.2 uses now K, P, R.
The G code interpreter is a black box for me.
Suggestion Q?



5: Interp::nurbs_reset_global_variables();
There are static variables in
/src/emc/rs274ngc/interp_convert.cc line 142.


" setup_pointer settings) //!< pointer to machine settings" ?

I think that those settings are meant to be persistent. What problem
does it cause?

Persistent no. They are used only for calculations
between start of G6.2 and the last line with G6.2 Kx.
See the examples:
https://github.com/jf/linuxcnc/tree/nurbs_G5_G6_xyz/nc_files/nurbs/G6
If in a g code file a additional nurbs curve with 6.2 starts,
they habe to be reset.




6. G6.3
This is not used. Please check _gees are correct.
Is Gx is the right modal group?


/* 60 */ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,

Looks like no G6 codes are valid?


Please look here:
https://github.com/jf/linuxcnc/blob/nurbs_G5_G6_xyz/src/emc/rs274ngc/interp_array.cc

/*  60 */   1, 1, 1, 0,-1,-1,-1,-1,-1,-1,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, // jf 
added G6
I copied this from Lo Valvo.
In the code G6.3 is not used.
is this correct?

BTW
Because the nurbs code results in straight lines
and arcs it must be possible to add
cutter radius compensation.

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2022-12-28 Thread lcnc



I have integrated the code from Lo Valvo and Drago
and extended it to planes yz and zx.

Please see  the repository
https://github.com/jf/linuxcnc
Branch: nurbs_G5_G6_xyz.

Some notes:

1. "|| beta > 1e10"
There was a small error in the function biarc in
file: src/emc/task/emccanon.cc.
I added the condition "beta > 1e10" because without
the file "Ruota_dentata #1=1.ngc" is not working.
The value of 1E10 is only guessed.

My debug code is still there and I fear to violate
your coding style a lot.
https://linuxcnc.org/docs/devel/html/code/style-guide.html
I suggest to use indent.

2. G5 G6
I tried to keep the existing code for G5
and only added code for G6 separating both.

3. Parameter #1
To select the methods from ECME14.pdf NICU, NICL and NICC
see: http://wiki.linuxcnc.org/cgi-bin/wiki.pl?NURBS
#1 in front of G6.2 is used.
See for example: /nc_files/nurbs/G6/Curva_Chitarra #1=1.ngc
Excerpt:
#1=1
G6.2 X59.171 Y23.693 R46.58333 K0 P5 F290

Do you agree with this?

4. G6.2 Kx
The interpreter for .ngc files changes since 2014.
So it was necessary to add "G6.2" in front of the K value.

5: Interp::nurbs_reset_global_variables();
There are static variables in
/src/emc/rs274ngc/interp_convert.cc line 142.
I have added the function nurbs_reset_global_variables()
to file open. Maybe it is a better idea to
execute this at program start.

6. G6.3
This is not used. Please check _gees are correct.
Is Gx is the right modal group?


Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Talking of NURBS (and similar)

2022-12-23 Thread lcnc




Am 23.12.22 um 12:38 schrieb andy pugh:

This YouTube video was recommended to me, and does a very good job of
explaining the way that certain classes of curves are generated (and,
also, why)
https://youtu.be/jvPPXbo87ds



Very good. Chapeau!

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Unknown g code used

2022-12-23 Thread lcnc



Excuse my fault.

Witout
source ../scripts/rip-environment
the new compiled linuxcnc does not start.

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] Unknown g code used

2022-12-23 Thread lcnc

I get the Message "Unknown g code used".
How to debug this?

From emc/rs274ngc/rs274ngc_return.hh:
#define NCE_UNKNOWN_G_CODE_USED _("Unknown g code used")

NCE_UNKNOWN_G_CODE_USED occures only in emc/rs274ngc/interp_read.cc about line 
604

My beloved debug method "printf(...)" does not work.

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2022-12-20 Thread lcnc



To function ARC_FEED(...) in emc/task/emccanon.cc ( about line 1540):
there is 2 times a special treatment of plane XY:
1.if( canon.activePlane == CANON_PLANE_XY && canon.motionMode == 
CANON_CONTINUOUS)
2.if(canon.xy_rotation && canon.activePlane != CANON_PLANE_XY) {
I expect, that all planes are handled equal. Because of lack of knowledge
whats happens I can not comment on this.

I made a drawing what the nurbs code do: see attachment.
Assume a linear move to point P1 and a nurbs segment to
point P2 with a following linear move. The code calculates
2 arcs with tangential transitions. So the extension from
plane XY to other planes is only a trivial different mapping of
the calculated arcs in the nurbs plane to the other plane.
But do not expect from nurbs code a real parabolic movement
from G5.1.

I see the file motion-logger.c and will try it.

BTW:
http://wiki.linuxcnc.org/cgi-bin/wiki.pl?NURBS
Here is a link to a pdf from Leto: but I do only
get a pdf with 0 file length.

Joachim___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2022-12-19 Thread lcnc




Am 19.12.22 um 02:23 schrieb andy pugh:

On Thu, 15 Dec 2022 at 19:04,  wrote:


Hi,
here is my little christmas present for you:
nurbs in xy, yz and zx plane is working for me.


I suspect that NURBS isn't used very much (none of the CAM packages
know how to use it) so the risk of putting this straight into master
is small.

It would be nice if it could support all planes, if that isn't too
much of a stretch? I think there are 30 possible planes if you include
UVW. (Yes, I know, arcs don't work in, for example, the XV plane).
Without looking at the code (sorry, catching up on a 7 day email
backlog)  I don't know how you did the expansion, but other parts of
the code are written in XY and then just substitute at the end to the
actual plane coordinates.



The task was an easy one: I only have to look for lines of code
where the calculated nurbs coordinates (x,y) are mapped to real (x,y) 
coordinates.

Example gcodemodule.c function NURBS_FEED(...):

Original line:
STRAIGHT_FEED(line_number, P1.X,P1.Y, _pos_z, _pos_a, _pos_b, 
_pos_c, _pos_u, _pos_v, _pos_w);

Replaced by:
if(plane==CANON_PLANE_XY) {
STRAIGHT_FEED(line_number, P1.X, P1.Y, _pos_z, _pos_a, _pos_b, 
_pos_c, _pos_u, _pos_v, _pos_w);
}
if(plane==CANON_PLANE_YZ) {
STRAIGHT_FEED(line_number, _pos_x, P1.X, P1.Y, _pos_a, _pos_b, 
_pos_c, _pos_u, _pos_v, _pos_w);
}
if(plane==CANON_PLANE_XZ) {
STRAIGHT_FEED(line_number, P1.Y, _pos_y, P1.X, _pos_a, _pos_b, 
_pos_c, _pos_u, _pos_v, _pos_w);
}

Changes Files: canon.hh, emccanon.cc, gcodemodule.cc interp_convert.cc, 
nurbs_additional_functions.cc, saicanon.cc
I do not know what seicanon.cc is for!

This method can easily be continued for planes where the function
static void arc(int lineno, double x0, double y0, double x1, double y1, double 
dx, double dy)
in emccanon.cc works.

Looking to the code for arc(...) I see:
switch(canon.activePlane) {
case CANON_PLANE_XY:
shift_ind = 0;
break;
case CANON_PLANE_XZ:
shift_ind = -2;
break;
case CANON_PLANE_YZ:
shift_ind = -1;
break;
case CANON_PLANE_UV:
case CANON_PLANE_VW:
case CANON_PLANE_UW:
CANON_ERROR("Can't set plane in UVW axes, assuming XY");
break;
}
So first arc() has to be expanded to UVW planes?


Regarding UV plane:
For foam cutting setups (x,y,u,v) how looks a gcode programm?
Something like this?
G5.2 P1 L3
 X0 Y1 P1 U1 V2 Q1
 X2 Y2 P1 U3 V3 Q2
 X2 Y0 P1 U3 V1 Q1
 X0 Y0 P2 U1 V1 Q2
G5.3

Or different G numbers (G5.4 and G5.5) ?

Joachim



___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2022-12-15 Thread lcnc

Hi,
here is my little christmas present for you:
nurbs in xy, yz and zx plane is working for me.
Please see  the repository
https://github.com/jf/linuxcnc
branch: nurbs-xyz.

Maybe someone can test it.

The code needs little polishing.
BTW: Is someone using astyle for formatting?
https://astyle.sourceforge.net/

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] LinuxCNC 2.8.2 Debian 10 Buster PREEMPT-RT ISO can't install Grub

2022-10-02 Thread lcnc

I tried again on virtualbox with no network adapter. No uefi.
No problem with grub.

And again with boot the iso from boot menu.
No problem with grub.

So far,
Joachim

Am 02.10.22 um 00:37 schrieb Sam Sokolik:

I have had issues installing debian from the boot menu..  but so far - the
installer when you boot into the live has worked every time.

On Sat, Oct 1, 2022, 1:06 PM  wrote:


I just installed from the 2.8.4 ISO in a virtual machine
(virtual box) with a network card active, but no connected
ethernet cable, with success. No problems with grub.

Joachim

Am 01.10.22 um 13:06 schrieb andy pugh:

On Sat, 7 Aug 2021 at 13:47, Rod Webster  wrote:


Just a heads up. It looks like the Buster ISO has a dependency for Grub
that has to be installed from the network while installing. The install
fails at this point in an endless loop and no way to boot the machine if
you don't have internet access during the installation.


I would assume that this is still the case with the 2.8.4 ISO?

Does anyone know of a viable solution?




___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers



___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

.




___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] LinuxCNC 2.8.2 Debian 10 Buster PREEMPT-RT ISO can't install Grub

2022-10-01 Thread lcnc

I just installed from the 2.8.4 ISO in a virtual machine
(virtual box) with a network card active, but no connected
ethernet cable, with success. No problems with grub.

Joachim

Am 01.10.22 um 13:06 schrieb andy pugh:

On Sat, 7 Aug 2021 at 13:47, Rod Webster  wrote:


Just a heads up. It looks like the Buster ISO has a dependency for Grub
that has to be installed from the network while installing. The install
fails at this point in an endless loop and no way to boot the machine if
you don't have internet access during the installation.


I would assume that this is still the case with the 2.8.4 ISO?

Does anyone know of a viable solution?




___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2022-09-26 Thread lcnc


I can report little progress:
preview in Axis is working, see attached picture.

For those interested:
I have cloned the repository to
https://github.com/jf/linuxcnc
and created a branch nurbs-xyz.

There is a new subdirectory
nc_files/nurbs/
with the gcode files.

Joachim___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2022-08-15 Thread lcnc



The next decision is about the  code to change.
I would be glad to read your opinions.

My suggestion - the easy way - is to keep the code for nurbs calculations.
Only change the wording to nubs_plane with coordinates nurbs_X and nurbs_Y
to be clear this is still a 2d nurbs (and not machine axes).
And then to map the calculation to the active plane.

For CANON_PLANE_XY
nurbs_X -> X
nurbs_Y -> Y

For CANON_PLANE_YZ
nurbs_X -> Y
nurbs_Y -> Z

For CANON_PLANE_XZ
nurbs_X -> X
nurbs_Y -> Z

This results for example in file gcodemodule.cc function NURBS_FEED:

now:
STRAIGHT_FEED(line_number, P1.nurbs_X, P1.nurbs_Y, _pos_z, 
_pos_a, _pos_b, _pos_c, _pos_u, _pos_v, _pos_w); //original

new:
if(plane==CANON_PLANE_XY)
{
STRAIGHT_FEED(line_number, P1.nurbs_X, P1.nurbs_Y, 
_pos_z, _pos_a, _pos_b, _pos_c, _pos_u, _pos_v, _pos_w); //unchanged
}
if(plane==CANON_PLANE_YZ)
{
STRAIGHT_FEED(line_number, P1.nurbs_X, _pos_y, 
P1.nurbs_Y, _pos_a, _pos_b, _pos_c, _pos_u, _pos_v, _pos_w); //
}
if(plane==CANON_PLANE_XZ)
{
STRAIGHT_FEED(line_number, _pos_x, P1.nurbs_X, 
P1.nurbs_Y, _pos_a, _pos_b, _pos_c, _pos_u, _pos_v, _pos_w); //
}

In file emccanon.cc each nurbs segment uses the function biarc,
which results in two calls to ARC_FEED, which is aware of the active plane.

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2022-08-14 Thread lcnc



Am 14.08.22 um 14:08 schrieb andy pugh:

On Sun, 14 Aug 2022 at 11:33,  wrote:


2. in src/emc/rs274ngc/gcodemodule.cc which is used for example by AXIS.


There are two parallel interpreters, in effect. One is used to control
the machine, the other to create a graphical preview.

It appears that the way to determine the active plane in gcodemodule.cc is with:

get_attr(canon, "plane", &plane)

Which puts an int into "plane"



I have seen this code in static PyObject *rs274_arc_to_segments(PyObject *self, 
PyObject *args.

But the code in NURBS_FEED(int line_number, std::vector 
nurbs_control_points, unsigned int k)

PyObject *canon;
int plane;

get_attr(canon, "plane", &plane);

results in:

emc/rs274ngc/gcodemodule.cc:207:10: warning: ‘canon’ is used uninitialized in 
this function [-Wuninitialized]
  get_attr(canon, "plane", &plane);


How to initialize canon?

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2022-08-14 Thread lcnc



Excuse me, I have messed up the other thread.

Thanks Gene for your encouragement.


There are 2 function NURBS_FEED.
1. in src/emc/task/emccanon.cc, which is used for machine movements.
2. in src/emc/rs274ngc/gcodemodule.cc which is used for example by AXIS.

In src/emc/rs274ngc/gcodemodule.cc I am not familiar enough
with the code to get the information, witch plane (G17, G18 or G19)
is active.

Both functions are called from functions in
src/emc/rs274ngc/interp_convert.cc
 - convert_spline
 - convert_nurbs
There is - in both functions - the information
about the active plane available.

It would be easy to add an additional parameter plane to NURBS_FEED
and then it is easy to check for the active plane with:
if(settings->plane == CANON_PLANE_xx)

Is this an acceptable way to proceed?

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


[Emc-developers] NURBS in XY, XZ(lathe) and YZ plane

2022-08-14 Thread lcnc

Hello,

it is worth to spend my time to do this?
I looked to the code and it seems doable.

Joachim


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers