Output Voltage difference

Hi,

i'm building a robot based on an Dagu Rover 5 2WD, an Rasperry Pi and an PicoBorgReverse.
Testing around with the encoders I found something that I don't understand. Driving the Motors forward with PBR.SetMotors(1) produces a lower output voltage than driving them backward with PBR.SetMotors(-1). Wich results in an higher rounds-per-minute driving backward.
Is this an normal behavior and is there a way too change it?

Greetings from Germany

Robert

piborg's picture

There should not be any difference due to the board.

If for example we have a 7.2v input then:

  • PBR.SetMotors(0.0)
    M1- = 0v
    M1+ = 0v
    M2- = 0v
    M2+ = 0v
  • PBR.SetMotors(1.0)
    M1- = 0v
    M1+ = 7.2v
    M2- = 0v
    M2+ = 7.2v
  • PBR.SetMotors(-1.0)
    M1- = 7.2v
    M1+ = 0v
    M2- = 7.2v
    M2+ = 0v

There are two likely suspects which would explain you problem:

  1. Your power / battery supply to the PicoBorg Reverse is too low.
    You need to have a supply voltage of at least 6v to guarantee proper operation, below this the voltage levels may be incorrect and too much lower and the board may disable one or both motors to protect itself from damage.
    As batteries get flat they start to drop in voltage, so this may also explain the problem.
    If you are using rechargeable AAs be aware they only provide 1.2v instead on the normal AA 1.5v.
  2. The motors may offer more resistance in one direction then the other.
    What this means is that when the motor is powered it puts a drain on the battery, in one direction this drain may be larger than the other, lowering the provided voltage.
    You should be able to test this by swapping M1+ with M1- and M2+ with M2- on the board.
    If this is the case then with the swapped wiring it should now be that driving them with -1 is slower than +1

If it is not either of these things we would need to know more to try and figure out what the problem is, for example what the actual voltages are when running.

Thanks for your fast reply.

I'm using 6 rechargeable AAs with 1.2V. Fully charged there are 8.3V at the input of the PBR. The Motors are 7.2v. There were 7.2v whe driving forward, and about 8.2v when driving backward.
When I have time later, i will try swapping the wiring as suggested and report again what happend.

piborg's picture

It is curious they are 7.2v when driving forward given the battery voltage supplied, especially when it happens to be the rated motor voltage...

I wonder if the motors have some type of protection to prevent them getting more than 7.2v, but it only works in the forward direction.

The swapped wiring should reverse the drive power level if there is, since it would depend on the actual direction the motor rotates.

As for backwards 8.2v sounds about right, a small drop in voltage due to the resistance of the motors.

Did some testing now. I added some quick drawings, to make clear how I wired things up.
Voltage of the batterypack was at 8.3v

Test 1

  • SetMotors(1): Motor going forward
    • M1: 7.5v
    • M2: 7.5v
  • SetMotors(-1): Motor going backward
    • M1: 7.9v
    • M2: 7.9v

Test 2

  • SetMotors(1): Motor going backward
    • M1: 7.55v
    • M2: 7.55v
  • SetMotors(-1): Motor going forward
    • M1: 8.0v
    • M2: 8.0v
Images: 
piborg's picture

I must admit I am very confused now.

The PicoBorg Reverse should have the same output levels in both directions.
Swapping the wiring seems to disprove it is something to do with the direction the motors are rotating.

Can you measure the voltage levels from the PicoBorg Reverse at both 1 and -1 with the motors disconnected?

Made the suggested test and it leads back to the motors.
Both outputs equal the input at +1 and -1 when there is no motor connected.
Can I try to put a Resistor at M1/M2 instead of a Motor to proof this? And wich dimension should I use?

piborg's picture

You could test with a resistor I suppose, ideally you would need a low value resistor such as a 2Ω.
If you do this be warned, it would have to be a resistor with a large power tolerance:
P = V² ÷ I = (8.3 × 8.3) ÷ 2 = 34.4W
Most people do not have those type of resistors lying around (you tend to find them in audio devices).
They look very bulky, like these ones.

