I have been modifying the controller c code of the PID application to have different gains depending on the input voltage. I have run into problems when I try to read the voltage values within the pid_update function. I appended pid_init, pid_exit, and pid_update to the end of main.c and included the fpga_pid.h header file at the beginning of main.c.
Then I hard coded the pid_update function to give me a proportional gain of 4000 cnt when I do not have the PID checkbox clicked and the average voltage of channel 1 is greater or equal to zero. The code below shows the changes to the pid_update function that I have made.
When I tested the code, I sent in a DC voltage to ch1 and slowly increased or decreased the voltage. I found that the output from the Red Pitaya is linear for both positive and negative voltage. I then checked to see if params[MEAS_AVG_CH1].value was equal to zero, but there was no gain for either positive or negative voltage.
I am very new to both c coding and working with pthread mutexes, so hopefully I am missing something simple. Any help would be greatly appreciated. Thanks!
Applications, development tools, FPGA, C, WEB
1 post • Page 1 of 1
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 2 guests