Problem with encoder reading

5 years 7 months ago #29530124 by tako
Hello,
I am using SDC2130 connect to motor 1 and an incremental encoder.
I use RS232 for communication. Connect pin 4 and 8 to channel A and B.
I also disable and put "no action" for pulse input 1 and 2.
Encoder 1 is in "Command" use. open loop control.
In the script, I do something like
top:
SetCommand(_G,1,300)
print( GetValue(_ABSPEED,1),"\r")

goto top

to get the value of speed from decoder 1. I expect a constant speed in RPM from decoder, but it just outputs random numbers. What did I do wrong?
The Encoder is HDES8731, PPR is 4096. Max/min limits is +-200000 and home load is 0.
Thank you.

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

5 years 7 months ago #29530132 by TechSupport
Unless your encoder is the actual device giving the commands, you would set this as feedback. Try setting it as feedback instead of motor command.

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

5 years 7 months ago #29530136 by tako
Replied by tako on topic Problem with encoder reading
I will try it tomorrow to see if it solves the problem. But could you please explain why setting at commands, not feedback causes the thing wrong?Thanks

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

5 years 7 months ago #29530137 by TechSupport
The way it interprets data. If it is being used in a way not designed to gather information, it is likely not going to give the right information. If you were to add a tachometer to a car to measure speed, and instead you set it up as if it were the gas pedal, you would not get the same results.

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

5 years 7 months ago #29530149 by tako
Replied by tako on topic Problem with encoder reading
But as far as I know, the encoder will count the edges every 10ms and get the velocity. So the encoder values should not change even if it is in command or feedback mode. Anw, I will give it a try tomorrow. Thank you.

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

5 years 7 months ago #29530150 by tako
Replied by tako on topic Problem with encoder reading
Hi, I am already solve problem with the encoder. The loose installation causes the problem.
I have another question with SDC2130. I want to use SDC2130 to communicate with another microcontroller. The ucontroller will send speed and acceleration to SDC2130. SDC2130 will receive these data and update its own script to execute. However, I couldn't find any way to read data from serial communication on SDC2130 and SDC2130 does not support CAN. So can you help provide any solution for that? Or I have to constantly send command from the ucontroller to SDC2130 through RS232? Thanks

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

5 years 7 months ago #29530157 by TechSupport
Glad to hear you got that resolved.

You can read data via serial. Either it can be done through our "Console" tab of the utility, or you can use another program like Hyper Terminal. The usermanual has all the reference serial commands and queries.

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

Moderators: tonysantoni
Time to create page: 0.117 seconds