Go to Post FIRST has set me on a completely different path in life. And I'm all the better for it. - Vincent Chan [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-09-2006, 14:30
Disar Disar is offline
Registered User
no team
 
Join Date: Sep 2006
Location: Buffalo, NY
Posts: 2
Disar is an unknown quantity at this point
PID Troubleshooting

While there is a wealth of threads on PID's and have searched many of them. I could not find an answer to my problem.

I am currently working on implementing a PID algorithm. We are using a PID algorithm to control the flow of voltage or current during anode formation (for capacitors that my company manufactures).

We use an ATOM chip (based of a 16F876 PIC) and program in MBASIC (a variant of BASIC). I am unable to post any code do to confidentiality.

Our PID algorithm spikes during operation. It does so after the the response has been leveled. I am unsure whether it is periodic (not likely though) and as to what is the cause. We found the spike b/c we use Labview to collect data periodically during operation.

I am new to PID's and have just read "PID without a PhD" and other articles regarding PID algorithms. The code I am working with is one I have inherited from my supervisor who in turn inherited from someone who no longer works for our company (and who did not use a PID algorithm to control this process but he still got spikes during his operation, my supervisor used his code as a foundation for his PID algorithm).

I am a student in my final year of studies (EE). I am trying to determine the source(s) of this spike and how to remedy it. I would like to know if anyone has any troubleshooting tips I could try or any helpful hints.

Note: Rewriting the code is an option and is one I think I may try. But I would like feedback first before I decide to do so.

Thanks!
  #2   Spotlight this post!  
Unread 11-09-2006, 15:06
kiettyyyy's Avatar
kiettyyyy kiettyyyy is offline
Registered User
FRC #1538 (The Holy Cows)
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: San Diego, CA
Posts: 181
kiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond repute
Send a message via AIM to kiettyyyy
Re: PID Troubleshooting

Well? What is your definition of a spike? Maybe something you had declared overflowed? I have had a spike issue before when I did not do my math in a long integer and when I had the controller do the calculation all on one line, rather than breaking the operations into different pieces.

Could you post how you're approaching the pid?

Thanks!
Kiet
__________________
-Kiet Chau

2004-2008 - Software Developer/Driver on Team #968
2008-2011 - Software Developer/Coach/Mentor/"Engineer" on Team #968
2011-Present - Mentor & Engineer on Team #1538
www.team1538.com
  #3   Spotlight this post!  
Unread 11-09-2006, 15:41
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: PID Troubleshooting

Disar,

Please elaborate on the problem.

Is the spike causing a problem or could it only be something you are seeing on a scope that looks odd, but doesnt affect the process?

Is the spike at the start, near the end...?

Usually with a PID loop you will see rapid changes in the control signal, esp if you have a D with a large gain. Another place where spikes are introducted is when you first start the process, or you make a step change in the input signal.

Another posssiblity, we tend to think of PID control as if we have infinite response from our system, but real componets, like voltage amps for example, have a maximum output voltage, sensors have a max and min input. If one of your signals is hitting the max of an amp output, or a sensor input, then the PID equation starts to fall apart. Even if you are testing it open loop (with no PID feedback enabled), if you max out an amp or sensor, then very weird things will start to happen.

If you cant post details of your work you can send PM's to mentors on this forum and we can discuss things privately, or arrange an email converstation. If you are working as a co-op you can also consult with professors or TA's at school.

BTW, Engineering in Buffalo = SUNY Bflo?

Another thought, if this process uses a lot of power or voltage, you could have a ground loop or a sensor that is susecptable to nearby energy flow, or a poor ground path that spikes the sensor reading when current surges.

Last edited by KenWittlief : 11-09-2006 at 15:44.
  #4   Spotlight this post!  
Unread 13-09-2006, 15:13
Disar Disar is offline
Registered User
no team
 
Join Date: Sep 2006
Location: Buffalo, NY
Posts: 2
Disar is an unknown quantity at this point
Re: PID Troubleshooting

Ken, Kiet,

Thanks for the replies!
Yes, I am a senior at the University at Buffalo - SUNY. Nice to see a fellow Wstrn NY'er. Ken, I am actually working for Greatbatch Inc. you may or may not of heard of them.

I am sorry if I was vague before. As I stated, I inherited this problem and trying to sort all of this new information out. I will relay everything I know of the problem while still maintaining confidentiality.

A spike for me is defined as something > than 340 mA and very sharp (think the Dirac Delta/Impulse function). (We typically run around 100 mA - 240 mA).

We use the PID algorithm to control current while voltage is steadily (linearly) increased. This is done for prescribed period of time. Then performed several more times. We use LABVIEW to retrieve data periodically (period depends on number of boards that need data collected from them). On the LABVIEW plots of the values collected, spikes DO NOT occur periodically. In looking at some graphs the spike is occurring at the end of a "ramp up". This causes noise on the next ramp up that occurs.

Let me rephrase that, the spike from the current (controlled by the PID) in the previous "cycle" will cause the voltage in the next cycle to "ramp up" in a sporadic linear manner (think of an irregular saw tooth waveform moving up linearly).

The spike is causing a problem. The boards are used in the manufacturing of certain medical components which have very little room for error. So this is not a problem we can overlook.

We use an ATOM chip (programmed in MBASIC) to control the whole process. We have other hardware on board for the analog to digital conversion and a switching power supply. I had to jury rig a communication circuit to allow for "in circuit" programming/debugging. During this process I found that one (or more) of the grounds on the board is faulty.

This leads me to certain to my ideas as to why the spike occurs:

1. It could possible be the faulty ground on the board causing values to be read incorrectly by the ATOM chip.

2. The PID is either tuned incorrectly or not implemented correctly (as I can tell it looks implemented correctly but I am in the early stages of troubleshooting)

3. As Kiet had stated, the math may have been done incorrectly and caused an overflow or mathematical error.

4. There could be a problem with the switching power supply (I have not begun to investigate this).

As you can see, I am in the infancy of my troubleshooting. I just want to hear peoples reasons for abnormalities in a PID Algorithm and see if it corresponds with anything I am doing. Furthermore, I would like to know if anyone has had any problems with hardware itself causing spikes.

I think I have been as specific as I could be given the information I have. If you would like me to define the problem further could you let me know which parts.
  #5   Spotlight this post!  
Unread 13-09-2006, 15:27
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: PID Troubleshooting

Quote:
Let me rephrase that, the spike from the current (controlled by the PID) in the previous "cycle" will cause the voltage in the next cycle to "ramp up" in a sporadic linear manner (think of an irregular saw tooth waveform moving up linearly).
this sounds suspicious. Im assuming these cycles are separate steps in a process, and that something else (or nothing) is happening between cycles.

If the PID loop is remembering data from a previous cycle, and that is affecting the start of the next cycle, it sounds like a SW variable, or a sensor input is not getting cleared or initialized when the next cycle starts.

Digital PID control loops do have memory built into them, you compare the present reading to the last reading to get the D component - and you sum the error signal to get the I part - so when you are starting a new cycle (or a new process) if all those variables are not zeroed out (or initialized to a starting value) then yes, data will be carried over from the last cycle to the next and screw up the PID control.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PID shadowops06 Programming 5 16-06-2006 22:48
PID without a Ph.D. Joe Johnson Programming 3 07-02-2006 17:37
PID Control Chris Bright Programming 9 26-03-2005 19:44
Troubleshooting - 783 lee87 Website Design/Showcase 2 13-02-2005 20:15
Troubleshooting System SilverStar Technical Discussion 0 23-01-2004 21:22


All times are GMT -5. The time now is 11:00.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi