PWM generation details

Hi , I am new to this group i have developed a mobile robotics platform with wheels and tank track and a differential drive , i had
a electrical control system at first now i want to adapt it to a 8051 microcontroller ( P89V51RD2FN ) , what do i need to know about PWM to get accurate movements and control the robot , i don't have any shaft encoders currently i am planning to use proximity sensor input to make a behaviour based robot ...
Regards Deepak
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
dbbarua wrote:

PWM is a technique that allows smooth changes in motor output, using simple on/off switches. This is achieved by switching faster than the mechanical system can respond, such that the mechanics smooth out the switching to average the switch state.
Sensor feedback (such as from shaft encoders) is required for accurate movement; but for simple tasks it is often sufficient to make a few measurements such as "75% PWM is about X[m/s]" and base your control on that.
Later, Daniel
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

The point of PWM is not that you can use on/off switches. The most common "switches" used in motor drives are transistors and are quite capable of operating in linear mode to achieve speed control. However, doing that is inefficient because it's essentially the same as using a big variable resistor.
Further, low frequency PWM is not a great idea. Driving motors with pulsed current makes them whine annoyingly and may cause damage. It is also less efficient because the pulsed nature of the current results in greater resistive losses in the windings. Ideally you operate PWM drives at a sufficiently high frequency that the current is smoothed by inductance. In this mode, the motor driver is essentially a variable dc-dc down-coverter. The "inductance" here can actually be the windings of the motor but in that case you cannot use noise suppression capacitors.
You'll never be able to get precise speed control without feedback, but in the case of treads, even precise speed control doesn't translate to precise dead reckoning.
-chris.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Also, you can use one bit per motor rather than enough bits to get the desired resolution.

I think you misread his post as suggesting that you sit there toggling a physical switch back and forth with your index finger. He pretty clearly meant something that could be switched "fast enough" to work well, though he focussed on the mechanical system's response speed rather than induction.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Joe Pfeiffer wrote:

Generally PWM rates are in the audio range, from hundreds of hertz to hundreds of kilohertz. The trend is towards higher frequencies, outside the human hearing range. See the Atmel ATA6831, which is a dual PWM driver for automotive applications designed to run at up to 25KHz.
This is for brush-type DC motors. There's also polyphase PWM, where several phases are driven separately and in sync with motor rotation. Brushless variable-speed motors are driven that way. This requires more elaborate drive electronics but is more efficient.
These things are actually quite difficult to design well. They have to deal with brush noise, inductive kickback, short circuit and overcurrent protection, and thermal protection. The ones designed for RC motor speed control are usually quite good at current capacity, efficiency, and protection, but dumb - no feedback or computer interface. The ones designed for hobbyist robotics tend to be smarter, but bigger and not as good on protection circuitry. The ones for industrial motor control are all over the place; some are very robust, and some are underdesigned, and they're all much bigger and more expensive than the R/C units of comparable current carrying capacity.
It's still harder than it should be to get small, fully-protected motor controllers with encoder feedback at low cost.
                    John Nagle
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

No. This is not a matter of "fast enough". Inertial and inductive averaging of pwm driver output are different processes, use different switching rules, are described by different math, and he pretty clearly explicitly named the former. A small dc motor driven with a 50% duty cycle at 1khz will behave quite differently from the same motor driven at 20+khz, and for most robotics applications you want the latter behavior. The low frequency pwm response won't even be linear.
-chris.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
For the first time in history , we have everything
we need , everything is far faster than needed .
Yet some people still use PLL , P.I.D. loops ..
It's job security . They can take it from the
electronics "books" , all of which are obsolete .
We use faster ARM mcu's , with adaptive
circuits , nixing the slow an old Proportional
integ , dir' loops .
instead of loops , we measure the motor
and slam it with a square wave and the result
is predictable movement , thus no need to
put it in a control loop . less circuitry .
Added to that motor are linear motors and
brakes that decrease it's inertia . mcu's easily
handle the brakes and linear motors .
But it dont work if we "study" engineering
from text books . this is Luddite , job security
for college professors .
In the future , there will be no income for
textbook engineers , since the public will be
paying "directly" , for what they need .
No more govt control of what is sold .
Make one tiny mistake , and you're branded
a fool .
It amases me , how long our industrial
robots did NOT evolve !
Luddites claimed they used the most modern
engineering ! Cant be improved !
Linux , WXP , the PC , cars and trucks
stepper motors , PIC mcu's , Cell Phones ,
Campbels chicken soup , taxi's , doctors
hospitals ...all obsolete , will not be used
past 2030 !
There will be NO textbooks to "learn" from . No colleges , no professors . No engineer will "teach" ..
It's the future ..

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.