Currents reading (and control)

General discussion of using Roboclaw motor controllers
Post Reply
gdoisy
Posts: 33
Joined: Tue Oct 18, 2016 7:53 am
Currents reading (and control)

Post by gdoisy »

Hello,

Two questions about motor currents.

What exactly is send back by the "49 - Read Motor Currents" command? I am guessing this is the currents readings averaged over a time period ? In that case what is this time period? I am trying to get an estimate of the torque outputed by the motors (for safety check), but without more infos about the refresh rate of the readings, i won't get any reliable data.

Second question, maybe I am missing something but i don't see a mode to control the motors in current (ie torque control). Is that possible? Or is it a feature that will be implemented at some point?

Thanks!
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Currents reading (and control)

Post by Basicmicro Support »

1. The current readings are from a single pass digital filter. Samples are taken each PWM cycle(20khz). Minus noise the read current will equal the actual current within 16 samples.

2. Torque control mode is not offered on the Roboclaw.
gdoisy
Posts: 33
Joined: Tue Oct 18, 2016 7:53 am
Re: Currents reading (and control)

Post by gdoisy »

Thanks for your answer.
So if i understand well, there is no way of getting an estimate of the current consumed by the motors if not pulling the readings at minimum 1250Hz?
Would it be possible in a next firmware version to set the number of samples on which the current value is averaged?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Currents reading (and control)

Post by Basicmicro Support »

We make it so you can read it quickly if necessary and have a reasonable idea what the instant current reading is. However current changes in milliseconds(usually 10s to 100s of millisceonds) so reading slower isnt really a problem if you just want to know what the average current draw is over time.

Can you explain your application requirement in more detail?
gdoisy
Posts: 33
Joined: Tue Oct 18, 2016 7:53 am
Re: Currents reading (and control)

Post by gdoisy »

I would like to have reliable current readings at the same rate as my control loop (30Hz).
The goal is to monitor the torques of my robot and to compare it to a semi-empirical model in order to detect potential problems (i.e. higher wheel friction due to tearing or dust, collision detection, etc...).
But as you are saying that reading slower is not really a problem, i think it will just work fine with the current implementation.

Post Reply