Shop OBEX P1 Docs P2 Docs Learn Events
PWM Motor control Question! — Parallax Forums

PWM Motor control Question!

Jimbo30Jimbo30 Posts: 129
edited 2010-04-18 22:23 in BASIC Stamp
Previously I tested a PWM signal using a 1uF and a 10K ohm combo using a 5v motor and I was able to control the speed very well.· However, I am testing and attempting to now use the 12V motors for my project and the PWM signal is not working very well.· I was reading through the Basic Stamp reference manual and it is suggesting, "How long the capacitor will hold the voltage depends on how much current is drawn from it by external circuitry, and the internal leakage of the capacitor."· Currently I have my charge time at 50ms set up from the previous test with the 5V motor and I am wondering if the rule of thumb is to decrease or increase the charge time?· ANY insight or suggestions would be appreciated.· I am finding out motors are·a pain to work with.··shakehead.gif

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2010-04-17 17:51
    Are you saying you were driving the motor directly from the Stamp pin?

    What type of drive circuit is used to provide the high current needed by the motor? The Stamp definitely can't do it without a transistor to do the current switching.

    Perhaps a sketch would help us help you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-04-17 19:18
    Stamptrol -- nope, I am using a motor driver from Solarbotics presently and I attached a picture so you can get a better idea.· My input voltage for the motors is 13.2 Volts
    1632 x 1232 - 356K
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-04-17 21:34
    I seemed to have figured it out and found the right combination of resistor/capacitor for a better charge time more suited for the motor I am using.···
  • stamptrolstamptrol Posts: 1,731
    edited 2010-04-18 01:33
    Good, good. What you're doing with the PWM command is digitally creating an analog voltage for the motor driver to use. See the Stamp Help files in the editor for more info.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2010-04-18 02:01
    Jimbo30,

    That's not the proper way to drive that motor controller.... The PWM command from the Stamp is designed to create an analog reference through a resistor and capacitor as you have done, and not directly drive a motor. The motor controller from Solarbotics expects a digital signal and what you are giving it is an analog signal... probably causing it to operate in it's linear mode and it's most likely getting HOT. The motor controller from Solarbotics can take a PWM signal, but not the type of signal generated from the Stamp.

    Reference:
    http://www.solarbotics.com/products/k_cmd/resources/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-04-18 22:19
    Beau,

    Thanks for your feedback, but I got it·to work last night after I realized·my silly mistakelol.gif·· I am sending the PWM signal to the enable pin of the solarbotics·board for speed·and, of course, digital signals to the logic pins for motor direction and motor braking.··It works great!






    Beau Schwabe (Parallax) said...
    Jimbo30,

    That's not the proper way to drive that motor controller.... The PWM command from the Stamp is designed to create an analog reference through a resistor and capacitor as you have done, and not directly drive a motor. The motor controller from Solarbotics expects a digital signal and what you are giving it is an analog signal... probably causing it to operate in it's linear mode and it's most likely getting HOT. The motor controller from Solarbotics can take a PWM signal, but not the type of signal generated from the Stamp.

    Reference:
    http://www.solarbotics.com/products/k_cmd/resources/

  • Jimbo30Jimbo30 Posts: 129
    edited 2010-04-18 22:23
    I even made a makeshift heat sink and put a small fan so I should be able to use these solarbotics H-bridge boards for what I am doing. I don't know it works great so far and that's all that matters, I guess.
Sign In or Register to comment.