02-20-2007 05:39 AM
02-20-2007 05:42 AM
02-20-2007 07:48 AM
02-21-2007 09:55 AM
02-21-2007 10:22 AM - edited 02-21-2007 10:22 AM
Zermelo,
What is the acquisition and PID loop rate you are running on the FPGA? If that rate is very high, you could edit your FPGA code so that only every Nth set of data is passed to the DMA FIFO, reducing the amount of data passed to the host. Even if you reduce it by a factor of 10 you will still have enough data on the host to see what is going on in your control loop.
Secondly, you shoudl try to reduce the amount of processing on the host side so that the host is able to keep up with reading and processing the DMA data and avoid DMA buffer overflows.
1. Move the code to calculate the PID gains and output range outside of the While loop.
2. To calculate the setpoint and PID offset use a simple Mulitply node (multiply by 3276.8) instead of the Expression Node.
3. Modify the code that processes the DMA data. Use the Array Reshape function to directly convert the 1D array into a 2D array. Then Transpose the array and use the Divide node to scale the data (instead of using the Expression Node). See the following example.
Message Edited by Christian L on 02-21-2007 10:22 AM
02-21-2007 10:48 AM
02-21-2007 10:59 AM