Certification

cancel
Showing results for 
Search instead for 
Did you mean: 

CLD-R review queestion 1

Solved!
Go to solution

1. Consider the following scenario: You must create a control system where a PID calculation determines the value of an analog output based upon an anlog input and a double-precision setpoint.  Which of the following is the most appropriate mechanism to transfer the setpoint from your user interface loop to your control loop?  

a. A queue with a data type of analog waveform.

b. A functional global variable with logic to hold the maximum.

c. a global variable

d. a queue with a data type of double.  

 

The answer is c, but doesn't d work as well?  d ensure that all setpoint is processs.  Isn't it better?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 3
(6,631 Views)
Solution
Accepted by topic author jyang72211

Typcally, a PID control system runs independently and needs to always use the current setpoint. With a queue, you transfer the setpoint once, and the next them the PID process arrives at the dequeue operation, it will wait forever, or until the setpoint is changed again. In order for it to work with a queue, the PID process would need significant additional code to re-use the current value until a new setpoint value arrives again.

Message 2 of 3
(6,621 Views)

@jyang72211 wrote:

1. Consider the following scenario: You must create a control system where a PID calculation determines the value of an analog output based upon an anlog input and a double-precision setpoint.  Which of the following is the most appropriate mechanism to transfer the setpoint from your user interface loop to your control loop?  

a. A queue with a data type of analog waveform. No, I want to control to a point

b. A functional global variable with logic to hold the maximum. No, I want to control the current point

c. a global variable I guess I'm stuck using a global, there aren't any other choices!  I hope the PID loop isn't in another process where a shared variable would be needed.

d. a queue with a data type of double. No, I want the setpoint always controlled so a "Change setpoint" state transition breaks the PID loop and I'm out of control  

 

The answer is c, but doesn't d work as well?  d ensure that all setpoint is processs.  Isn't it better?


Its another one of those which is less evil questions that don't quite give you the total requirement.  It should be rephrased simillar to "You must create an uniteruptable control system where a PID calculation determines..."

 

 


"Should be" isn't "Is" -Jay
Message 3 of 3
(6,579 Views)