[solved] problem! PWM, DC MOTOR!

Hi.

I made a circuit with L293(H-BRIDGE).
so I can support external power to my dc motor.

my circuit likes itp.nyu.edu/physcomp/Labs/DCMotorControl 's one.

i use analogWrite() function to control my DC motors speed with PWM.

but it doesn't working.

My motor just makes high frequency beep sound and do nothing at all.

What i have to do make motor do right way?
(my dc motor works find directly connected 3V battery. )

thank you.


[solved]
in my case,

  1. my motor was desigend for use with 3v battery.
  2. i found that it requires PWM value over 80.
    (analogWrite(PWM_PIN, over 80))
  3. over 80, i turned it with my hand and it started and run itself.
  4. change battery 3v ->9v, it starts turning by itself.

i guess.
maybe it is simmilar to AC. (-,+ -> 0,+).
the reson why i need to more power to running it self is power shrinking.(LIKE DC->AC)

Not sure if I can help much, but it sounds like you have the PWM part working, That's probably what's making the motor beep. PWM can do that. You might need to change the figures in the part of the code that sets the PWM ratio. The PWM frequency needed varies with different motors & it's usually trial and error to get it exactly right.
You should probably post your sketch on this forum so more experienced eyes can look at it

i'm just use analogWrite() function like

#define PWM_PIN 9

void setup() { }
void loop
{
analogWrite(PWM_PIN, 255);
}

i use really simple code for speed control test.

but whatever i use the value for duty, motor doesn't work.

I'm going to try change PWM ratio.

Im new, and only have an arduino on order, but The question that comes to my mind is whether your DC motor has specs, and if so if the motor accepts or can run off 5v.

The high pitch squeal could be eminating from the coil being underdriven and unable to turn the rotor.

Just a thought and attempt at being helpful in my first post! :slight_smile:

Is your software initialising the PWM_PIN as an output, I don't see it in setup().

If it is left as an input that could cause the L293(H-BRIDGE) to not switch properly.

The other thing is you have to set the other inputs to that chip correctly or else the drivers are not enabled. Are you doing that?

Finaly are all the grounds of the power supplies connected together?

Hm.....

absoultly, i did all of thing you say to me.
(i'm just edit pintMode(PWM_PIN, OUTPUT) out for simplify code.
in my sketch, pinmode function was written.)

leave all of my cicuit and change dc motor to LED, it works very well.
(external power supply, directional switch such that.)

anyway, thank you for your answer.

If it works with an LED but not a motor then your problem is power supply decoupling.
Here Is something I wrote about it:-

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html