03-17-2011 07:53 PM
I am writing a program that will send a voltage to a programmable power supply based on an input voltage. The program as written reads 200 samples correctly, but then the output stays constant for every 200 samples. As it continues to run, it is using the last value of the input voltage to determine the next 200 samples of output voltage. There are other things I need to accomplish with a PID control loop, but I haven't been able to get anything to output correctly in even the most simple case.
Can anyone help me figure out how to read an input voltage, then have that determine an output voltage? The frequency needs to be approximately 200 Hz.
I've attached the block diagram.
Thanks,
designteam4
03-18-2011 07:14 PM
So your program is outputting a voltage, but it's just staying constant? You also want this voltage to change at a rate of once every 5ms or so based on whatever's currently at the input? Just trying to clarify the problem.
03-20-2011 07:28 AM - edited 03-20-2011 07:30 AM
Hi,
I hope this helps you on it's way. The timing is something you have to do by itself. Cause that is not really obvious from what you mentioned
Dont forget to wire the number of samples to read at the sample clock 😉