Ok, so what do I do with the result? :) Does this give me my adjustment value? I am going to use a PWM to drive the servo with high and low deadbands. Could this PID value give me a # to increase or decrease my pulse width for the servo driver? The servo is driven by a possitive pulse and the position varies with the PW (1-2ms range) Thanks for the help. Jody Gallant -----Original Message----- From: Dennis Merrill [mailto:merrill@NICOLET.COM] Sent: Monday, January 25, 1999 12:44 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: PID control & new member If you are trying to implement a PID controller on a PIC, this is pretty easy. First, you need to calculate your threee constants, Kp,Ki,and Kd. P = Kp * current value I = Ki * Sum of all previous values D = Kd * ( this value - last value ) PID = P + I + D At least, this is how you do a digital PID. You can also buy PID chips that work in the same fashion. At 10:29 AM 1/25/99 -0400, you wrote: >Hi, My name is Jody Gallant. I am a systems analyst for Tech Sea >Corporation Ltd. in New Brunswick Canada. I am quite new to PIC's but am >trying to learn as much as I can. I am trying to design a circuit to >control the wastegate for the turbocharger on my car. There is nothing >wrong with the one that is built into the ECU but I would like to have >some manual control over this function. > >I have most of the hardware details worked out, but am trying to come up >with a good tuning algorithm for this and would welcome any help. what I >need to do is control an R/C servo (PWM) based on the current MAP >(manifold absolute pressure) and the current Boost preset. I have been >doing a lot of studying on PID loops which might be the best answer, >however I have not been able to come across anything directly related to >PIC 's. > >Thanks in advance for any advice. > >Jody Gallant > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Dennis Merrill, BSEE work: merrill@nicolet.com Firmware Engineer home: merrill@ieee.org Embedded Systems Group Nicolet Instrument Corp. phone: 608.276.6136 web: www.geocities.com/ResearchTriangle/5256 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=