Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Need Help with DFRduino motor Shield


  • Please log in to reply
13 replies to this topic

#1 kaiser

kaiser

    New Member

  • Members
  • Pip
  • 4 posts

Posted 26 September 2012 - 02:20 AM

Hello guys, I'm a newbie of netduino and I just read some thread from this forum to start my netduino robot project. finally I decide to use the DFRobot's motor shield. Unfortunately, When I hook up everything and run the sample from forum, Nothing happens to my motor. I'm pretty sure the motors works fine, so I think maybe something wrong with my wiring, Can you guys help to figure out what's wrong this it. I even wonder if the shield cannot work at all. I noticed the controller for this shield is L298P, but the demo code works on L298N, will this cause the problem? Here I attached the sample code. There's no compile error or run time exception happens at all. it just doesn't work for my motor. I set break point for these code and it seems work correctly. HBridge MotorDriver = new HBridge(new Netduino.PWM(Pins.GPIO_PIN_D6), Pins.GPIO_PIN_D7, new Netduino.PWM(Pins.GPIO_PIN_D5), Pins.GPIO_PIN_D4); // Motor 1 half speed backward MotorDriver.SetState(HBridge.Motors.Motor1, -50); // Motor 2 half speed forward MotorDriver.SetState(HBridge.Motors.Motor2, 50); // Lets run for 5 seconds Thread.Sleep(5000); // Motor 1 full speed backward MotorDriver.SetState(HBridge.Motors.Motor1, -100); // Motor 2 full speed forward MotorDriver.SetState(HBridge.Motors.Motor2, 100); // Lets run for 5 seconds Thread.Sleep(5000); // Stops both motors MotorDriver.SetState(HBridge.Motors.Motor1, 0); MotorDriver.SetState(HBridge.Motors.Motor2, 0);

Attached Files



#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 26 September 2012 - 06:12 AM

Hi kaiser and welcome to the forums! What kind of motors do you use, and what kind of power source? On your image I see just USB connected. USB doesn't give any power to the Vin pin, hence the motors won't get power too. I -think- that's the problem.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 supra

supra

    Advanced Member

  • Members
  • PipPipPip
  • 210 posts
  • LocationOntario, Canada

Posted 26 September 2012 - 10:38 AM

@kasier, @stefan

Those 2 pins on left side r PWRIN r left out. He didn't connected PWRIN


Kaiser, here is link and look for L298P at bottom and also including code;
L298



@stefan
The L298P is good choice over L298N

#4 kaiser

kaiser

    New Member

  • Members
  • Pip
  • 4 posts

Posted 26 September 2012 - 03:08 PM

Hi kaiser and welcome to the forums!

What kind of motors do you use, and what kind of power source?

On your image I see just USB connected. USB doesn't give any power to the Vin pin, hence the motors won't get power too. I -think- that's the problem.


Yes, that's what I doubt too. I will order a power supply for it and see if it works. :lol:

#5 kaiser

kaiser

    New Member

  • Members
  • Pip
  • 4 posts

Posted 28 September 2012 - 05:50 PM

Hello guys, I plug a 9V power to the netduino this time and try to run the program again, it didn't work yet. I noticed there're 4 LEDS near the Motor pin. when I set MotorDriver.SetState(HBridge.Motors.Motor2, 50); it always red light on, if I gave MotorDriver.SetState(HBridge.Motors.Motor2, -50); the green light on. However, when I mount the Motor on the pin, there's no more green light, the RED light always ON with some sound and I feel hot from L298P chip. I'm afraid if the chip will explode :blink: Any guys have idea how will it comes? Please HELP!

#6 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 28 September 2012 - 10:11 PM

For which voltages are the motors rated? How much amperes do they pull?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#7 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 28 September 2012 - 10:29 PM

Hello guys,

I plug a 9V power to the netduino this time and try to run the program again, it didn't work yet.

I noticed there're 4 LEDS near the Motor pin.

when I set MotorDriver.SetState(HBridge.Motors.Motor2, 50); it always red light on, if I gave MotorDriver.SetState(HBridge.Motors.Motor2, -50); the green light on.


However, when I mount the Motor on the pin, there's no more green light, the RED light always ON with some sound and I feel hot from L298P chip. I'm afraid if the chip will explode :blink:


Any guys have idea how will it comes? Please HELP!

Kaiser,

Without a picture of what you have wired up it is hard to be sure what you actually have.

But in general if a chip is hot you are drawing excessive current or the chip is not heat sinked properly.

