PDA

View Full Version : contorlling a pair of motors



robosapien
04-09-2008, 05:45 PM
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.

superchiku
04-09-2008, 09:17 PM
man there is a fair deal of electronics lik AEC AND DEC microprocessors ... in computer science , that phrase just seems as an insult to the subject...

yes you can control ur motors by using something known as a hbridge . U can make ur own hbridge or buy a chip called as l293d or l298 which are both hbridge chips . look in the datasheet on how to use the chips

and abt the motors , use any kind of geared motor in between 200-300 rpm for ur application

robosapien
04-10-2008, 12:45 PM
Could you please tell me, what difference it makes whether I use a geared motor or ungeared motor as long as the rpm is 200 to 300?

I most probably will be going for a hbridge chip instead of making my own. Could you tell me the model or part number of the motor to buy that will be suited to this purpose because there are a lot of motors that come in the 200 to 300 rpm range.

Thank you

superchiku
04-10-2008, 06:14 PM
well this is basic mechanics if u dont get geared motors, ull end up with motors which have a very high rate up rpm but do not develop enough torque to drive an appreciable load and if ur dc motors have a rating of under 600 ma draw of current each then go for l293d chip which costs around rs 100 , if ur motors have a higher rating then go for l298 chip which have a current rating of 2A l298 will cost around rs 200

robosapien
04-11-2008, 01:50 PM
May I ask, how do I find out the rating of a DC motor. Most of the motors I seem to find, don't have any label or any kind of info detailing their voltage and power ratings.

Or is there some kind of standard shop where I can buy standard motors that have their power ratings, rpm and various other specifications well detailed?

I live in bangalore, so Im sure there will be standard vendors who cater to this sort of requirements.

superchiku, thanks so far, for clearing a few of my doubts .

superchiku
04-11-2008, 02:09 PM
well u just have to ask the vendor for geared motors and their ratings normally 100 rpm motors are rated at 330 ma and 12v operation but there are 6v motors too..

robosapien
04-13-2008, 10:07 PM
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 a cheap 40 Rs DC motor just to test out the pwm.

I know the pic16f877a 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 I be guided to a tutorial or some article dealing with PWM in 16f877a. I read the datasheet but it wasn't exactly clear.

Thank you

superchiku
04-14-2008, 01:34 AM
datasheet's can only make you clear if you already have some basic knowledge about the registers otherwise they are a piece of junk to the beginners

secondly the problem of your motor getting activated when you touch the terminals may be due to loose connection..

thirdly a duty cycle of 1 s is way to high to produce effective pwm. The total duty cycle should be within a range os milli seconds for effective pwm.

Fourthly , the frequency does matter , in your datasheet you will see the effective frequency which you want depends on a number of factors you set . So you have to calculate the frequency effectively suiting your needs for the specific type of pwm you are using..

Since your using pic this is as much as i can help you coz i never used PIC bfore , so for code examples look in the internet

robosapien
04-14-2008, 02:49 PM
secondly the problem of your motor getting activated when you touch the terminals may be due to loose connection..

i assure you, I don't think its because of a loose connection. Because I checked and double checked the wires. They were well in contact with the terminals of the motor.




thirdly a duty cycle of 1 s is way to high to produce effective pwm. The total duty cycle should be within a range os milli seconds for effective pwm.

May I ask, then, how do we find the appropriate period cycle for a particular piece of hardware? Cos again the period cycle would vary for an LED and would be in the range of micro seconds.




Since your using pic this is as much as i can help you coz i never used PIC bfore , so for code examples look in the internet

What controller do you use?

superchiku
04-14-2008, 03:12 PM
May I ask, then, how do we find the appropriate period cycle for a particular piece of hardware? Cos again the period cycle would vary for an LED and would be in the range of micro seconds.


let it be led or motors the first thing u have to find out is the operating frequency, you have set your duty cycle according to the operating frequency mostly in the range of milli seconds


assure you, I don't think its because of a loose connection. Because I checked and double checked the wires. They were well in contact with the terminals of the motor.


some times what happens is that when you touch the terminals with your fingers when the power is on a kind of continuity is achieved and the component gets power . Have You ever tried to touch the terminals of a led when one of the leads is connected the ground , it glows faintly ... why exactly it happens i dont know




What controller do you use?



i mostly am dependant on avr microcontrollers

RoboticMax
04-23-2008, 04:12 PM
i have a robotic gokart that i built and am planning to use a servo motor to activate a simple drum brake by pulling a cord with the servo horn. Is a standard futaba enuff or should i go for a linear solenoid actuator?
please help

allbits
05-06-2008, 01:43 PM
Futaba 3003 is not enough.

Calculate the approx torque you might require.
the torques that are mentioned in the servo are the stall torque, not the typical safe running torque.

RoboticMax
05-18-2008, 10:13 PM
wat is stall torque and wat is safe running torque?

allbits
05-21-2008, 10:30 AM
in simple terms, the torque delivered at stall. Run a servo motor, hold it (that the horn is no longer in motion) (not for long :D ) and the torque you feel is the stall torque.

OR, for a horn of length 1cm, 5 Kg suspended at the end, and if the motor stops.. got it??


And, if it were a 1 Kg weight suspended at the end, the motor would still rotate, or run.

hope you got the idea.