G is for GROUND! The latest Circuit Playground is here!

Strange noice (beebing sound) mShield

Hi,
i installed a dc motor on the mShield. It works good. But when setting the speed to below 200 it starts to giva a beeping sound, lack of power?

the same sound occurs when turning the pot to the blow.
Code: Select all | TOGGLE FULL SIZE
`  if  ( val >= 450 && val <=550 ){    //Serial.print("middle");  motor.run(RELEASE);  }`

How can i solve?
chisburg

Posts: 6
Joined: Wed Jan 09, 2013 5:24 am

Re: Strange noice (beebing sound) mShield

The sound is from the PWM used to control the motor speed. You can use a higher frequency, specified in the motor constructor. See the library reference for details: http://learn.adafruit.com/afmotor-library-reference

Posts: 38724
Joined: Sat Feb 07, 2009 10:11 am

Re: Strange noice (beebing sound) mShield

I tried to change the Frequencies
Frequencies for channel 1 & 2 are:
MOTOR12_64KHZ
MOTOR12_8KHZ
MOTOR12_2KHZ
MOTOR12_1KHZ
Frequencies for channel 3 & 4 are:
MOTOR34_64KHZ
MOTOR34_8KHZ
MOTOR34_1KHZ

But it didnt help.

Code: Select all | TOGGLE FULL SIZE
`#include <AFMotor.h>AF_DCMotor motor(1, MOTOR12_64KHZ); //int potPin = 8; int val= 0; int motorSpeed = 0; void setup() {  Serial.begin(9600);           // set up Serial library at 9600 bps  Serial.println("Motor test!");   }void loop() {      Serial.println( motorSpeed );   val = analogRead(potPin);     motor.setSpeed(motorSpeed);       // set the speed to 200/255  if (val <= 450){    motor.run(FORWARD);   motorSpeed = map(val, 0, 450, 255, 80);  }  if (val >= 550){     motor.run(BACKWARD);      // turn it on going forward        motorSpeed = map(val, 550, 1020, 80, 255 );   Serial.print(" BACKWARD ");  }    if  ( val >= 450 && val <=550 ){  motor.run(RELEASE);  motorSpeed = 0;   }}`
chisburg

Posts: 6
Joined: Wed Jan 09, 2013 5:24 am

Re: Strange noice (beebing sound) mShield

What kind of motor is it?
What are you using to power it?

Posts: 38724
Joined: Sat Feb 07, 2009 10:11 am

Re: Strange noice (beebing sound) mShield

I am also new to Arduino and the Motor shield from Adafruit and had a similar problem. The Motor test example supplied has the following in the "include" section:

AF_DCMotor motor(4);

Reading the tutorial it indicates that to increase the PMW frequency you need to use outputs 1 or 2, which allows an increase in frequency, and to change the above as follows:

AF_DCMotor motor(2, MOTOR12_64KHZ);

This doesn't work and luckily I have an oscilloscope which proved that this didn't work. Copying this to the setup section however works.

This is most confusing to a newcomer so please update your example.

Mike
intheframe

Posts: 1
Joined: Sat Jan 19, 2013 6:15 pm

Re: Strange noice (beebing sound) mShield

Thanks for the heads up. We'll look into it.

Posts: 38724
Joined: Sat Feb 07, 2009 10:11 am

Re: Strange noice (beebing sound) mShield

Hi,

just saw the last post, I havent managed to get it to work yet, dont know it it will provide any help but ill attach a picture of the motor im using — it comes from a printer.
Attachments
image.jpeg (97.97 KiB) Viewed 547 times
chisburg

Posts: 6
Joined: Wed Jan 09, 2013 5:24 am

Re: Strange noice (beebing sound) mShield

Try the suggestion from intheframe and let us know how it works.

Also, be careful using that motor with the shield. Although the normal running current (0.46A) is within the capabilities of the L293D H-Bridge chips, the stall current (3A) is enough to burn out the chip.

Posts: 38724
Joined: Sat Feb 07, 2009 10:11 am

Re: Strange noice (beebing sound) mShield

Ive started to play around with this again, is it possible to see what current the motor iss made for?

Im powering the shield with a external 12v current. When running the motor it runs slow, when attaching the motor straight to the 12v it runs much faster. Would it be an idea to power it with 24v? I dont understand the numbers printed on the motor — or if it's possible to read anything from it.

Id like to drive 4 of these motors, would that be possible or are they to big for the shield, if so is there any other shield i could use?
chisburg

Posts: 6
Joined: Wed Jan 09, 2013 5:24 am

Re: Strange noice (beebing sound) mShield

The first number printed on the motor is the model number. A google search turns up the specifications here: http://www.mabuchi-motor.co.jp/cgi-bin/ ... D=rs_545ph
It looks like it will handle up to 24v. But the stall current is 3A. What do you want to do with these motors? Do you need both direction and speed control?