Resolver Output

More
09 Oct 2012 18:38 #25177 by andypugh
Replied by andypugh on topic Re:Resolver Output
Does the angle ever go to zero?

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.

More
09 Oct 2012 19:38 #25180 by LAIR82
Replied by LAIR82 on topic Re:Resolver Output
Hello Andy,

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.

More
09 Oct 2012 19:55 #25182 by andypugh
Replied by andypugh on topic Re:Resolver Output
LAIR82 wrote:

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.

OK, it doesn't sound like I broke that bit.

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.

More
10 Oct 2012 12:00 #25197 by LAIR82
Replied by LAIR82 on topic Re:Resolver Output
Good Morning Andy,

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.

More
10 Oct 2012 12:23 #25199 by andypugh
Replied by andypugh on topic Re:Resolver Output
LAIR82 wrote:

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.

More
10 Oct 2012 12:24 #25200 by andypugh
Replied by andypugh on topic Re:Resolver Output
I forgot to say, you should then run the code for a few revolutions of the spindle, then look at the output of dmesg.

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

More
10 Oct 2012 12:31 #25201 by LAIR82
Replied by LAIR82 on topic Re:Resolver Output
Actually no, I thought when I made the change to the file it just started using it.

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.

More
10 Oct 2012 12:39 #25202 by andypugh
Replied by andypugh on topic Re:Resolver Output
LAIR82 wrote:

Actually no, I thought when I made the change to the file it just started using it.

With Python and TCL files that is the case, but c, cpp and comp file changes need to be compiled.

So I need go to the terminal window and go through the motions again an do remake instead of make?

remake isn't a command :-)

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.

More
10 Oct 2012 12:41 #25203 by andypugh
Replied by andypugh on topic Re:Resolver Output
Note that as the last ./configure you did was for an installed system, then that is what a second, third... make will do.

Welcome to the developer learning curve.

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

More
10 Oct 2012 14:32 #25209 by LAIR82
Replied by LAIR82 on topic Re:Resolver Output
IT'S ALIVE,


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.

Time to create page: 0.090 seconds
Powered by Kunena Forum