Searching \ for '[PIC]: PWM motor control from frequency measuremen' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=motor
Search entire site for: 'PWM motor control from frequency measuremen'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: PWM motor control from frequency measuremen'
2001\01\31@133541 by Graham North

picon face
Hi I'm looking for some help with PWM. I'm not asking anyone to
do it for me, just give me some ideas and advice to hopefully
save me some time.

I am using a 16F877 to control a motor within a pyrometer. The
detector requires a 'chopped' signal, so there is a chopper on
the end of the motor. The chopper is split into quarters, with
two opersite quarters missing (if that makes sense!). There is
another small detector and led at the edge of the chopper to
give a 'synch pulse'.

Basically I have to use this synch pulse to contol the motor
(keep at a constant rmp) via the chips PWM output.

This sounds complicated too me, but hopefully someone out there
will be able to make sense of it!

If you want to know what level I am at with a PIC, then I have
quite a bit of experience but have never done any PWM work.

Any help would be much appreciated.

Many thanks

Graham North
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\01\31@134630 by Spehro Pefhany

picon face
At 06:36 PM 1/31/01 -0000, you wrote:

>
>Basically I have to use this synch pulse to contol the motor
>(keep at a constant rmp) via the chips PWM output.
>
>This sounds complicated too me, but hopefully someone out there
>will be able to make sense of it!

Use the synch pulse to determine the RPM (or the period), and
use a PID controller (in software) to control the output (say,
from 0..100%), and then feed that to your PWM module.

>If you want to know what level I am at with a PIC, then I have
>quite a bit of experience but have never done any PWM work.

The PWM is dead simple. The PID controller will require some
tuning and implementation but it is not so hard either, at least
in a case such as this one.

If you need a very close control of the RPM or some such thing
there may be other problems. You may have to alter the system
response in software by adding a digital filter or by adding some
weight to the motor shaft. Try to get only one pulse per
revolution (or divide the signal by two) to avoid jitter problems.

Good luck!


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam@spam@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2001\01\31@163704 by Olin Lathrop

face picon face
> I am using a 16F877 to control a motor within a pyrometer. The
> detector requires a 'chopped' signal, so there is a chopper on
> the end of the motor. The chopper is split into quarters, with
> two opersite quarters missing (if that makes sense!). There is
> another small detector and led at the edge of the chopper to
> give a 'synch pulse'.
>
> Basically I have to use this synch pulse to contol the motor
> (keep at a constant rmp) via the chips PWM output.

PWM is merely a means of adjusting the motor's effective drive voltage.
Once it is all set up, you can think if it like a D/A.  That's the easy
part.

The more difficult part is to come up with an algorithm that figures out
what to set the PWM to given the measured motor speed.  I would start with a
strategy known as a PID (Proportional, Intergral, Derivative) controller.
There is LOTS of material out there about PID controllers.  The basic
concept is rather simple, but there are lots of wrinkles and details.
That's why there are graduate level courses in control theory dedicated just
to PID controllers.

To reassure you it's possible, I did a project a few months back with a
16F876 that controlled the RPM of a gaoline engine.  It captured tachometer
pulses with the CCP module and controlled the engine throttle via an
electric motor driven from the PWM output.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, .....olinKILLspamspam.....embedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu



'[PIC]: PWM motor control from frequency measuremen'
2001\02\01@081651 by Vasile Surducan
flavicon
face
On Wed, 31 Jan 2001, Graham North wrote:

> Hi I'm looking for some help with PWM. I'm not asking anyone to
> do it for me, just give me some ideas and advice to hopefully
> save me some time.
>
> I am using a 16F877 to control a motor within a pyrometer. The
> detector requires a 'chopped' signal, so there is a chopper on
> the end of the motor. The chopper is split into quarters, with
> two opersite quarters missing (if that makes sense!). There is
> another small detector and led at the edge of the chopper to
> give a 'synch pulse'.
>
>
 Probably you have used an Pyroelectric infrared sensor with 8-14um
wavelenght filter ( for pyrometer measuring ) Such sensors are made by
EG&G Heimann and have an FET preamplifier inside. They aren't too good
for your purpose, I've use one such time ago, it has a good sensitivity
( in my application it "feels" temperature variation of a boiled cup of
tea in which is dropped very little quantity of cold water step by step
) but required a lot of good mechanics and a very good external amplifier.
 Same EG&G have another sensor called thermopile sensor, designed for
same pyrometer measure, it need no chopped radiation and amplifier is much
easy to built. TPS535 G9 (with filter at 8-15um) is one of those sensors
with 35ms response time, 1.2x1.2 sensitive area and an internal thermistor
of 30k for ambient temperature corection available for various temperature
range. Also detectivity is about .55*10exp8 cm/sqr(Hz/W) and noise voltage
about 25nV/sqr(Hz)

Vasile

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\01@172749 by Peter L. Peres

picon face
You need to set up a tick interrupt (constant timing) of suitably high
speed. You will increment a tick counter on it from 0 to MAX_TICK, then
set it to zero in the ISR.

A variable called pwm_set will be loaded with the pwm output value. When
tick is set to 0 the motor drive output is set. With each tick pwm_set is
compared to tick. When tick == pwm_set turn off the motor control bit. You
can now to bit banged pwm without a pwm module in the range 0..MAX_TICK.
Alternately, feed pwm_set to the pwm block as appropriate.

To measure frequency you actually need to measure period for normal motor
rpms (especially in a pyrometer). So, use another counter, called freq
(probably 16 bits). This will be set to zero when the opto changes H->L,
and increment on each tick until the opto changes L->H. freq now contains
a value *inversely* proportional to the rpm. Each of these steps happens
in the tick isr.

Now, to close the loop, when the opto goes L->H you compare the freq to
your preset freq_0 which indicates the desired speed. If freq is higher
then the speed is *lower*. Thus, you need to increase, and thus you add a
value of delta_pwm to pwm_set. You need to limit pwm_set so as not to roll
over. Decrement it to slow down, limiting on zero. More advanced solutions
will use an adaptive slope lookup table for delta_pwm depending on error
and lock state history (now, how do I know this ? <g>).

In theory the loop should be relatively stable especially if the motor has
some weight attached to it. Otherwise decrement delta_pwm until is it
unit. If it is still unstable then you will need to do some real control
loop analysys to get it stable (the easiest loop control analysis
consists in adding weight until it seems stable though).

To test stability put a scope on the smoothed pwm and then forcibly stop
or over-rev the motor (by hand or by applying current in appropriate
places). Observe the response on the scope when the loop locks back in. If
it overshoots or rings lower delta_pwm. If it does not increase it. The
best setting is when fastest lock if achieved, with no ringing.

hope this helps,

Peter

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...