You could use a higher resistance, but the effect will be less motor like.
The normal through-hole style resistors like these can be as low as 0.25W, so something like 330Ω or more should be okay:
P = V² ÷ I = (8.3 × 8.3) ÷ 330 = 0.21W

Be warned, the resistors are likely to get hot when you are running it, be careful not to touch them or place them on anything easily combustible.

Here are the results I get using two of the small motors we sell with a power supply.
Supply = 7.0v
  • PBR.SetMotors(0.5):
    V+ = 6.9v
    M1 = 2.8v
    M2 = 2.6v
  • PBR.SetMotors(-0.5):
    V+ = 6.9v
    M1 = -2.8v
    M2 = -2.7v
  • PBR.SetMotors(1):
    V+ = 6.5v
    M1 = 5.7v
    M2 = 6.0v
  • PBR.SetMotors(-1):
    V+ = 6.8v
    M1 = -6.2v
    M2 = -6.2v
  • PBR.SetMotors(0):
    V+ = 7.0v
    M1 = 0v
    M2 = 0v

The trouble is that these motors are only rated for 3v, so I am over-running them beyond 50%.

At 50% output forward and reverse are basically the same.
At 100% the motors actually run properly in reverse, but they get hot.
At 100% the motors run slightly lower, but now they start screeching after running for a while.

The screeching sound is the PicoBorg Reverse protecting itself from an over-current situation by turning off for short bursts.
As chance would have it at a 7v supply with these particular motors it gets upset in one direction, but not the other.

If I turn the power up any further it is too much for both motors in either direction.
It just so happens in this case that one direction has a slightly lower tolerance to over-current then the other.

What I am wondering is do you hear any unusual buzzing, tapping, or screeching from either the motors or the board?
You may only hear it after running them constantly for a minute or two (it tends to get louder as things warm up).
If you do it is probably suggesting they cannot cope with the full 8.3v supply power.

Not much time for testing today.
Trying to run my Batterypack to an lower input-voltage.
With 7.6v now at V+ it keeps all the same.
Also at lower speed settings. Tested down to +0.2 an -0.2. The voltagedrop from V+ to M1/M2 keeps constant at +1 to +0.2. The output is never V+*speed, its always about 0.4v below. Driving backward the difference is only about 0.1v
What I also saw when testing the RPM with the encoders is that it is linear from +1.0 to +0.6 than makes a big step to +0.5 and gets linear again.

piborg's picture

The non-linearity is not surprising, motors are not perfectly linear with regards to voltage.
In particular there is a threshold level below which the motor will not rotate, this was about 0.1 with the setup I used last time.
The amount of load on the motor will also affect the speed, this can be increased by:

  • Moving up slopes
  • Carrying more weight
  • Motors or gears getting worn out
  • Changes in temperature

The PicoBorg Reverse also has what is known as dead-time in the PWM.
This dead-time is a very brief period of time where the output is not connected to V+ or GND, what is typically known as tri-stated.
This also causes some non-linearity as the motor can behave like a generator during this time and affect the voltage it is seeing.

Also any wheel spin or track slip can cause a higher RPM reading even though the robot will likely be moving slower.

Since you can read the RPM you could try and write some code to maintain a steady RPM by increasing or decreasing the power level on the fly if you wanted.
Are the encoders connected to the Raspberry Pi already?

Thanks for all this great support so far. It helped me already to understand things much better.

Yes, the encoders are already hooked up, thats the way I measure RPM right now.
I'm using only one chanel per side, cause one chanel seems to be missing counts in one direction.
Using the encoders to maintain RPM is my target. I'll try to use a PID-control-algorithm to do this.

If you could tell me how to insert text with syntaxhighlighting I would like to share my actual testing code.
Just to be sure that there are no other problems are hidden ;)

piborg's picture

Glad to hear this is helping you out ^_^

You can insert text blocks with the <pre> tag.
You can then have the text highlighted as code by telling it what the language is:

<pre class="brush: python">
Line 1
Line 2
Line 3
</pre>

The above generates:

Line 1
Line 2
Line 3

You can also attach source files to a forum post.
You will probably need to add a .txt to the end of the file name before uploading it.
For clarity I have added the correct file name in the description for the example below.

Attachments: 
Subscribe to Comments for &quot;Output Voltage difference&quot;