Brainstorming @ Interpolation
When I test my configuration with this G code (10mm square with center at axis intersection):
I get normal square (see picture Square.jpg in attachment).g21 g61
s3400 m3
g0x-5y-5
g1x5 f60
g1y5
g1x-5
g1y-5
g0x0y0
m2
But, when I use this (circle with 10mm radius with center at axis intersection):
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).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
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
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- step4linux
- Offline
- Premium Member
- Posts: 115
- Thank you received: 5
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.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?
Gerd
Please Log in or Create an account to join the conversation.
www.linuxcnc.org/docview/html/man/man1/halsampler.1.html
Or I totally don't know what I said... take your pick.
John
Please Log in or Create an account to join the conversation.
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.