Strange noice (beebing sound) mShield

by chisburg on Wed Jan 09, 2013 4:48 am

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
  if  ( val >= 450 && val <=550 ){
    //Serial.print("middle");
  motor.run(RELEASE);
  }


How can i solve?
chisburg
 
Posts: 6
Joined: Wed Jan 09, 2013 4:24 am

Re: Strange noice (beebing sound) mShield

by adafruit_support_bill on Wed Jan 09, 2013 5:40 am

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
User avatar
adafruit_support_bill
 
Posts: 25601
Joined: Sat Feb 07, 2009 9:11 am

Re: Strange noice (beebing sound) mShield

by chisburg on Wed Jan 09, 2013 6:58 am

Thanks for fast answer.

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
#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 4:24 am

Re: Strange noice (beebing sound) mShield

by adafruit_support_bill on Wed Jan 09, 2013 7:04 am

What kind of motor is it?
What are you using to power it?
User avatar
adafruit_support_bill
 
Posts: 25601
Joined: Sat Feb 07, 2009 9:11 am

Re: Strange noice (beebing sound) mShield

by intheframe on Sat Jan 19, 2013 5:32 pm

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 5:15 pm

Re: Strange noice (beebing sound) mShield

by adafruit_support_bill on Sun Jan 20, 2013 6:02 am

Thanks for the heads up. We'll look into it.
User avatar
adafruit_support_bill
 
Posts: 25601
Joined: Sat Feb 07, 2009 9:11 am

Re: Strange noice (beebing sound) mShield

by chisburg on Tue Jan 22, 2013 4:15 am

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
image.jpeg (97.97 KiB) Viewed 477 times
chisburg
 
Posts: 6
Joined: Wed Jan 09, 2013 4:24 am

Re: Strange noice (beebing sound) mShield

by adafruit_support_bill on Tue Jan 22, 2013 6:54 am

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.
User avatar
adafruit_support_bill
 
Posts: 25601
Joined: Sat Feb 07, 2009 9:11 am

Re: Strange noice (beebing sound) mShield

by chisburg on Sat Feb 16, 2013 7:11 am

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 4:24 am

Re: Strange noice (beebing sound) mShield

by adafruit_support_bill on Sat Feb 16, 2013 8:08 am

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?
User avatar
adafruit_support_bill
 
Posts: 25601
Joined: Sat Feb 07, 2009 9:11 am

Re: Strange noice (beebing sound) mShield

by chisburg on Sun Feb 17, 2013 4:31 pm

sorry, i realize that i could have googled the number myself, but i now understadn what stall current is. The idea is that each motor should winch a fishing line with a flourocent light tube attached. So i only need the direction. SHould i try find another shield or look for other motors? I dont want to burn the bridge.
chisburg
 
Posts: 6
Joined: Wed Jan 09, 2013 4:24 am