Yes, shorten the duty cycle to slow down, lengthen to speed up. As far as knowing the generated voltage, it all depends on how precise you need to be. I did not need to be that precise, just maintain high torque at low speed so I *guessed*. My motor was rated 5000 rpm at 12V so I *assumed* that the generated EMF would be 12V at 5000 rpm. I also assumed that the generated voltage was linear (i.e. 6V = 2500 rpm). Now, please note all the assumptions. IF YOU NEED HIGH PRECISION DON'T DO THIS! You might be able to spin the motor at various speeds and measure the voltage to make a more accurate determination. The description of my feedback circuit is attached, if you want more details or a picture I can dig up a schematic. I found the RC low pass filter described to be adequite for my needs. The waveform I observed looked like a full wave rectified sine wave so the capacitor smoothed that out nicely. I was originally skeptical of this approach myself, but I tried it and it worked! Thanks Scott -----Original Message----- From: Justin Grimm [mailto:Justin.Grimm@SOUTHCORP.COM.AU] Sent: Tuesday, August 27, 2002 3:12 AM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [EE]: DC motor control First of all thanks everyone for your replies. I think when I get access to the internet I'll check out the servo motors. In the meantime though this method of pwm then sampling the generated voltage intrigues me. I want to deliberately control the speed, so if I'm generating say a 50% duty cycle pwm, and I want to slow the motor down, I just shorten the duty cycle then read off the inferred speed (generated voltage) and if its not slow enough shorten the pwm again. Is this correct? Is there a easy way of knowing what the generated voltage would be? Thanks Justin "Scott M. Thomas" wrote: > > I bit banged a PWM routine (several bits of sample code available on > piclist.com under I/O routines) then immediately before turning on the > output transistor I measured the voltage at the motor using the A/D > module. > I used this measured value to adjust the duty cycle up or down. Worked > pretty well. All I did for a feedback circuit was a 10k resistor from the > drain of the transistor to the RA0 input with a 6.8k to ground to divide > the > voltage down and a .33uF cap to ground to smooth out the waveform. I was > running at about 150 Hz so I had lots of time to measure and do > calculations. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.