The best i could tell you are pulling power from the 5vdc regulator on the Netduino, that regulator has a maximum output of 800 milli amps. That is sufficent for a small 5 volt servo. Anything more should have its own power, normally more than 5 volts depending on the motor. The 2 amp DFRobot shield can handle 5 to 35 vdc on the screw terminals, 6.5 to 12 vdc on the vin connection i.e. barrel connector of the Netduino and uses 5 vdc for logic power from the 5 vdc regulator.

Please take a look at Stefans Wiki page for this DFRobot Motor Shield and the DFRobot Wiki link that is on that page. It explains the difference between PwrIn and Vin and shows how to set the jumpers.

As far as the LEDs by looking at the schematic 2 LEDs are used for each motor, one for forward the other for reverse. If the LED goes out with the motor connected it is likely due to the load dropping the voltage that is needed to lite the LED i.e. you have overloaded the power supply (bad thing :( ).

Good luck,
Chuck

#8 kaiser

kaiser

    New Member

  • Members
  • Pip
  • 4 posts

Posted 28 September 2012 - 11:15 PM

Finally, I made it. It turns out that nothing wrong with the wiring and programming. The root cause is my track were too tight and motor cannot be drive properly... I used the twin gearbox and chassis made by Tamiya. When I took off the track, it runs OK! Next step, I'd like to consider if I need switch to external power maybe give two 9V battery connected in parallel way. Thank you guys, you do give me a lot of help!

#9 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 29 September 2012 - 12:21 AM

Finally, I made it. It turns out that nothing wrong with the wiring and programming. The root cause is my track were too tight and motor cannot be drive properly... I used the twin gearbox and chassis made by Tamiya. When I took off the track, it runs OK!

Next step, I'd like to consider if I need switch to external power maybe give two 9V battery connected in parallel way.

Thank you guys, you do give me a lot of help!

I wouldn't say nothing was wrong and I am not trying to be an A##hole. The condition that you had is called a locked rotor. The current can be over 10 times normal maximum current for the motor, which in turn can burn up a motors windings, commutator, controller or rectifiers of the power supply.

The thing is it sounds like no damage occurred, and we all can learn something out of the trials.

You did a no load test without the motor, a no load test with motor connected but not connected to the tracks would of saved you some time and frustration. I'll need to remember to do that when I start building a robot.

Glad you got it working.
Chuck

#10 c2rosa

c2rosa

    Member

  • Members
  • PipPip
  • 15 posts

Posted 24 June 2014 - 01:03 AM

I am trying to use the HBridge class.

In particular, Toolbox.NETMF.Hardware.HBridge

The first and third arguments for this are:

Toolbox.NETMF.Hardware.IPWMPort

This is described at:

http://netmftoolbox....rdware.IPWMPort

 

I can't seem to get MS Visual Studio C# 2010 to recognize this.

How do you do this?

Thanks, Charlie



#11 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 24 June 2014 - 08:52 AM

IPWMPort is just an interface. You could load Toolbox.NETMF.Hardware.Netduino and use the Netduino.PWM() as pin.

See also:

http://netmftoolbox....rdware.IPWMPort


"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#12 c2rosa

c2rosa

    Member

  • Members
  • PipPip
  • 15 posts

Posted 24 June 2014 - 12:17 PM

I did install the software found at:

http://netmftoolbox....ses/view/123723

This is:

.NET Micro Framework Toolbox v0.3

From within MS Visual Studio, I input the C# code found at:

http://netmftoolbox.... L298N and L293

 

I finally got the HBridge to be recognized after I included Toolbox.NETMF.Hardware.HBridge.

 

I have tried to include:

Toolbox.NETMF.Hardware.Netduino

(in order to get the IDE to recognize Netduino.PWM(...)), but, so far, to no avail.

 

 

Is the link you have above:

http://netmftoolbox....rdware.IPWMPort

 

accessible to me once I install the software found at:

http://netmftoolbox....ses/view/123723

 

Or do I have to go someplace else?

 

Thanks, Charlie



#13 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 24 June 2014 - 03:03 PM

No, should be in the same package.

 

If you download the samples, and open DFRobot Motorshield.sln, you'll also see a sample code.


"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#14 c2rosa

c2rosa

    Member

  • Members
  • PipPip
  • 15 posts

Posted 24 June 2014 - 03:10 PM

Regarding: "If you download the samples, and open DFRobot Motorshield.sln, you'll also see a sample code."...

 

OK...I'll try this.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.