Resolver Output
I have looked at the changes I made, and they shouldn't affect the angle pin at all.
How are you forcing index-enable to true?
Can you create a halscope plot of the angle / counts with the spindle turning at steady speed?
(It is possible to save a halscope trace to file as data)
Please Log in or Create an account to join the conversation.
The angle goes from 0 to 1 and then repeats for every revolution of the chuck. I was mistaken about the linearity, the number readout on "show hal config-watch" was non-linear, but in the halscope it looks ok.
I am going to the show hal config and doing a setp........ true command with the index-enable from the resolver to the motion.index-enable unlinked in my hal file. PCW showed me this to see if the index-enable function was actually working.
I saw the counts resetting at something like 2x10^10 decimal place, so I started adjusting the divisor value to see if it would change but it didn't. I was doing a 1000rpm spindle command, and the counts were resetting every roughly 25 seconds. (counting down from roughly 2000000000 to -20000000000)
Here is that halscope trace file you wanted.
Please Log in or Create an account to join the conversation.
OK, it doesn't sound like I broke that bit.The angle goes from 0 to 1 and then repeats for every revolution of the chuck. I was mistaken about the linearity, the number readout on "show hal config-watch" was non-linear, but in the halscope it looks ok.
I think I know what the problem might be. (the unsigned counter is being decremented through zero, I didn't think it could be)
Try changing line 325/326 in resolver.c to:
if (++(res->index_cnts) >= res->hal.param.index_div){
res->index_cnts = 0;
Please Log in or Create an account to join the conversation.
When I got in this morning, I made those changes, and still no difference. I shot an email off to the place I bought the resolver's from to see if they have a different resolver that might cure this. I'm up for anything at this point.
Thanks
Please Log in or Create an account to join the conversation.
I shot an email off to the place I bought the resolver's from to see if they have a different resolver that might cure this
I am sure we can make this work, it is just that the development cycle is rather long.
You can save a lot of time by working with a run-in-place version and starting from the command line after . ./scripts/rip-environment.
After the first ./configure / make / sudo make setuid sequence you can re-compile a new version in a few minutes with just "make"
In order to figure out what is going on we can add some debug code. Add the rtapi_print statements below to the resolver.c code and re-make
(You _did_ re-make after the last change?)
if ((res->old_reg ^ hm2->resolver.position_reg[i]) & 0x80000000){
rtapi_print("wrap. index_cnts = %u\n", res->index_cnts);
if (++(res->index_cnts) >= res->hal.param.index_div){
rtapi_print("limit\n");
res->index_cnts = 0;
if (*res->hal.pin.index_enable){
rtapi_print("index_enable. index_enable = %i\n", *res->hal.pin.index_enable);
res->offset = res->accum & 0xFFFFFFFF00000000LL;
*res->hal.pin.index_enable = 0;
rtapi_print("index_enable. index_enable = %i\n", *res->hal.pin.index_enable);
}
}
}
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
So I need go to the terminal window and go through the motions again an do remake instead of make?
Sorry Andy
Please Log in or Create an account to join the conversation.
With Python and TCL files that is the case, but c, cpp and comp file changes need to be compiled.Actually no, I thought when I made the change to the file it just started using it.
remake isn't a commandSo I need go to the terminal window and go through the motions again an do remake instead of make?
make
sudo make install
Should do the trick.
Leave off doing the rtapi_print changes until we have seen if the first change works.
Please Log in or Create an account to join the conversation.
Welcome to the developer learning curve.
Please Log in or Create an account to join the conversation.
Works like a dream, when I did the commands.
One of these days I'll get the hang of it.
Thank You Andy
Please Log in or Create an account to join the conversation.