PID controller

Discussion in 'General Electronics Chat' started by qubits1, Aug 25, 2010.

  1. qubits1

    Thread Starter New Member

    Aug 24, 2010
    5
    0
    Is it possible to use a PID controller to follow a 100 Hz sine wave? And would the Ziegler–Nichols method be enough to tune it?
     
  2. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    Which PID controller? Any off the shelf unit would be way too slow to follow a 100Hz signal.
     
  3. qubits1

    Thread Starter New Member

    Aug 24, 2010
    5
    0
    This is my first time using a PID. I need to follow a 100hz sine wave with a sensor lag of 1ms. Can you give me some pointers on how to achieve that with or without PID?
     
  4. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    You can generate your sinewave and compare its phase with the sinewave you want to follow. Then you can change your sinewave's phase to match the others phase.
     
  5. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    Please describe your whole process so we can see what you want to do. You are "following" this 100Hz waveform with what? What kind of sensor is it?
    Ziegler-Nichols works pretty good for most slow PID loops like those found in chemical plants etc. Its not perfect, but it gets you pretty close. I have no idea how well it would work at 100 Hz.
     
  6. qubits1

    Thread Starter New Member

    Aug 24, 2010
    5
    0
    Additional info:

    Input come from a function generator and goes to an Amplifier that drives the speaker. The speaker is in a chamber. The sound bounces of the walls and creates harmonics. Now I want to keep sounds in this chamber at only the input frequency. So, I want to use the transducer(microphone) as a sensor in a feedback control system to drive the error between the input wave and sensor to zero. Essentially, it removes harmonics and noise.
     
  7. Jaguarjoe

    Active Member

    Apr 7, 2010
    770
    90
    What's the final operator going to be? IOW what's the PID loop controlling? Something has to create the action to drive the error to zero.
    The microphone will pick up the fundamental frequency and all of the harmonics. Do you plan to filter out the fundamental and use the harmonics some way? If you go the other way and filter out the harmonics, you won't accomplish anything.
     
  8. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    So are you going put the mic signal into the PID and then subtract the PID's output from the amplifier's input? Or subtract the mic from the input (sig gen) and route that to the PID and then either sum the PID output and the sig gen and send that to the amp input or just send the PID output to the amp input?

    In other words, what is your system topology?

    Have you tried it without the PID? i.e. Maybe start with just P and see what happens, and then maybe add I, and, if necessary, add D.
     
    Last edited: Aug 26, 2010
  9. qubits1

    Thread Starter New Member

    Aug 24, 2010
    5
    0
    PID loop controls the signal to the amplifier which drives the speaker. Error signal is the input from the signal generator minus the output from mic. Right now I think the lag from the speaker to the mic output is too much. I don't know how to compensate for that.

    I ran the circuit replacing speaker and the mic with a RC circuit that added 1.25 ms lag at 100hz. Also I added 60hz as noise. In this case the PID controller ran fine with kp=1 ki=15 kd=.3.

    What value would I have to tweak to adjust for additional lag?
     
  10. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    Just guessing, I would say kd. But I have no idea. However, I have seen some good sets of practical instructions on the web, for tuning PID controllers.
     
  11. qubits1

    Thread Starter New Member

    Aug 24, 2010
    5
    0
    I looked at the tuning instructions online but they only work for step and ramp inputs
     
  12. bertus

    Administrator

    Apr 5, 2008
    15,638
    2,343
Loading...