04-14-2014 04:59 AM
Aweeesommme..thank you so much ![]()
04-15-2014 06:08 AM
My project is to control the speed of the dc motor(Hardware) using PID controller in LabVIEW. For interfacing Labview with dc motor, I am using Arduino Uno. For encoder, I am using Optocoupler and a schmitt trigger.
I have attached a vi and a pic of the encoder.
I tried to run the closed loop code using an encoder(Optocoupler and a schmitt trigger In the feedback path) to measure the speed of the dc motor. I am getting an error 5001 and in the error its mentioned pin 0 & 1 of arduino are reserved for communication with LabVIEW. But where do I connect those pins. On the arduino board, pin 0 & 1 are Rx & Tx pins. Also the moment I connect my USB cable to the laptop, my motor starts moving.
Please help me in this.
Thanks & Regards,
Neelam Punjabi

whatsap45 wrote:
As titled, I have problem to get reading in the labview from arduino. The block diagram is a shown in the attachment, can anyone please explain what have I done wrong?
From my serial monitor in arduino shows around 2.5v, I have checked with my multimeter as well, it showed 2.5v even when no load is connected. If there is a load connected, the voltage signal will be increased. Thus, the result I'm getting is always 0 as shown in the attachement below.
The baud rate I have changed from 9600 to 115200 to observe any changes to the result. Can anyone figure it out what might be the problem?
whatsap45 wrote:
As titled, I have problem to get reading in the labview from arduino. The block diagram is a shown in the attachment, can anyone please explain what have I done wrong?
From my serial monitor in arduino shows around 2.5v, I have checked with my multimeter as well, it showed 2.5v even when no load is connected. If there is a load connected, the voltage signal will be increased. Thus, the result I'm getting is always 0 as shown in the attachement below.
The baud rate I have changed from 9600 to 115200 to observe any changes to the result. Can anyone figure it out what might be the problem?
04-15-2014 01:35 PM
Neelam,
You should start your own discussion since your topic is not related to this discussion.
04-15-2014 02:59 PM
Why is the baud rate hardcoded? Can we change it somehow? If you change the baud rate in the Arduino code from 9600 to 115200 to match that of the VI and try to read a thermistor data, the Arduino spits out a bunch of nonsense characters instead of resistance and temperature reading.
04-15-2014 07:28 PM
There is no other option than to hard code the baud rate because the baudrate is used to start the serial communication which is required for LabVIEW to be able to communicate with it. You can change the baudrate in the firmware, compile it, and then re-upload it if you need/want a different baudrate. However, not all baudrates work correctly when working with the Arduino Mega (I've not used any other Arduino). I've never been able to get the Mega to work at 115200 starting with version 1.0 of the Arduino IDE. In the version prior to that, it worked.