Menu

Topic-icon CR returning 0

More
8 months 6 days ago #29534279 by glmnet
CR returning 0 was created by glmnet
So I have this setup where I can query C then rotate a wheel one turn and after querying C again I got about 30.000 difference, given my encoder resolution and gearbox ratio this makes perfect sense to me.

I was using CR (counter read relative which resets after a call to CR) and it was working ok, I don't know what happened in the middle but it does not work anymore. I started investigation and …

Using Motor utility, query CR, got 0:0, querying ?C gives me number. Take note ok. Rotate wheel one turn, call CR, got 0:0, call C again and gives me previous number + about 30.000, as expected. Shouldn't CR gave me the difference between the two ?C queries?

Curiously if I have a friend repeatedly clicking the Send button while I am turning the wheel numbers come in the response, but they don't add up 30.000

As additional information I have my program which is querying CR every 25 ms aprox and adding up one wheel rotation gives me about 11000, so about 60% of the ticks are lost, also the readings are not consistent.

?BCR seems to work as expected, I can query, get some number, query again get 0:0 rotate one full turn, wait a few seconds and get 450 on the next query, which is the expected value.

I will rewrite my program to start using absolute encoders meanwhile.

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

More
8 months 5 days ago - 8 months 5 days ago #29534282 by Gabriel_Isko
Replied by Gabriel_Isko on topic CR returning 0
It sounds like something is resetting the relative count. Is it possible that something else is calling CR, perhaps in a script? Go ahead and post your configuration any script you have.

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

More
8 months 4 days ago #29534287 by glmnet
Replied by glmnet on topic CR returning 0
Here is my config file. I expect no script to be running, all my IO is done thru Serial (USB actually) then I have the encoders connected, a few discrete I/O (lamps, buttons) and the RoboCan with a Riox setup (I tested disconnecting RoboCan cable and not querying Robocan, but I did not test disabling RoboCan) I also have a MGY Sensor in PWM pin mode.
Attachments:

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

More
8 months 4 days ago #29534288 by glmnet
Replied by glmnet on topic CR returning 0
Nevermind, I am testing it now and it works as expected again.

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

More
8 months 4 days ago #29534289 by Gabriel_Isko
Replied by Gabriel_Isko on topic CR returning 0
Alright. Do you know what you changed, just for future reference?

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

More
8 months 4 days ago #29534290 by Gabriel_Isko
Replied by Gabriel_Isko on topic CR returning 0
Alright. Do you know what you changed, just for future reference?

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

Moderators: tonysantoni
Time to create page: 0.112 seconds
Go to top