Hi to all!
I need to acquire 3 analog signals and one digital signal. I have done a program for do this, but i get a strange behavior in the acquired data.
My system is a thrust stand, and it is used to acquire data on the current, voltage, thrust and speed. These signals are generated by a brushless motor and a propeller.
For acquire this data, i use an arduino mega 2560 board, without the arduino framework. I acquire the three analog signlas using the first three adc channels and i read the square waveform from the encoder using the ICP5 present on the atmega2560. I acquire the data at 100 Hz, so every 10 ms I first acquire the analog signals and after i acquire the digital signal. I save this data in the buffer (one for every signals) and when the acquisition is end, i send the data from the atmega2560 to the pc via serial link.
In particular, i obtain some strange spike and i don't understand if this behavior is an hardware problem or a software problem.
This is that i obtatin from an acquisition session:
In this image, the strange behavior for me, is that the peaks appear at the same moment in all graphs. Notes that only the second and fourth graphs are valid, the first and third are values in volts, they will be multiplicate by the respective sensitivity values.
After the acquisition session, i save the data in a txt file, and this is that i obtain:
The first columm are the time, the follows three columms are the current, voltage and thrust and the last columm are the speed.
My doubts are that the three values in the first row in the red square are zero and the last value seem correct, but the second row in the same red square contains worng value (remember that all values are in volt, so i can't measure a voltage that is great than 5v) for all columms minus the time. This values are the same for the second-fouth columms, the last columm differ, but this values are not valid because the speed of the motor is unchanged.
What i would to know is in your opinion, when i can obtain a zero value from the adc? I possible that this i due to an overflow, maybe the ICP timer overflow or similar?
Thanks!