Initialize circle problem

More
08 Nov 2015 22:27 #64992 by TurboTux
Hello,

first I'd like to say thank you for this excellent piece of software. I've used LinuxCNC for my home-build gantry router since version 2.5.0 and it done lots of jobs absolute perfectly.

Since upgrading to version 2.7.0 (and recently to 2.7.2) I've got a strange problem executing a bigger G code file (unfortunately in the middle of a job). I isolated the problem into a simple ngc-file (please see the attached file f_bad.ngc). After loading the file, the figure looks quite good in the preview window, but when executing the G code, the program statically stops showing the following error messages:

Failed to initialize Circle9, err codes 0, 0, 0, -1
can't add circular move at line 257, error code -1

At first I thought of a rounding problem but even changing the values in the mentioned line a little bit couldn't solve the problem. Only when I decreased the J parameter about 0.1 from 2.0168 to 1.9168 (see f_OK.ngc) the program could be fully executed (of course this also slightly changes the shape).

All files are generated by a slightly modified truetype-tracer (to mirror the direction) but the problem also occurs with the standard version (attached as f.ngc). Here are the calling parameters:
truetype-tracer -u -c 0.0035 -l 50 "f" > f.ngc
Also I haven't seen this problems for other letters, so I don't think that the truetype-tracer is the problem.

Then I checked this issue with an old 2.5.0 live image CD and the "bad" file will be executed like a charm. So it looks like a problem in the new version.

Can anybody confirm this behavior and can tell me how to avoid this problem?
At the moment I completely simulate every job in order to prevent that this problem occurs just while executing a real job.

If necessary, I can also provide a simulation configuration of my machine which allows a reproduction.

Many thanks for your advice
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Nov 2015 22:45 #64994 by BigJohnT
Replied by BigJohnT on topic Initialize circle problem
Well, all three files run fine on 2.7.2 Axis Simulator... I've never seen a LinuxCNC error like those, do you preprocess the files with something?

JT

Please Log in or Create an account to join the conversation.

More
08 Nov 2015 23:24 #64995 by TurboTux
Replied by TurboTux on topic Initialize circle problem
Hi,

thank your for your quick response. That sounds strange. Maybe the problem is caused by my configuration but I haven't seen this kind of error before and I can reproduce it statically. Well I've added the configuration files (the expanded ini because of my includes and the hal-file) of my simulation environment. I hope this will help to reproduce the problem.
Also I will do additional tests in order to get more informations (and maybe a solution). My only suggestion is, that I made a mistake when applying the config changes for the new LinuxCNC version.

Thanks
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Nov 2015 23:48 #64996 by BigJohnT
Replied by BigJohnT on topic Initialize circle problem
Trying to run your configuration and I get error about circle.ngc and pendant not connected so it's tough to guess what you have wrong.

JT

Please Log in or Create an account to join the conversation.

More
09 Nov 2015 02:17 #64999 by dgarrett
Replied by dgarrett on topic Initialize circle problem
The error:
Failed to initialize Circle9, err codes 0, 0, 0, -1

occurs in emc/src/tc.c part of the new trajectory planner
included first in 2.7

I modified your config so it would run without the items
which were reference files or directories that are local
to your system:
1) comment out [DISPLAY]PROGRAM_PREFIX
2) add instead [DISPLAY]PROGRAM_PREFIX = .
3) comment out [DISPLAY]NGCGUI lines
4) comment out [DISPLAY]EMBED*
5) comment out [DISPLAY]PYVCP*
6) comment out [APPLICATIONS]APPS=
7) comment out HALFILE=LIB:xhc-hbo4.tcl

I tested f_bad.ngc on:
Debian Jessie 66bit uspace --- no error
Debian Jessie 32bit uspace --- no error
Lucid Ubuntu 2.6.32-122-rtai --- ERROR same as posted by TurboTux

So i edited src/emc/tp/tp_debug.h to enable TP_DEBUG

Addtional details in /var/log/kern.log:

