Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Robotics Chat


Robotics Chat Specific to discussions about robots and the making of.

Reply
 
Thread Tools Display Modes
Old 9th April 2008, 05:56 AM   (permalink)
Experienced Member
desijays is on a distinguished road
Default controlling a pair of motors

I need to control a pair of motors using a PIC16f877a for one my projects.

The motors would be subjected to an approximate load of 1200 grams to 2000 grams and they would be required to move forward, backward and should be able to respond to commands from the PIC on a dime.

I would like to know, what kind of circuit I should be using. I have heard about H-bridge. And I have seen a few here and there. But Im not sure which one to use. Any recommendation with regards to what motors I could use for this purpose would also be helpful.

I know my question seems very vague and generic, but Im not much of an electronics guy. I come from a computer science background.

Thank you.
__________________
A scientist trys to see the world the way it is
An enginneer trys to see a world that has never been
desijays is offline   Reply With Quote
Old 9th April 2008, 06:54 AM   (permalink)
Experienced Member
petrv will become famous soon enough
Default

I think first you have to choose your motor. Look at the information about your motor, how big current it will use under the load and which voltage it needs... then you can use this information to choose a suitable H-bridge. There are many ICs which are integrated H-brigdes - the one often mentioned here (SN754410) is for small motors max. 1A current, there are bigger like L298, L6203 or LMD18200. If you need higher current than 4-5A you will probably have to build the H-bridge with MOSFETs and a MOSFET driver.
I have seen a H-bridge with HIP4082 and RFP3055LE (11A) but if needed you can use MOSFETs rated for even higher currents.

Petr
petrv is offline   Reply With Quote
Old 9th April 2008, 07:53 AM   (permalink)
Experienced Member
desijays is on a distinguished road
Default

I have a motor with me but unfortunately, the make and name of the motor is not mentioned anywhere on it. I am posting pictures of the motor im talking about. Please check it out. Im using a third party hosting website. I hope its alright.





I just bought it from a local store for 40 bucks. It is a small motor. I think its a DC motor. As I mentioned earlier, both the motors will be subjected to a total load of 1200 grams to 2000 grams. So each motor will be subjected to a load of 600 grams to 1000 grams. If I can be recommended any other motors for this purpose, that would be fine as well.
__________________
A scientist trys to see the world the way it is
An enginneer trys to see a world that has never been
desijays is offline   Reply With Quote
Old 9th April 2008, 09:11 AM   (permalink)
Experienced Member
zanes has a spectacular aura about
Default

You'd be better off with the tamiya double/twin gearbox I suspect, would save the hassle of building a gearbox and mounts.
See here;
http://www.pololu.com/catalog/category/34
zanes is offline   Reply With Quote
Old 9th April 2008, 11:57 AM   (permalink)
Experienced Member
desijays is on a distinguished road
Default

Quote:
Originally Posted by zanes
You'd be better off with the tamiya double/twin gearbox I suspect, would save the hassle of building a gearbox and mounts.
See here;
http://www.pololu.com/catalog/category/34
109$!!. Isn't that a tad too expensive? Well, yea, it comes with almost all that I need.

I was thinking more along the lines of getting some kind of circuit(H-bridge for example) to control the two motors I already have.

I'll try to dig up the specs of the motor I have, so I can be suggested a circuit that can control them. I'll specify the details as soon as i can dig up their specifications.

Thanks
__________________
A scientist trys to see the world the way it is
An enginneer trys to see a world that has never been
desijays is offline   Reply With Quote
Old 9th April 2008, 12:37 PM   (permalink)
Experienced Member
zanes has a spectacular aura about
Default

I was more thinking the 3rd item down that page.
zanes is offline   Reply With Quote
Old 9th April 2008, 12:46 PM   (permalink)
Experienced Member
petrv will become famous soon enough
Default

Anyway if you have the motors you can take your multimeter and measure the current your motor needs - try measure free running, with the load and stalled.
Assuming you will power your motor with the correct voltage ... then you can choose the h-bridge accordingly.
petrv is offline   Reply With Quote
Old 9th April 2008, 12:55 PM   (permalink)
Experienced Member
zanes has a spectacular aura about
Default

The OP will still need to use a gearbox
zanes is offline   Reply With Quote
Old 9th April 2008, 02:00 PM   (permalink)
Experienced Member
mashersmasher will become famous soon enough
Default

if you have the cash maybe you can hack up some hobby servos for full rotation. they already have all the gears and make for excellent small robot propulsion. also they only need one i/o pin so that's always a plus
mashersmasher is offline   Reply With Quote
Old 9th April 2008, 10:46 PM   (permalink)
Experienced Member
mneary is a glorious beacon of lightmneary is a glorious beacon of lightmneary is a glorious beacon of lightmneary is a glorious beacon of lightmneary is a glorious beacon of light
Send a message via AIM to mneary
Default

