When programming arduino, I found a problem that there is a delay time about 0.5 s between the signal measured and the real signal. I changed all frequencies (Matlab simulink and Step Signal) however I did not reach any result.
Do you control some signal generator from a PC by means of Matlab & Co., have the Arduino measure it and transmit it back to the PC and measure the delay on the PC?
Thank you all for your answers, I m using Arduino and Matlab Simulink. I connect one output of the arduino to one input of the same arduino and I try to compare the two signals. I found a delay time about 0.5 sec. I don't know really the origin of this delay time.
Exactly, this is what I did. the same signal that I send a pulse to the arduino and I read the two signals using matlab simulink. I found a delay time.
All the communication down to the arduino done via USB and UART? Tap the TX and RX lines of the Arduino and admire part of the delay cause! I cannot remember the baud rate, but most likely there is more than a single byte transferred in each direction.
Not to be forgotten: there's an additional microcontroller in the line, implementing the USB UART translation - adding further delays. Nothing to wonder about. And USB itself is rather fast, but polling. Another source of delay.
If you want to implement some control algorithm in Matlab, using the current configuration requires to consider the sum of these delays on the algorithm. Provided the delay doesn't "jitter" too much. This is something still to be proven for your system.