0

Motor Shield V2.3 with Leonardo and DC Motor Test
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Motor Shield V2.3 with Leonardo and DC Motor Test

by mlitzkow on Sun Jul 15, 2018 11:07 am

I recently purchased Motor Party with Motor Shield V2.3 and am using with Leonardo. I am powering the Leonardo with USB and separately powering the shield with a regulated bench supply rated at 5 amps. I do not have the jumper in place. The power LED on the Leonardo is on only when the USB is plugged in. The power LED on the shield is on only when the power supply is plugged in. I think I have power for the two cards isolated and adequate power for each. I am using the stock DC motor that came with the Motor Party. I have tried running the power to the shield at both 12.0 and 9.0 volts.

I started with the stock DCMotorTest code and I have added
Code: Select all | TOGGLE FULL SIZE
while( !Serial );

after the
Code: Select all | TOGGLE FULL SIZE
Serial.begin(9600)

this is to give the Leonardo a chance to get the Serial port initialized before printing to it. Otherwise even the initial "Adafruit Motorshield v2 - DC Motor test!" does not show up on the Serial monitor. With this, the motor will start cycling back and forth a couple of times. The very first "tick" will sometimes show up. The later strings "tock" and "tech" rarely show up. How far the code will proceed is different every time I upload the sketch. The code seems to run for a few cycles of the motor speed cycling up and down, but the messages printed to the Serial monitor fail to show up. After some number of cycles of the motor running back and forth according to the code, it just starts running very fast at a constant speed and will not be interrupted by the reset button. The power supply never shows more than about 125 mA.

Why does printing to the Serial monitor stop working? Why does the motor go into the single speed situation? I would appreciate any ideas on what I may be doing wrong.

-- mike

mlitzkow
 
Posts: 1
Joined: Sun Jul 15, 2018 10:27 am

Re: Motor Shield V2.3 with Leonardo and DC Motor Test

by adafruit_support_bill on Sun Jul 15, 2018 12:18 pm

Brushed DC motors are very noisy electrically. The 'brush noise' can find its way back to the processor either conductively via the power and/or ground rail. Or inductively via noise radiated from the motor leads. Sometimes the interference is strong enough to cause the processor to behave erratically.

In your case, you are using a separate power supply. But the ground rail still shared. To minimize the interference, it is best to suppress it close to the source. This can be done with some 0.1uf ceramic capacitors soldered to the motor.

https://learn.adafruit.com/adafruit-mot ... faq#faq-17

adafruit_support_bill
 
Posts: 70468
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.