Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 354 → Rev 355

0,0 → 1,14
Fourier transformation
It is IMPORTANT to put ADC and GRBL Arduino into right USB ports in computer. (for Windows) In the code ports are fixed on COM6 for grbl (stepper motor) and COM7 for ADC.
If changed, change "name" of the port in function "initialize" and "initialize_voltage" ( OpenComConfig (pCOM1, "COM6", 115200, 0, 8, 1, 512, 512) - second parameter).
Buttons "Start, Stop" are for scanning Num. of points of voltages and then with "Fourier" making a pop-up window of fourier transformation. Then both files Voltage.txt and
Fourier.txt are created.
On the right side is "Example" - takes the amplitudes a1,a2 and frequencies f1,f1 as an input and calculates the fourier transformation of a1*sin(f1*t)+a2*sin(f2*t).
Button "Voltage only" - "Start" is for measuring voltage in real time. Mark the toogle button "Fixed range" for range [0,2] or [0,5], depending on measurment. If something strange
happens to range, just restart the run. While "Voltage only" scan is in process, one can move the stepper motor left/right to see voltage differenceas the motor runs. And if the
stepper motor is far from starting position 0, just reset the position with button "Set position on 0" (that just closes the port and then opens it again since that is the
only way to reset the GRBL).