New to motor controll, Building hardware PWM. Typical motor use questions.
rwgast_logicdesign
Posts: 1,464
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.
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 Abshier
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