Using uC to perform as a PI Controller

Discussion in 'Embedded Systems and Microcontrollers' started by espire, Dec 21, 2007.

  1. espire

    Thread Starter Member

    Dec 18, 2007
    Hi all,

    I am now working on a one cycle control project as shown below.
    This project is make up of op-amps blocks.
    How should I go about to implement it in a uC using C code without using any op-amps.
    I understand it is sort of PI/PID controller.

  2. beenthere

    Retired Moderator

    Apr 20, 2004
    What you are being asked to do is to make a simulator. The commercial product that does simulations is SPICE.

    Most parts and amps have files that describe their response in the SPICE simulator. You could get the SPICE descriptive files for your circuit and use them to let you figure out how to write the simulation.

    Hope you have a few months to work before you have to turn in the project.
  3. espire

    Thread Starter Member

    Dec 18, 2007
    Its actually not a simulation.
    Through the monitoring of output and feedback, the aim is to control a MOSFET to provide the optimum output voltage and sinusoidal input current to achieve unity power factor.
    It has been done previously using op-amps.
    I am tasked to do it with uC.. thus I am puzzled how can I make the uC perform as similar to the op-amps.
    I understand SPICE is a simulation program that provide analysis.
    How does it help in writing C code for the uC..
    Pls advised.. I am lost...

    Many Thanks.
  4. nanovate

    Distinguished Member

    May 7, 2007
    You'd need a uC w/2 ADCs and a PWM output. For the current sense you might still want an opamp/instrument amp.
  5. espire

    Thread Starter Member

    Dec 18, 2007
    Yes, I have a uC with 2 ADCs and PWM, yes one op-amp for current sense.
    What should I do next.. pls advise.

    Thank you