Main Site Documentation

Another DC Motor Shield Question


#1

I set up the motor shield with ext PWR to Domino (9v) and also have the USB cable attached to my PC for debug.

When I run sample code I get the Red LED’s in the foward direction, but the green LED’s do not illuminate in reverse.

Also when I run this line:

FEZ_Shields.DCMotorDriver.MoveRamp(-50, 50, 20);

the motors do not start at the same time there is about a 1 sec delay before the reverse starts up.

When I run this line:

FEZ_Shields.DCMotorDriver.MoveRamp(-50, -50,50);

the motors start at full speed and slow to half speed.

When I run this line of code:

FEZ_Shields.DCMotorDriver.MoveRamp(0, 0, 100);

the motors which were running at 50% jumpt to 100% and then slow to zero.

Any comments?

Thanks,
Tony


#2

Very strange! Did you buy the shield from us?


#3

Yes, I purchased from your company.

Do you think I have a bad DC Motor Shield?


#4

A “bad” board will create such behavior!


#5

Are you sending this commands directly or via a method (or button)?

If not directly, make a new form with only the code for moving.


#6

Can you make a very very simple test program and post it here? So, we can try it here.


#7

Me?


#8

The one who is having problem with the shield :wink:


#9

I am using the code from your sample (brochure). I just remove the Thread.Sleep() lines as I am single stepping in Debug mode. I did change some of the param values as shown in the code snippets from my original post.


#10

So, what’s the verdict guys?

Do I need a new motor shield? Can you send a replacement??

Thanks,
Tony


#11

I would guess you have problem with connections and nothing is wrong with the shield.

How did you connect power to the shield? I do not remember how it works but looking at schematics I see that power is not connected directly to the motor control.
http://www.tinyclr.com/downloads/Domino/DFRobot/Arduino%20Motor%20SCH.pdf

Look at the right side of the image http://www.tinyclr.com/images/products/TCLR-RP0118_large.jpg
It looks like you need to connect +5V to VIN. This will give 5V to your motors. Or better connect that VIN pin to the VIN pin on FEZ Domino…this option is better because the power comes to the motors right from the input voltage instead of going through the voltage regulators…of course you need to know what voltages your motors need.


#12

I have 9v connected to the PWR connector on the Domino and the USB cable attached to the Domino. I measured the voltage at Vin on the motor shield and it is correct, 9v for the motors and there is 5v coming from the Domino to the motor control board as well. So it is hooked up correctly as all voltages are as they should be.


#13

You can ship us your shield back and include a link to this thread so we know what it is about. Send to GHI address and direct it to Attn: repair


#14

OK - Thanks…


#15

Hi,
sorry for get on this old thread, but I’ve have the same issue with the 2A motor Shield( http://www.dfrobot.com/index.php?route=product/product&path=35_39&product_id=69).

To make it work, have change this code snippet from the Move function

            if (speed1 < 0)
            {
                _dir1.Write(true);
                _pwm1.Set(1000, (byte)(100 - Math.Abs(speed1)));
            }
            else
            {
                _dir1.Write(false);
                _pwm1.Set(1000, (byte)(speed1));
            }
            ////////////////////////////    
            if (speed2 < 0)
            {
                _dir2.Write(true);
                _pwm2.Set(1000, (byte)(100 - Math.Abs(speed2)));
            }
            else
            {
                _dir2.Write(false);
                _pwm2.Set(1000, (byte)(speed2));
            }

to this one:

            if (speed1 < 0)
                _dir1.Write(true);
            else
                _dir1.Write(false);

            _pwm1.Set(1000, (byte)(Math.Abs(speed1)));
            
            ////////////////////////////       
            if (speed2 < 0)
                _dir2.Write(true);
            else

                _dir2.Write(false);
            _pwm2.Set(1000, (byte)(Math.Abs(speed2)));

The behavior that I have is when I was sending the command:

Move (-100,-100)

the motor receive a speed of 0 and when I send

Move (-25, -25)

They where running at 75 backward, what do you think? For me it’s looks like a driver related issue rather than hardware issue.


#16

Is the driver made specifically for that board? If not, then you need to modify the driver for it. if you got the drivers from GHI then the divers are made for the shield we sell here on this website…which could be different.

Maybe add the code to www.fezzer.com when you have it working.


#17

Done, now on Fezzer. I did not get the points for that video… :frowning: