Searching \ for '[EE]: [PIC]: Motor PWM question & C671JW part ques' 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: '[PIC]: Motor PWM question & C671JW part ques'.

Exact match. Not showing close matches.
PICList Thread
'[EE]: [PIC]: Motor PWM question & C671JW part ques'
2001\01\13@200941 by Bob

flavicon
face
I'm building a project I seen in an electronics mag that is using a C671 PIC,
that PWM's a hexfet to run a DC motor.  The original ASM code is generating
about 20ms wide pulse widths (50hz).  I am looking to use this to drive a fuel
pump at different speeds.  I don't know the exact specs of the pump yet, but I
assume that it can do something like 40+ pounds of pressure.

The question:  Is there an "optimal" PWM cycle size that I should be using for
this kind of DC motor?  Does it depend on what speed it is running at?  i.e.,
could/should I code it so that it has a different PWM frequency at different
motor speeds for optimal tourqe & minimal motor core loses?  Or would you
recommend just throwing a certain sized capacitor in there to even out the DC
pulses?

I could easily rewrite the code to do 5ms wide PWM cycles, or less, and wondered
how this would affect torque at different motor speeds.  I'm thinking that a
faster PWM cycle would mean a faster response time, when conditions that affect
the PWM duty cycle change.



On another note, but for the same project....

I've got a C671JW from Digikey to use on this project.  It has a plated
(brass/copper/gold, dunno) metal casing, and does not have the standard pin1
dimple that the plastic C671 OTP parts have on them.  Looked at/in data sheets
for it, and it doesn't show anything about that (that I can find any ways).  Can
I assume that Pin1 is by the MicroChip (M) logo on that chip?

Also, I noted in the data sheets for the JW part, that the internal frequency
calibration would be lost if I erase it (the current code uses that).  How do I
retrieve that information prior to programming it?  Just have my Epic read it,
look at the last memory location for that data?  I just did that on one of my
671 OTP's, and looked at the Epicwin "code" window.  All of the memory locations
are 3fff, except the last one, which is 3480.  So, do I put the x'80' value
there in my program at that location?  I assume that the x'34' is the "retlw"
opcode, or do I have it backwards?  I did read the data sheet, and just need
confirmation on this...

Can I also assume that I'll have to read that internal calibration on each OTP
chip I use before programming it too?  If so, does anyone have a somewhat
"automated" script, or method, for doing this; or does this process have to be
done manually for each OTP chip (read code, change calibration byte in code,
compile code, program chip)?

BTW, How accurate is that preprogrammed calibration?

Sorry about all the stupid questions, this is my first time working with all
these different parts and factors.  Any help on any of this is greatly
appreciated.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\01\14@042706 by Roman Black

flavicon
face
Bob wrote:
>
> I'm building a project I seen in an electronics mag that is using a C671 PIC,
> that PWM's a hexfet to run a DC motor.  The original ASM code is generating
> about 20ms wide pulse widths (50hz).  I am looking to use this to drive a fuel
> pump at different speeds.  I don't know the exact specs of the pump yet, but I
> assume that it can do something like 40+ pounds of pressure.
>
> The question:  Is there an "optimal" PWM cycle size that I should be using for
> this kind of DC motor?  Does it depend on what speed it is running at?  i.e.,
> could/should I code it so that it has a different PWM frequency at different
> motor speeds for optimal tourqe & minimal motor core loses?  Or would you
> recommend just throwing a certain sized capacitor in there to even out the DC
> pulses?

It doesn't matter that much provided the pwm is fast enough
to give a reasonably regular current in your motor. This
depends on motor inductance, but freq above 10kHz are usually ok.
I must ask a question, does your pwm keep the freq constant
and change the pulse width to vary speed, or do you always
use 20mS pulses, and have changes in freq to change motor
speed?

It will help if you explain more about your end application,
if you are making a fuel injection controller you do know
that normally fuel pressure is regulated by a pressure
return valve, and fuel pump speed won't affect it much?
I'm curious. :o)
-Roman

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@111443 by Olin Lathrop

face picon face
> The question:  Is there an "optimal" PWM cycle size that I should be using
for
> this kind of DC motor?

