HDC2450S serial motor speed problem

9 years 10 months ago #29528246 by mjdesrosiers
HDC2450S serial motor speed problem was created by mjdesrosiers
I\'m using the HDC2450S in closed-loop speed mode, with a 64 CPR encoder on the back of the motor. I\'ve got the PID mode running, and the motor spins up to speed just fine. Haven\'t tuned it yet, but that\'s a future problem.

My problem now is that when I poll the motor over serial to get the speed its running at, the value bounces around wildly. I\'ve got the encoder channels on an oscilloscope, and they are constant at the correct speed. But I can\'t get the motor to report that to me.

For instance:

Command of 12 => 60 RPM
Oscilloscope speed: 60 RPM
Serial speeds recorded: 42, 70

Command of 120 => 600 RPM
Oscilloscope speed: 600 RPM
Serial speeds recorded: ~420, ~709.

I thought these values were curious, as the errors seem to nearly scale with the command. While the time-average of the values is correct, the instantaneous value is very wrong, and the granularity seems poor.

Is it possible I have something configured wrong?

Thanks!

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

9 years 10 months ago #29528247 by Griffin Baker
Replied by Griffin Baker on topic Re:HDC2450S serial motor speed problem
If you are running the controller, how are you querying the data? Through console command, or through a script?

?S - Read Encoder Motor Speed in RPM.

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

9 years 10 months ago #29528248 by mjdesrosiers
Replied by mjdesrosiers on topic Re:HDC2450S serial motor speed problem
I am running the controller serially, i.e., by a command like

!G 10

And I am querying it just like you suggested, with ?S, but I still get the strange wavering/incorrectness.

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

9 years 10 months ago #29528249 by Griffin Baker
Replied by Griffin Baker on topic Re:HDC2450S serial motor speed problem
Try disabling the watchdog timer ^rwd 0
Then send the !G 10 command. This will allow the command to keep running the motor.
Then send the ?S

Do you get the same results?

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

9 years 10 months ago #29528250 by mjdesrosiers
Replied by mjdesrosiers on topic Re:HDC2450S serial motor speed problem
I have done that. When the bad results are presenting themselves, the motor is running, & at a constant pace. I am not having a problem with the motors stopping running, which seems to be what you are thinking by suggesting turning off the watch dog timer. I have sent the ?S command in a similar manner to how you are suggesting already. I am not having a problem with sending the command while running, but a problem with the command returning inconsistent values.

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

9 years 10 months ago #29528251 by Griffin Baker
Replied by Griffin Baker on topic Re:HDC2450S serial motor speed problem
Understood. One last thing I can think of asking for right now. Is the encoder PPR count set to the right value?

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

9 years 10 months ago #29528252 by mjdesrosiers
Replied by mjdesrosiers on topic Re:HDC2450S serial motor speed problem
Yes. 64. It\'s not that the values are wrong, necessarily, it\'s that I can\'t get them to report correctly. If I\'m running at 60 RPM, and I continually poll by \'?S\', the responses I get go like this:

42
42
42
42
70
70
70
42
42
70
70
42

They bounce around, on the wrong value, somewhere /near/ the right value.

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

9 years 10 months ago #29528253 by roboteq
Replied by roboteq on topic Re:HDC2450S serial motor speed problem
The controller works correctly. What you have here is a problem of granularity. 64 PPR is a very low number and only a very small number of pulses can be captured during the measurement interval that lasts 10ms.

If not done already, the encoder should be placed on the motor shaft and not on the gear ouput.

If possible, use a higher count encoder.

If you are using the encoder feedback for closed loop speed control, note that you may still get a relatively stable and accurate output because the speed capture, although jumpy because of granularity, will eventually average around the correct value.

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

9 years 10 months ago #29528254 by mjdesrosiers
Replied by mjdesrosiers on topic Re:HDC2450S serial motor speed problem
This is sounding about right, for 60 RPM. But if I run it at 600 RPM, my errors are proportionally higher - the numbers it returns are ~400 and ~700. I understand at low speeds, there just aren\'t enough samples. But a variance of 300 RPM? That seems fishy.

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

Moderators: tonysantoni
Time to create page: 0.072 seconds