Finalizing tc id 257, type 2
blend_prev = 0, term_cond = 3
min_radius = 0x1.5633AE916EEEBP+9, effective_min_radius = 0x1.5633AE916EEEBP+9
acc_ratio_tan = 0x1.FFA8869916F58P-1
v_max 0x1.9P+6 is within limit of v_max_acc 0x1.E6E9C467F72AP+8
sample_maxvel = 0x1.4CDF1785D6C97P+7
Adding TC id 257 of type 2, total length 0x1.4A9955C934C47P-3
Segment 257, type 2 not finalized, continuing
optimization initial vel for segment 257 is 0x1.010B635ED6B67P+2
found peak due to v_limit
found peak due to v_limit
found peak due to v_limit
found peak due to v_limit
found peak due to v_limit
found peak due to v_limit
ini_maxvel = 0x1.9P+6
setting term condition 2 on tc id -1, type 2
radius = 0x1.2DB44231ED494P+9, angle = 0x1.188484BB21DA7P-12
spiral_coef = 0x1.D3401DE0E57E2P-31
Spiral fit: b0 = 0x1.C08ACCAEA44DDP-32, b1 = 0x1.2DB44231ED494P+9, length = 0x1.4A9955C639FA5P-3, spiral_in = 1
Spiral fit check: fit_err = 0x1.D649B9484FAC3P-16
Failed to initialize Circle9, err codes 0, 0, 0, -1
split time for id 238 is 0x1.9C6DBA972C577P-11
tc id 238 splitting
Doing tangent split
Finished tc id 238
Activate tc id = 238 target_vel = 0x1.0AAAAAAAAAAABP+2 req_vel = 0x1.0AAAAAAAAAAABP+2 final_vel = 0x1.62E525A8B4BEAP+4 length = 0x1.167E808ABAD78P-3



so this looks like a bug in the new trajectory planner that only shows up
for some kernels, for instance:
$ uname -a
Linux shop-lucid 2.6.32-122-rtai #rtai SMP Tue Jul 27 12:44:07 CDT 2010 i686 GNU/Linux
The following user(s) said Thank You: TurboTux

Please Log in or Create an account to join the conversation.

More
09 Nov 2015 04:40 #65002 by rellenberg
I think I know what's going on here. Part of the "spiral arc fit" is solving a quadratic equation. This equation fits the arc length to the angle, so we have to solve for the roots of this equation to get angle back for a given length. Unfortunately, the solution I originally implemented loses precision if the equation is nearly linear. I had a fix for this in a development branch, but now that I'm looking at the code again, that fix didn't make it into the release. I'm sorry you had to bump into this problem the hard way! The good news is that I have a patch ready that may fix your issue. For anyone interested in building / testing it, here's the link to my branch on github .
The following user(s) said Thank You: TurboTux

Please Log in or Create an account to join the conversation.

More
09 Nov 2015 06:57 - 09 Nov 2015 07:01 #65004 by TurboTux
Replied by TurboTux on topic Initialize circle problem
You guys are really great. Thank your very much for your confirmation/solution and sorry that I forgotten to clean-up my configuration file before attaching it to my last message. I've never seen such an awsome support before.
@rellenberg: I will try your solution as soon as possible.

Very impressed greetings
Last edit: 09 Nov 2015 07:01 by TurboTux.

Please Log in or Create an account to join the conversation.

More
09 Nov 2015 22:09 #65048 by TurboTux
Replied by TurboTux on topic Initialize circle problem
I've tested your hotfix and it really solves the problem. Many thanks for the solution. Well done.
If I had known that the problem also depends on the operation system version (of course I use the old kernel 2.6.32-122-rtai on my CNC computer) I should better told you so in my initial post - sorry. Thanks to dgarrett for finding out this important information.

Please Log in or Create an account to join the conversation.

More
01 Mar 2017 09:27 #88799 by Segitarius
Hello Guys,

In my opinion there might be an other way to solve this issue. G64 P0.1 is a function that blends your path and eliminates tight radius and corners. Maby fixing system is not so very neceserry.

Please Log in or Create an account to join the conversation.

Time to create page: 0.105 seconds
Powered by Kunena Forum