I used a 4K8 resistor to despise myDAQ internal resistance and voltage so that everything is in the 4K8 resistor.
I chosen a 100uF capacitor, so I have to calculate the time of charge: Tc=5RC -> Tc=5*4800*0,0001=2’4secs.
Now i show the first part of the program, when we will write to myDAQ:
NImyDAQ typing mode makes RSE and reading it does because the differential mode analog outputs are all referenced to GND and analog inputs are referenced each individually for GND.
In the left we have the myDAQ configuration (output terminal configuration, units, phisical channels...) and we decide if is input or output.
The first frame have the configuration of output signal (ANALOG, SINGLE CHANNEL, SINGLE SAMPLE, DBL) and the output voltage (5V).
The second frame is a delay with the time necessary to capacitor can charge.
And the third frame is the same at first. This configure the output signal, but now with 0V.
Summarizing, the first part of the program gives us 5V for a certain time and stop the write part.
Second part:
In differential mode, each analog input signal has its own reference signal or return conductor.
In the left we have again the configuration, now we have to read the capacitor so we have to choose input mode, the units, sample mode, number of samples and the input speed.
Now we have a while loop where we will wait the time capacitor need to charge before start to read.
When we configure the read we have to choose the number of samples we want, in this case i chosen 60000.
We show the data read through a waveform graph and stop the read part.
And finally, i will show the last part of the program with the calculations, so we want to know the voltage of the capacitor at a particular time.
The formula to calculate the voltage is: Vins=Vf+(Vi-Vf)e^t/Rc
And this is the Fron panel where we can see the finished program:
No hay comentarios:
Publicar un comentario