One source for servos already designed for continuous rotation is VexLabs. The motor kit stalls at 6.5 in-lbs and no-load 100 rpm, meaning a pair of these (with 4" wheels) could accelerate in about 3-4 seconds and run straight at up to 20 inches per second (on level smooth surface). There's a chart on the website with recommended gears for your chosen speed, and of course slower means more torque.

[edit] One nice thing about these motors is the slip clutch (that green thing on the shaft) which reduces the risk of burning it out. [\edit]

Last edited by mneary; 9th April 2008 at 10:53 PM.
mneary is offline   Reply With Quote
Old 13th April 2008, 04:32 PM   (permalink)
Experienced Member
desijays is on a distinguished road
Default

I went out and got myself an L298N h-bridge controller. My plan is to get the hang of controlling a motor using the L298 using PWM before getting the motors I would need. As the "rat motor" I am using the motor; pictures, of which I have posted above to test out the pwm.

I know the 16f877a has 2 PWM modules, but I thought for now, just to get the hang of it, to code the PWM in software. So this is what I did. I read up on PWM theory. Armed with that knowledge, I coded a PWM routine with period cycle of 1 second. Since this was my first tryst with pwm, I set it at 50% duty cycle. I expected the motor to run for 500ms and do nothing for another 500ms.

But when I loaded the program and everything the motor did not move at all. But I heard some ticking noise coming from the motor. When I touched it, I felt vibrations at half a second pulses. And then when I pressed hard on the terminals of the motor that lead to the power supply, it started rotating at half a second pulses. When I removed my hand again, the motor stopped rotating but the vibrations were still there. Whenever I had my fingers on the terminals of the motor, it would conform to the pwm. I know its not a case of loose connection or anything. I don't know whats happening.

Anyone know what it is?

And could someone guide my to a tutorial or some article dealing with how to use the PWM module in 16f877a. I read the datasheet but it wasn't exactly clear.

Thank you
__________________
A scientist trys to see the world the way it is
An enginneer trys to see a world that has never been
desijays is offline   Reply With Quote
Old 13th April 2008, 04:44 PM   (permalink)
Experienced Member
 
Blog Entries: 4
blueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to behold
Send a message via Skype™ to blueroomelectronics
Default

The PWM project might help a little.
http://www.blueroomelectronics.com/p...s/Projects.htm
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now   Reply With Quote
Old 13th April 2008, 05:10 PM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Quote:
Originally Posted by desijays
I went out and got myself an L298N h-bridge controller. My plan is to get the hang of controlling a motor using the L298 using PWM before getting the motors I would need. As the "rat motor" I am using the motor; pictures, of which I have posted above to test out the pwm.

I know the 16f877a has 2 PWM modules, but I thought for now, just to get the hang of it, to code the PWM in software. So this is what I did. I read up on PWM theory. Armed with that knowledge, I coded a PWM routine with period cycle of 1 second. Since this was my first tryst with pwm, I set it at 50% duty cycle. I expected the motor to run for 500ms and do nothing for another 500ms.

But when I loaded the program and everything the motor did not move at all. But I heard some ticking noise coming from the motor. When I touched it, I felt vibrations at half a second pulses. And then when I pressed hard on the terminals of the motor that lead to the power supply, it started rotating at half a second pulses. When I removed my hand again, the motor stopped rotating but the vibrations were still there. Whenever I had my fingers on the terminals of the motor, it would conform to the pwm. I know its not a case of loose connection or anything. I don't know whats happening.

Anyone know what it is?

And could someone guide my to a tutorial or some article dealing with how to use the PWM module in 16f877a. I read the datasheet but it wasn't exactly clear.
You might try my PWM 'tutorial', it was written to do just what you want, forward and reverse, plus speed control, for two motors.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 13th April 2008, 07:30 PM   (permalink)
Experienced Member
petrv will become famous soon enough
Default

Hard to say what is your problem with the L298 PWM and H-bridge without seeing the schematics, maybe you can post it, the code can help as well. By the way, be sure not to leave out the protection diodes.

Petr
petrv is offline   Reply With Quote
Old 14th April 2008, 06:54 AM   (permalink)
Experienced Member
desijays is on a distinguished road
Default

Quote:
Originally Posted by blueroomelectronics
The PWM project might help a little.
http://www.blueroomelectronics.com/p...s/Projects.htm
Quote:
Originally Posted by Nigel Goodwin
You might try my PWM 'tutorial', it was written to do just what you want, forward and reverse, plus speed control, for two motors.
Thank you very much. That should help. I will look into them both
__________________
A scientist trys to see the world the way it is
An enginneer trys to see a world that has never been
desijays is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
controlling fan motors using pic16f84a farasue Electronic Projects Design/Ideas/Reviews 2 4th March 2008 02:36 PM
Controlling Switches and Motors via Parallel Port JobbinJP General Electronics Chat 37 16th March 2007 05:50 PM
PIC16F627 - controlling motors drage Micro Controllers 8 22nd October 2006 11:39 AM
controlling hard disk motors using lpt kariem2k General Electronics Chat 2 14th December 2003 08:56 AM
Qbasic program for controlling stepper motors I wrote one ElectroGeek_87 General Electronics Chat 1 5th October 2003 05:19 AM



All times are GMT. The time now is 02:14 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.