Can I read output voltage to motor?

General discussion of using Roboclaw motor controllers
Post Reply
Pete
Posts: 3
Joined: Fri Feb 05, 2021 3:06 pm
Can I read output voltage to motor?

Post by Pete »

Currently I have a Roboclaw 2x30A and I would like to measure or calculate output voltage to each motors. I couldn't a command which directly gives me the output voltage from the user's manual (please let me know if one exist and I just missed it).

However, I found a command to give me pwm (which can be converted to duty cycle) and main battery voltage. So I thought I can simply multiply percentage duty cycle to main battery voltage to get my output voltage, but it appeared that the pwm output isn't what I thought it is.

My setup is 22V battery, Roboclaw 2x30A, and a DC motor.
When I tested read pwm command by sending a command to run a motor at constant velocity the Roboclaw already shows max pwm value of 32767 (according to the user's manual pwm goes from +/-32767), which should mean the output voltage is around 22V, but measuring the terminal directly with multimeter shows only 2V. In fact, it appears Roboclaw shows max pwm after the true measure voltage of 2V.

Am I doing something wrong here and is there a way for me to acquire output voltage to motors? And thank you in advance.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Can I read output voltage to motor?

Post by Basicmicro Support »

If you are using velocity control you have no control over the PWM. The Velocity PID does. The PWM setting is only valid(IIRC) if you are controlling the duty directly.
Pete
Posts: 3
Joined: Fri Feb 05, 2021 3:06 pm
Re: Can I read output voltage to motor?

Post by Pete »

Thank you very much for the reply and I apologize for not checking in sooner.

I have found out the problem soon after the post. It turns out that the RoboClaw itself was faulty because a different Roboclaw returns a correct value. Since other functions of the RoboClaw still work, I opt out to leave it as it is.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Can I read output voltage to motor?

Post by Basicmicro Support »

Hmm. Reading the PWM isn't a hardware function so I'm not sure how it could be faulty on one unit but not another. It is just a memory value that is read back. If you could elaborate I would appreciate it. Thanks.

Post Reply