Re: convert a DC motor to PWM controlled servo?



If you want to control a DC or stepper motor(probebly a better option) like a servo you can convert it into a one. All you need to do is mechanicly attach a pot to the motor, include that pot into an oscilator circuit. Then compare the oscilator output to the input pulse width(technicly not PWM more a changing a pulse with into an angular postion). Then you move the motor in the correct direction to remove the error between the pulse widths(i.e. the input(your signal) and the oscilator output(current motor postion). Like the earlier poster said though you could just buy a servo. Unless you want to use it for something big. But basicly thats what servos do. The actual electronics could be a bit of a project tho since it won't be some little DC motor. There would need to be all kinds of signal condtioning unless you were gonna use a seperate power supply(for control equipment), cos a big motor jittering about would reset any micros. So you'd probebly need to do it all hardwired. Unless you use 2 seprate supplys. Then again if you did use a stepper maybe that wouldn't be such a problem. Sorry I've probebly been no help. Go there

http://www.seattlerobotics.org/guide/servos.html but I think thats what you were meaning yes?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
andy snipped-for-privacy@yahoo.com (Dervish) wrote in message
The problem is that this is a small toy that has motors/gear boxes already mounted and it isn't worth it to redesign it with steppers/encoders, etc.
I want to be able to send a PWM signal on 1 of 5 lines to control the motors. Send motor1 a 1ms pulse, and it turns to 0 degrees. Send it a 2ms pulse, it turns to 180 degrees. like RC servos
I don't want to tie up the CPU on the robot up with the actually positioning of the motors. Id like a circuit that has the same function of a R.C. servo. You give it a pwm signal, and depending on the width of the pulse, the motor will spin to a certain angle....
I could do this with a PIC and 5 Hbridge chips. I don't have a PIC programmer.
The PIC would take either PWM signals as input (or maybe send the desired rotations as digital data (serially)), then convert the PWM signal or data into the correct signal to send to the Hbridges.
This would involve attaching a potentiometer to each gearbox. No big deal.
I could control all of the motors with my CPU using the potentiometer/capacitor combination to give feedback to the CPU. The CPU could get the current rotation reading from the RC circuit, and send the appropriate FD/RV signal to the motor, but this ties up CPU and takes quite a few I/O pins. 5 for the pots, 10 for the Hbridges. 15 I/Os and it eats cpu time. rephrase that. It leaves no time for the CPU to do anything else.
so I would like to convert the motors to servos. Take 5 I/O lines if the motors acted as servos, IE 1 PWM output per servo.
Even better would be to send a PIC or other embedded processor the angle in degrees, and it would move the motor to the correct angle. If you could send the angles for all 5 of the motors at once, and have them all moving at different SPEEDs, that would be awesome. I don't even know how to start looking for a product like this. I can code in PIC assembly no problem, but I don't own a programmer. I think this would fix my problem.
1)send PIC the motor#/PWM (or desired angle)
PIC gets feedback from R/C circuit and controls H-bridge to turn the motor to the correct angle.
It would be great to be able to read the current positions of the R/C circuit through the PIC also.
seems like someone would have designed something similar.
Anybody know where to look?
Rich
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I have a friend who is doing basicly what you want with pure logic chips (dunno why he isn't using a PIC or micro controller). He's developed a system which converts a pot(feedback) into a bin number compairs that with a given position and covers all the control (PID I think). I'm in my final year at university as is he. His project is using a (3 amp) stepper motor to do what you want basicly. We've got about 2 weeks to write our thesis and when he's finnished his I could see if I could get a copy to send you.
Your idea of seperating the feedback and the control of the servo sounds interesting though because you could have any kind of PID control you liked even activly change control parameters.
Looking into it a bit more though you would need to sample the pots constantly to provide speed information. In a servo it's done via the back EMF. Don't know perhaps you've thought about it already.
In my project I've used the timer module of an HC(S)12 to control the servo. It doesn't require any updating just sits ticking away supplying the pluse. Then when you put in a new number(new postion) to a certain register the pulse width changes. I'm sure there are some PIC's which have these too though. Or you could just buy a servo controller. I still don't know why if it's not an issue of size you don't want to just use a RC servo.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.