Thomas N wrote: > > I am a bit confused. Let's say I have: > > +5V---0/ 0--------(0)-------/\/\/\------------| | | ---------|<-------------- > +5V switch motor Sense Resistor Ground diode > Let's say the switch is closed and the motor is running, then suddenly I > open the switch, should the voltage drop across the sense resitor be at 0 > mA? If not, where is the current comming from? > > I am planing to use PWM (open and close the switch) at around 10Khz. How to > I measure the average current flowing thru the motor while it is running > accurately? First add the diode if you are using PWM on a motor that has inductance (that's all of them!). Thomas, search the net for "Jones on steppers" he has a very nice tutorial that covers motor controlling, and the "constant current" chapter applies to all motors, not just stepper motors. Well worth reading if you plan of getting good performance from any motor. -Roman PS. Start your PWM experiment at a SLOW speed first. This will be easier to control and measure. Once you speed it up to 10kHz you start to get quirky things like effects from switching speed limits of the transistor and diode, and switching surge losses get much higher. It might work great at 500Hz but cook parts at 10kHz. :o) -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu