Menu

Topic-icon Encoder counter read issue

More
3 years 3 months ago #29532315 by Sameerasdn
I am using sdc2130 controller to drive two encoded motors in closed loop speed control mode.
When I try to read the encoder counter relative value with ?CR1_ and ?CR2_ commands trough RS232 the controller returns a minus character.
My closed loop controller works fine.

Do I need to set any configuration to read this value or do I have to initialize the counter for it to start counting the the encoder pulses.

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

More
3 years 3 months ago #29532317 by blake
Replied by blake on topic Encoder counter read issue
Hello,

Are you trying to read just the encoder count value?

Counter Relative (?CR) will return the amount of counts that have been measured from the last time that the query was made. So if you send the query and then move the motor in reverse and send the query again it should return a negative value.

If you want to query the actual encoder count then the ?C query should be used.
The following user(s) said Thank You: Sameerasdn

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

More
3 years 3 months ago #29532319 by Sameerasdn
Hi blake,
What I am getting is not the negative value, it is the minus sign which indicates an error.
when I checked with Roborun pc tool I could see that the encoder was calculating the speed value in closed loop speed control mode.

I tried both ?C1_ and ?CR_ but neither worked for me.

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

More
3 years 3 months ago #29532327 by blake
Replied by blake on topic Encoder counter read issue
Okay thank you for that clarification. I think the problem is that your syntax is wrong, there should be no underscore after the query.

When sending the command from console it would either be ?C for absolute encoder count or ?CR for relative encoder count, no semicolon.

For example, if you wanted to read the absolute count of encoder one you would send exactly ?C 1

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

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