eccentric turning
09 Jan 2022 11:09 #231234
by andypugh
If you simply want to display the angle 0-359.999 then put a modulo function in HAL between the angle value and the pyvcp input pin.
However, somewhat oddly, LinuxCNC does not appear to have a modulus block (or even a divide block) so the neatest answer is probably a simple custom component.
And, that might as well _replace_ whatever you are using to convert encoder position to degrees.
linuxcnc.org/docs/2.8/html/hal/comp.html
Save the code above to a file called "pos2angle.comp" and then add it to your LinuxCNC installation with "sudo halcompile --install pos2angle.comp" then you can use it like any other HAL component.
Replied by andypugh on topic eccentric turning
I think that it is probably best _not_ to do that except, possibly, at the point of display. Resetting the angle to zero every rev feels like a way to introduce glitches into the motion.output degrees in pyvcp...i have it but...
when 360° reached i want to get 1° not 361°.
If you simply want to display the angle 0-359.999 then put a modulo function in HAL between the angle value and the pyvcp input pin.
However, somewhat oddly, LinuxCNC does not appear to have a modulus block (or even a divide block) so the neatest answer is probably a simple custom component.
And, that might as well _replace_ whatever you are using to convert encoder position to degrees.
linuxcnc.org/docs/2.8/html/hal/comp.html
component pos2angle "Convert spindle turns to degrees";
pin in float position "Position output of spindle encoder";
pin out float degrees "Spindle position in degrees";
pin out float deg-lim "Spindle position in degrees wrapped at 360";
function _;
license "GPL";
include "rtapi_math.h";
;;
degrees = position * 360.0;
deg_lim = fmod(degrees, 360);
Save the code above to a file called "pos2angle.comp" and then add it to your LinuxCNC installation with "sudo halcompile --install pos2angle.comp" then you can use it like any other HAL component.
Please Log in or Create an account to join the conversation.
- hitchhiker
- Away
- Premium Member
-
Less
More
- Posts: 126
- Thank you received: 9
09 Jan 2022 11:21 #231236
by hitchhiker
Replied by hitchhiker on topic eccentric turning
andy is my personal hero.
i dont want to reset the count and work with them.. i want only to display the angle.
thats was not give any regulation to the motion.
only in my vcp bot inside the process of motion.
understand?!
thanks. i will give it a try
i dont want to reset the count and work with them.. i want only to display the angle.
thats was not give any regulation to the motion.
only in my vcp bot inside the process of motion.
understand?!
thanks. i will give it a try
Please Log in or Create an account to join the conversation.
09 Jan 2022 11:32 #231237
by jpg
Replied by jpg on topic eccentric turning
maybe with the video ?

Please Log in or Create an account to join the conversation.
Moderators: piasdom
Time to create page: 0.450 seconds