Dagu 4 channel motor driver - help

Hello community,
I've installed a Dagu 4 channel motor driver and all coming fine.

What I figure out now is to use the current pin sensor present for every board, I use the function AnalogRead based on some documention and/or based on the fact that this pin is connected on Analog pin of my Arduino board.

What I not really understand, is the value read on the pin and here your help is appreciate.

Someone knows if the value is related a Voltage (Volt)?
What range min and max could be retreived? From 0V to 1024V?

Is it right to correlate the 0Volt&0Ampere-1024Volt&4Ampere?

Which the formula that must be used for calculate the Ampere?

Many thanks everyone could provide a feedback.

BR
//Mafer

Read the documentation. Maybe do some tests, like load the driver with 1A and check the voltage that the pin is putting out.

Looks like 1 Ohm series resistor.
float Current = analogread(A_pin)/205.0;

Isaac96, the doc on internet or look around not mention any test and/or details on the type of value received on this type of pin.

knut_ny , could you detail more your suggestion :slight_smile:

//Mafer

The picture of the board shoes 4pcs 1 Ohm resistors (1 or 1/2 W) I guess the analog voltage out just reflects the voltage drop over the resistor. since 1 Ohm: The analogread reflects both current and voltage (same value).
as 5V (5A) will read 1023 it should be just divide value by (1023/5=205).
What may interfere, is that the value may not be steady - as u use PWM for the speed control
If u're lucky, there is some kind of filter to deal with this problem.
....
hmmmm. found this: http://www.robotshop.com/media/files/pdf/schematic-rs011mc.pdf
It shows filtering and 22 times amplification.
I must have seen colors incorrect. Resistors are 0.1 Ohm.
current close to analogRead(ax)/92

filter.png

Hello knut_ny,
many thanks for your explanation.

Yes I use the PWM for change the speed, at first instance I would like to achieve a overload monitoring function.

concern your explanation I have the following

analogRead from the current pin of my Dagu , this return a value , apply the formula

If Value returned by analogRead is equal or more of my Limit setting then ......

I can calculate the my Limit using the formula (1023 / 5 ) * Ampere/volt limit
e.x (1023/ 5) *2.6

That sound good?

BR
//Mafer

..see addition to previous post.

I did a simple simulation with the circuit from the datasheet.
PWM : fully on (100%)
Found that 2A motor current returns 4.32V at output. (analog value 884)
This may be "far from correct", I don't trust the simulation fully.
Datasheet also talks about this voltage. Read it.

int limit = (int) (volts * 1024.0 / 5.0) ;

The ADC has 1024 input values spread across the voltage range, not 1023 (minor point),
and integer division truncates (1024/5 = 204, 1024.0/5.0 = 204.8, which is 0.4% different).
The cast to int for limit also truncates, but that is actually correct since the first input bucket
(0.0V to 0.005V) all maps to a 0 ADC reading.

converting an ADC value to a voltage in an unbiased manner is done thus:

  float V = (analogRead () + 0.5) * 5.0 / 1024.0 ;

Then any reading from the first bin yields the mid-point voltage of that bin

Usually these details are spurious accuracy, but are worth rememebering if using a lower
resolution ADC where the LSB is more important.

Imagine a 2 bit ADC:
0 means 0.0 - 1.25V
1 means 1.25 - 2.5V
2 means 2.5 - 3.75V
3 means 3.75 - 5.0V

so reading a 2 could mean anything from 2.5 to 3.75, whose mean is 3.125V ( = 2.5 * 5.0 / 4.0)
[/code]
[/code]

Hi MarkT,
the ADC and LSB that you mention is on the Dagu Motor or on Arduino?
Note: now I'm using a Leonardo but I upgrade to mega.

Which is the way for to retrieve a fix values instead of a range?

For knut_ny, which is the datasheet? I found only a little bit user guide of 1 page.
Could you share a link?

BR
//Mafer

Current output:
Each channel has a current sensing circuit. The output of this circuit is approximately
1V for each amp the motor draws (5V maximum). This output can be connected
directly to the analog input of any 5V micro controller.

This does not match up very well...

You are mixing few things.
But ADC (analog to digital) will give you 1024 values (depends on Reference selector on board)
You can also see some motor example here:

www.electronics-freak.com

Thanks,
Roee

many thanks for everyone has provided a feedback.

I would like to focus, concerning all feedback, on the following item

Which is the best way for to retrieve a fix values instead of a range and/or accurate value?

//Mafer

Which is the best way for to retrieve a fix values instead of a range and/or accurate value?

unprecise Q. ??

I mean as best way via software calculation only , use of internal Vref and external vref but here I'wouldn't follow because means to add hardware.

is the mix of internal Vref with software calculation a good approach?

and also

I've need a single value not a range

//Mafer