08-14-2015 04:14 AM - edited 08-14-2015 04:30 AM
Hey all! I'm using serial communication with two analog inputs , voltage & current from the arduino to labview. When I run the program, the voltage & current signals show a smooth sine wave. But after around 30secs -1 minute, it will start to show spikes and as time passes, the spikes become more regular affecting the reading by a lot.
How can I make the signal more stable? How can I remove the spike? I don't see a problem with the hardware and I'm just serial printing the two values into labview. What is causing the spike?
I found some topics regarding removing of spikes and I tried them(median filter) but it won't work? My signal becomes square sine-wave and my values become incorrect! What can I do to solve this problem?
08-14-2015 06:00 AM
Hi lamela,
when you have "spikes" in your indicators, you will have "bad" values in your received string.
Did you debug your VI? Do you know how the received string looks like when you see "spikes"?
From your VI we cannot tell you much, it's all in your data. Do some debugging to recognize a pattern in the "bad" data. Once you know this pattern you can easily detect communication problems…
08-14-2015 08:02 AM
How do I debug? My current signal only has a high spike whereas my voltage signal has two spikes, normal & high spike.The spikes give very high values(around 60000 for voltage)..
Are there any techniques or anything to find and solve the problem of the spikes in the AC signal? What do you think caused this? Why would it suddenly have spikes after a certain period of time after I run the program? What should I do? Do you think there's something with the serial communication from the arduino to labview that cause this or anything to stabilize it?
08-14-2015 08:14 AM
Hi lamela,
Are there any techniques or anything to find and solve the problem of the spikes in the AC signal?
Yes, sure: Use conditional probes…
What do you think caused this?
As in all your other threads before: problems with communication over (virtual) serial port…
What should I do?
Start debugging as said before…
08-18-2015 04:23 AM - edited 08-18-2015 04:41 AM
What is conditional probes? I still can't find what's the problem.. but I've seen the readings on the arduino serial monitor and there is no sudden change in value. So I'm assuming the problem lies in my labview code. Please help! The project of my deadline is this Friday! 😞 Is it related to the bytes read on the VISA read? Because I tried increasing the bytes and the signal becomes more stable?
08-19-2015 05:44 AM
For debugging:
http://zone.ni.com/reference/en-XX/help/371361L-01/lvconcepts/debug_techniques/
Now, to be able to help you with serial communication, we need to know if the protocol has a Termination Character.
By default the VISA has a \n as a Termination Character.
You should not need to change the buffer of the VISA, or a delay.