Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PI to PWM

Status
Not open for further replies.

rahulcet

New Member
Hello everyone,
My final year project is Swithed reluctance motor Constant speed drive(the speed should remain constant even if loaded). For this I need to sense the speed of the motor, find the error between the REF speed and actual speed. All that control system stuff. The thing is I need to give this error to a PI controller to a pWM varying ckt. I was planning to implement the PI controller by keep on adding the errors calculated in each cycle. But the problem is I jus dunno what the max and min limits of this addition process will be and unfortunately there are max and min limits for the CCPR1l and two bits put together in CCP1CON which control the duty cycle of the PWM output. I jus dunno if this is called PI tuning.
Please do help me.
 
Integration should always have limits otherwise at some point they can wrap around their own axel an cause all sorts of odd behavioral problems. The idea being to add in enough "I" value to get "PE" (position error) to go to near zero during a move and the I term assumes the value of cumulative error. Then when your position command stops changing, the cumulative error drives the positon to closely match the demanded final position.

Yes you're PI tuning and depending on your other system parameters (namely GAIN) your just going to have to try "I" sensitivity to see how effective it is to the overall loop system.

You can always just drive the loop with no "I" term and see how large "PE" gets to have an idea of how much error the loop generates during a move. You should always start tuning with NO "I" input anyway to find the optimum (highest usable value before instability) value of gain in the loop before addding in any "I".

Then you can set a limit for "I" to some value just above the raw "PE" (position error) as a safe starting point.
 
Last edited:
That was interesting and a very good start. So I guess I need to have a model of the system(the motor) iam working on. right?
 
Yes a motor model is needed if you are going to model the system. And anywhere I said POSITION in the earlier post, you can replace it with VELOCITY depending on the type (position or velocity) of loop you are wanting to control. Since I re-read your post it looks as though you are doing a velocity loop.

Motor models can generally be simple integrators or can be more complex as necessary, taking into acount initial friction (sometimes refered to as sticksion), back EMF, thermal energies...blah blah blah! "All that control system stuff" :D. Just use the STUFF that is necessary!
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top