Shop OBEX P1 Docs P2 Docs Learn Events
New to motor controll, Building hardware PWM. Typical motor use questions. — Parallax Forums

New to motor controll, Building hardware PWM. Typical motor use questions.

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-10-07 23:54 in Robotics
Ok so this project has steamed from playing with a few different timer chips 555/322/74xx4060 etc. For those of you who have not seen my post in the Bs2 forum, I want to build a hardware based PWM and H-bridge to Control a DC motor. The initial tests will be done on a bs2 but the hardware should work with anything.

Anyways my reasoning for building this instead of using some other solution is mostly to learn, but I also want to start building a robot that rolls around, an turns. Im not sure if I want to do this via 4 wheel 2 wheel drive or what. I would like the robot to be able to travel across the house and hard flat dirt outside. The bot will be small made of erector pieces, about the size of a boe-bot to double its size.

Now i have alot of DC motors around and Ive been testing them out. They strongest one I have tested so far is a radio shack 9-18v, when connected to a 9v it draws about 300mA my other smaller motors draw well under 200mA. I have also pulled the motor out of a piece of junk Ryobi cordless 9v drill, havent tested it yet but im thinking it will be the most sufficient to use for the drive train, if the radio shack motor wont do.

So the PWM im going to build works like this, well say using a 555 for clarity right now, havent decided if thats final or not though.

The 555 circuit will be ran in ASTABLE continuous mode, using the standard 2 resistor 1 diode scheme, this way duty cyle and frequency can be adjusted. The 55 will use a fixed 1% tolerance tantalum capacitor for higher accuracy. The resistors will be a ds1809 digital multi channel potentiometer. A microcontroller will be used to hold the 555 reset pin, when the motor needs to be started the microcontroller will adjust the pots to set the duty cycle then release the 555s reset pin, until the motor needs to be stopped at witch point the ucontroller will hold the reset pin again, and recalculate PWM speed if need be.

Now a standard lm555 can source/sync 200mA. This seems resonable for a small DC motor, but in order to get a powerfull enough drive train im not sure exactly what im going to need in terms of power. My idea was to maybe use a 2n2222 in order to amplify the 555s current output to 600mA and then figure out a solution to flip the motor polarity (i.e hbridge or some other means) hopefully using this single 2n222 as the main current source still.

So I guess what im asking is, is 600mA enough current for most DC motors driving a project like this, and what is the easiest way to flip the motor polarity? Im assuming an h-bridge but i dont understand if I would need an h-bridge rated at 600mA also of if it doesnt matter since im using the 555, 2n2222 combo to provide current to the motor, the h-bridge is just there to flip the direction that crrent supply is moving in. Maybe an hbridge is what i acually need for this project.... Im sorry about my total ignorance of the subject of an h-bridge ive looked up a few schematics but not studied it in detail as my main goal is to get the PWM working first.

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2012-10-02 19:18
    This seems like a lot of work when there are numerous motor controller boards available on the market. First determine what your motor needs, voltage and current. Pololu has an extensive line of motor controllers. Parallax sells 3 motor controllers (plus another for stepper motors). I like the Parallax HB-25 for my larger motors and have used Pololu motor drivers for several smaller robots.

    John Abshier
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-10-03 09:33
    hmmm well I just busted out the motor I want to use and tested it out a its seems like its capable of doing 12 volts at 1.3 amps so 15.6 watts. Does this seem to heavy duty, for a small robots drive train?
  • al1970al1970 Posts: 64
    edited 2012-10-07 23:54
    Hi:

    At this time, you need to learn more before you are able to build something that works. It would take too much time to tell you everthing you need to learn. You will need to look things up to get more info but here are a few things to think about:

    Most small motors I have used work fine with a PWM freq. of about 200Hz. Get rid of the 555 chips and just use a microcontroller. I use PICs and software to run 8 PWM outputs. If you do not know how to write a program that will give you PWM outputs then this would be a good place to start learning. To build a good robot you will need to program well.

    You should also learn to read a data sheet better; most people do not do this well. When it says a device can handle a max .of 1 amp. This doesn't mean if you run it at 1 amp it won't die on you!

    You have to know how many watts it can take and at what temp. Some devices may say it can handle 1 watt but if you read the "fine print" you may find that it can only handle that for 10 secs.
    It may also say it can handle 1 watt at such and such temp. It may take a heat shink or even a fan to keep it at that temp. Bottom line, don't use the 2n2222. They will work only for a very small motor.

    Learn how to use MOSFETs.

    The power it takes to have a robot travel across the house will be much much less then what it will take to run outside. You will need to build a few robots that work well indoors before thinking about building one that works well outside.

    Al


    Ok so this project has steamed from playing with a few different timer chips 555/322/74xx4060 etc. For those of you who have not seen my post in the Bs2 forum, I want to build a hardware based PWM and H-bridge to Control a DC motor. The initial tests will be done on a bs2 but the hardware should work with anything.

    Anyways my reasoning for building this instead of using some other solution is mostly to learn, but I also want to start building a robot that rolls around, an turns. Im not sure if I want to do this via 4 wheel 2 wheel drive or what. I would like the robot to be able to travel across the house and hard flat dirt outside. The bot will be small made of erector pieces, about the size of a boe-bot to double its size.

    Now i have alot of DC motors around and Ive been testing them out. They strongest one I have tested so far is a radio shack 9-18v, when connected to a 9v it draws about 300mA my other smaller motors draw well under 200mA. I have also pulled the motor out of a piece of junk Ryobi cordless 9v drill, havent tested it yet but im thinking it will be the most sufficient to use for the drive train, if the radio shack motor wont do.

    So the PWM im going to build works like this, well say using a 555 for clarity right now, havent decided if thats final or not though.

    The 555 circuit will be ran in ASTABLE continuous mode, using the standard 2 resistor 1 diode scheme, this way duty cyle and frequency can be adjusted. The 55 will use a fixed 1% tolerance tantalum capacitor for higher accuracy. The resistors will be a ds1809 digital multi channel potentiometer. A microcontroller will be used to hold the 555 reset pin, when the motor needs to be started the microcontroller will adjust the pots to set the duty cycle then release the 555s reset pin, until the motor needs to be stopped at witch point the ucontroller will hold the reset pin again, and recalculate PWM speed if need be.

    Now a standard lm555 can source/sync 200mA. This seems resonable for a small DC motor, but in order to get a powerfull enough drive train im not sure exactly what im going to need in terms of power. My idea was to maybe use a 2n2222 in order to amplify the 555s current output to 600mA and then figure out a solution to flip the motor polarity (i.e hbridge or some other means) hopefully using this single 2n222 as the main current source still.

    So I guess what im asking is, is 600mA enough current for most DC motors driving a project like this, and what is the easiest way to flip the motor polarity? Im assuming an h-bridge but i dont understand if I would need an h-bridge rated at 600mA also of if it doesnt matter since im using the 555, 2n2222 combo to provide current to the motor, the h-bridge is just there to flip the direction that crrent supply is moving in. Maybe an hbridge is what i acually need for this project.... Im sorry about my total ignorance of the subject of an h-bridge ive looked up a few schematics but not studied it in detail as my main goal is to get the PWM working first.
Sign In or Register to comment.