No.  It's a balance of tradeoffs.  Slower PWM is better in that the
switching components spend less time in the transition region, thereby
dissapating less power.  It also allows for better resolution using the PIC
hardware.  However, the PWM frequency needs to be fast enough so that the
device being driven "sees" the average voltage instead of the individual
pulses.  In the case of a motor, this is mostly dependent on the
torque/inertia ratio.  Other considerations might be to reduce the magnitude
of small internal vibrations of the coil wires in the motor, or to reduce
audible noise.  For example, a few hundred Hz (or even lower) is fine to
effectively drive many DC motors, but can produce an annoying whine.  In one
project I ended up using 10KHz just for this reason even though the system
functioned fine at 200Hz.

> Does it depend on what speed it is running at?

No.


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

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@170103 by Bob

flavicon
face
Comments at bottom

-----Original Message-----
From: Roman Black <.....fastvidKILLspamspam@spam@EZY.NET.AU>
To: PICLISTspamKILLspamMITVMA.MIT.EDU <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Date: Sunday, January 14, 2001 4:32 AM
Subject: Re: [EE]: [PIC]: Motor PWM question & C671JW part question


>Bob wrote:
>>
>> I'm building a project I seen in an electronics mag that is using a C671 PIC,
>> that PWM's a hexfet to run a DC motor.  The original ASM code is generating
>> about 20ms wide pulse widths (50hz).  I am looking to use this to drive a
fuel
>> pump at different speeds.  I don't know the exact specs of the pump yet, but
I
>> assume that it can do something like 40+ pounds of pressure.
>>
>> The question:  Is there an "optimal" PWM cycle size that I should be using
for
{Quote hidden}

Currently, the code is writen with a fixed 20ms PWM frequency "cycle", and it
just adjusts the duty cycle of when the hexfet is turned on during that 20ms, to
increase or decrease the average power given to the fuel pump.  Is there any
advantage to the other method you mentioned?  I also just found out that the
fuel pump is rated at 90psi, but can go as high as 105 psi (if this helps any).
I was thinking that if I used a 5ms PWM cycle instead, I'd get a steadier low
end speed, and maybe even better tourqe at the high end (and faster response).
I.e. how does frequency affect torque?

As this circuit can also flow quite a bit of amps (power), another thing I
should probably ask is: at what frequency (dependant on power) does the FCC step
in and say "NOPE, you can't do that!, at least not without a lot of sheilding"?
I can easily change my current code so that it would run at 5ms PWM cycles, or
200hz.

Well, I don't want to get into "exactly" what this application is for (I'm
building this for someone that may not want the details public), but this is
currently being done with a 555 timer chip (with "manual" user control
feedback).  I just want to add some more functionality to the circuit by using a
PIC.  I guess you could think of this application in that I'm NOT using a
standard "static" pressure regulator inline with the pump, because I'm using the
speed of the pump itself as the regulator instead (i.e., a "variable regulator"
based on user controlled feed back).  In this particular application the PIC
would also give me the ability to work with more variables, other than just a
static pressure, based on a user controlled pot.  There are circumstances where
I may increase, or decrease, pump speed (pressure) based on two, or more,
variables that I'm reading in via the ADC ports (i.e. an "intelligent" pressure
regulator based on user AND sensor feedback).

Can you, or anyone, confirm/enlighten me about what I asked in my previous email
about the preset frequency calibration byte, and where pin1 is on a C671JW part
is?  I've never used the internal OSC, and never used a JW part before (only
flash and OTP's, w/ external crystals).  I can't really even test a prototype
circuit until I know about some of this.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@170709 by David VanHorn

flavicon
face
>
>As this circuit can also flow quite a bit of amps (power), another thing I
>should probably ask is: at what frequency (dependant on power) does the
>FCC step
>in and say "NOPE, you can't do that!, at least not without a lot of
>sheilding"?
>I can easily change my current code so that it would run at 5ms PWM cycles, or
>200hz.

There's no such point.

Anything with a clock over 9kHz has to be part 15 certed.
Wether you pass or not, depends on how well you design and construct.

--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\01\14@173205 by Bob

flavicon
face
Whoa, your living about six mintues into the future (at least according to the
"email sent" time stamps ;-).

Well, I doubt that this could get the PWM to run anywhere near the khz range
(with decent accuracy), even though it's written in ASM.  Even if a 4mhz PIC
does have the raw speed to do it, I'd need to do a major re-writing of the
current code to do it (the program logic would need to be organized more
efficiently I think).

Can you confirm/enlighten me about the questions I had about the calibration
byte (do even the OTP's need to have "individually compiled" code for each part
to use the internal OSC?), and where pin1 on the windowed version of the C671
is?

Thanks for your help.



{Original Message removed}

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