


![]() |
  | |||||||||||||
![]() |
|
![]() |
||||||||||||
![]() Arduino Motor Shield rev3 driver / library
Started by tomassch, Aug 20 2012 06:07 PM
12 replies to this topic
#1
Posted 20 August 2012 - 06:07 PM
Hi Guys,
First off, I'm a complete newbie to Netduino
![]() ![]() ![]()
#2
Posted 20 August 2012 - 10:17 PM
Welcome to the Netduino community. From my experience with the Motor Shield, it's not uncommon for it to get rather warm. The Motor driver does have a thermal shutoff, if I recall correctly, so I wouldn't worry about it too much. The more current your motors draw the warmer things will get though. If your concerned about the heat, you can always add a heatsink. When you talk EE use small words, I'm just a Software Developer
Oh my. So many things, so little money!!
#3
Posted 21 August 2012 - 11:54 AM
Thanks for the reply Arron. Anyone has an answer on the library / driver question? (A)
"Actually, I'm wondering if there is a sample driver, library or a tutorial for the Arduino Motor Shield Rev3 in combination with the Netduino (GO). I find it hard to find any sample code for the Netduino at all."
#4
Posted 21 August 2012 - 12:47 PM
Hi tomassch,
To drive a motor, you'll basically just open up an OutputPort for each motor (to control the direction) and a PWM for each motor (to control the speed).
By altering the DutyCycle of the motor, you'll change its speed. By using OutputPort.Write(true) or .Write(false), you'll change the motor between forward and backwards rotation direction.
Stefan--do you have any samples for using the PWM classes (old or new classes) in your toolbox?
Chris
#5
Posted 21 August 2012 - 12:53 PM Yes, I have, but nothing for stepper motors. I only have experience with servo motors and regular 'hobby' motors (DC motors) I've written code for the Adafruit Motorshield, available here: http://netmftoolbox....ruitMotorshield It may help understanding the principles of PWM itself.
"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
#6
Posted 21 August 2012 - 05:57 PM
Hi, Thanks for the replies. I am familiar with the concept of PWM (done a little programming / experimenting on some PIC microcontrollers and have a degree in computer science).. Although development for the PIC was a pain [both in terms of software and soldering the hardware], I managed to learn some electrical engineering and more hardware level concepts. Again, I love the speed at which one can just start prototyping!
#7
Posted 28 August 2012 - 11:12 PM
Hello Stefan, Do you think that Netduino 3.3V logic level can cause any problems on driving generic Arduino (5V) motor shields based on the L298 bridge? I am not aware of this bridge details, so I am not sure if it takes actually the PWM pulses or the average voltage. In case of second option, we could never be able to run the DC motors at maximum speed, right? I was having a look at the datasheet, and although I did not find the information there, I believe this bridge uses the LOGIC SUPPLY VOLTAGE VSS input voltage to compare with the average voltage generated by the PWM. However, the minimum value accepted is 4.5V.. What do you think? Igor. Igor Kondrasovas
#8
Posted 29 August 2012 - 03:15 AM
Hi Igor,
If you're using the Arduino "REV3" motor shield, you should be good. It has an IOREF pin which reads the 3V3 voltage from the mainboard...and should adjust accordingly as needed. Chris
#9
Posted 29 August 2012 - 04:24 PM
Hi Chris,
I think you mean Adafruit's motor shield, right? Do you have a quick tip on how to make sure it is REV3? I am looking at Adafruit website and not revision is specified nor if there is any IOREF pin. Thanks, Igor. Igor Kondrasovas
#10
Posted 29 August 2012 - 04:45 PM
Hi Igor,
Here you go: http://arduino.cc/en...noMotorShieldR3 Chris
#11
Posted 29 August 2012 - 05:38 PM
Hi Chris, Thank you for the reply. On the page you mentioned, PWMA (motor a) and PWMB (motor ![]() 1 - Set pin3 and pin11 as digital inputs; 2 - Use pin5 and pin10 as PWM outputs; 3 - connect pin5 to pin3 and pin10 to pin11; I think someone else should have a better option... I know .NET Micro Framework Toolbox has support for Adafruit, DFRobot motor shields, but I guess they assume you have are using a 5V TTL logic board, right? Thanks, Igor Igor Kondrasovas
#12
Posted 29 August 2012 - 06:14 PM
Hi Igor,
So sorry, this thread is in the Netduino Go forum so I assumed that you were using a Shield Base. Yes, that should work. You can also bend the pins (on the bottom of the shield) for pin3/pin11 instead of using them as digital inputs; you'll need to connect the pwm pins as mentioned... We have used the DFRobot and Adafruit shields without any noticeable issues. Chris
#13
Posted 29 August 2012 - 06:26 PM
Hi Chris, My bad posting on the wrong forum. I think now I got the trick: PWM control to these boards (including the Motor Shield Rev3 and potentially the other ones) are performed on the "enable" pins of L298 chip, so the chip is enabled/disabled accordingly to the PWM duty cycle. Datasheet says 2.5V is OK for high level detection. The other shield configuration is usually performed using onboard jumpers. I bought some shields and I will test them when they arrive. Then I will post something in Portuguese for Brazilian community. Thanks, Igor. Igor Kondrasovas 1 user(s) are reading this topic0 members, 1 guests, 0 anonymous users | ||||||||||||||
![]() |
||||||||||||||
![]() |
|
![]() |
||||||||||||
![]() |
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ![]() |
||||||||||||
![]() |