It is unclear from the description above how you had the oscilloscope probe connected to your motor. It sounds like you might have had the ground lead of the oscilloscope connected to the motor, which could potentially damage things (including your scope). Could you post a picture of how you had it connected?
I think about the effect of braking this way, but I may be wrong.
During the PWM off period, braking slows down the rotor quickly (much more quickly than coasting), so during the next PWM on period, you have less back EMF to counter and consequently, can drive more current into the windings, generating greater torque.
[quote=“Jeremy”]It is unclear from the description above how you had the oscilloscope probe connected to your motor. It sounds like you might have had the ground lead of the oscilloscope connected to the motor, which could potentially damage things (including your scope). Could you post a picture of how you had it connected?
Yes, that’s exactly how I had it connected. So that be bad, huh? Doh! I guess I can see that now. I told you I was a newbie at this. Ok, I will connect the ground lead to gnd going forward. The scope seems fine so far, I hope I didn’t damage it.
Any comment on the wave I was seeing? And can you explain how braking works, electrically? Jim’s explanation as to how braking allows the motor to go faster at lower PWM frequencies sort of makes sense to me (thanks, Jim!), but if the motor is slowed down during PWM off, it will have more inertia to overcome during PWM on…
Since you were measuring across the motor outputs with your oscilloscope, I am not sure how valid those screen captures are. If you post new captures, I might be able to comment on the shape of the signal.
For more infomation about the differences between drive-brake and drive-coast modes, you might find this post helpful.
No, they’re not valid, except inasmuch as they show a difference between having braking on and off. I think the “down” part of the wave was the back EMF the motor was producing while coasting after the PWM duty cycle post. With braking on, that pulse was absorbed by the motor. This was very enlightening to me - thanks! I am going to study that link you sent. I’m trying to understand how to figure out what the best PWM frequency is for my application (and if it matters). I’m using a circuit I built around a CNY70 photodiode, in conjunction with a white stripe painted on the wheel the motor turns, to measure RPMs. What I see is that the RPMs steadily increase until about 240 (out of 255) duty cycle, and then it goes down. It does this for most PWM frequencies, except for very low ones. Very strange! Especially since a 255 is “full on” and should be the same wave no matter what the PWM frequency. I am not at all sure my measurements are accurate, but that’s what I’m consistently seeing.
We generally recommend using higher PWM frequencies (above 20kHz) to eliminate audible noise from the motor.
Are you measuring a higher speed at 240 than at 255? If so, I suspect your measurement is not accurate. What are you using to read your photodiode and how are you outputting the speed reading? Could you post a sample of the readings?
Never mind, I figured it out. Agreed, as expected, the numbers were not accurate. I was measuring by using a CNY70 phototransistor circuit on a board clamped to the motor housing. I finally realized it was very slightly touching the motor wheel as it spun, which seemed to affect the RPMs at higher speeds more than lower. When I reattached the measuring device with a different clamp, I started getting a nice solid linear relationship between PWM voltages and RPMs.