Brainstorming @ Interpolation

More
06 Nov 2011 14:34 - 06 Nov 2011 14:36 #14605 by Grimg
I am using HAL component sampler to record output from EMC2. I have installed EMC2 from live CD downloaded from this site. My configuration consists of 2 axis step motors (orthogonal X an Y).

When I test my configuration with this G code (10mm square with center at axis intersection):

g21 g61
s3400 m3
g0x-5y-5
g1x5 f60
g1y5
g1x-5
g1y-5
g0x0y0
m2

I get normal square (see picture Square.jpg in attachment).

But, when I use this (circle with 10mm radius with center at axis intersection):

g21 g61.1
s3400 m3
g0x5
g3 x0 y5 i-5 f60
g3 x-5 y0 j-5
g3 x0 y-5 i5
g3 x5 y0 j5
m2

In picture Circle.jpg it is evident that there are some missed steps, and for some reason the interpolator does not allow simultaneous steps (when X and Y moves 1 step in the same time).

The pictures are from Matlab script. I looked over the EMC2 source code from www.koders.com and it seems to me that the current EMC2 is using old EMC interpolation functions (conclusion derived from files emcmot.c and control.c). Is it possible that there's some problem with function call (very unlikely, but still)? Especially with circular interpolation and G1 runs that are not "horizontal" and "vertical"?

Another possible explanation includes my base- and servo- period settings. I used addf in halcmd do add sampler to servo-thread. Is there any rule regarding the required ratio between base- and servo- period setting for optimal circular interpolation (keep in mind that I got good results with square test run)? Or with thread period for sampler component?

Grimg
Attachments:
Last edit: 06 Nov 2011 14:36 by Grimg.

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

More
06 Nov 2011 14:35 #14606 by Grimg
Sry. Forgot to add circle.jpg
Attachments:

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

More
06 Nov 2011 16:46 #14609 by step4linux
Grimg wrote:

Another possible explanation includes my base- and servo- period settings. I used addf in halcmd do add sampler to servo-thread. Is there any rule regarding the required ratio between base- and servo- period setting for optimal circular interpolation (keep in mind that I got good results with square test run)? Or with thread period for sampler component?

Not sure if I understand this right, but steps for stepper motors are created within base thread. If you want to record the steps, the sampler must run within the base thread.

Gerd

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

More
06 Nov 2011 17:00 - 06 Nov 2011 17:02 #14610 by BigJohnT
halsampler is a userspace component and can not run in real time. halsampler uses the realtime component sampler to cash the samples and it can/should run in the base thread.

www.linuxcnc.org/docview/html/man/man1/halsampler.1.html

Or I totally don't know what I said... take your pick.


John
Last edit: 06 Nov 2011 17:02 by BigJohnT.

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

More
10 Nov 2011 13:31 #14740 by Grimg
Thanks everybody for your answers.

I've been busy last couple of days and I just have managed to solve the problem - I sampled from servo- , not base-thread. When I switched to base- it worked fine.

Still, I am wondering about circular interpolation (G commands G2 and G3): It seems to me that when controler interpolates it does not allow simultaneous steps for both (X and Y) axes.

e.g. 1 step on X axis and no step on Y produces _ ; and 1 step on Y axis and no step on X produces | . But there are no / or \ (when there are 1 step on X axis and 1 step on Y axis)

Grimg

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

Time to create page: 0.086 seconds
Powered by Kunena Forum