LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Problemas con labview y arduino

Mi problema es el siguiente, tengo un programa que hice que me cuenta el numero de vueltas que da un motor y me las convierte en revoluciones por minuto, hasta ahi todo esta bien, el problema viene cuando le agrego el control de un servomotor porque el programa ya no me muestra la lectura correcta de las RPM´s pero el servo funciona a la perfeccion.Dejo imagenes de mi codigo para ver si alguien cual es el error en la programacion y como lo corrigo, espero que alguien me pueda ayudar.

undefined

Este es el programa con el servo y el contador de rpm

undefined

Este es el codigo sin la parte del servo

undefined

siempre me da una lectura uniforme de 1200 +_- 60 RPM´s

pero cuando le pongo el servo me da esto

undefined

El tacometro varia de 800 a 1020.

Espero que alguien me pueda ayudar porque esto ya me esta desesperando


0 Kudos
Message 1 of 6
(6,846 Views)

It looks like you are trying to use the Arduino (and LabVIEW) as an encoder.  Is that what you are doing?  What is your hardware set up and what are the specifications of the encoder and the expected motor speeds?

So, if you are trying to implement an encoder, it is not a good idea to try and do it in LabVIEW with Arduino.  You can, however, implement the encoder in the Arduino (with interreupt pins) and then have a custom LIFA function to read the RPM value in LabVIEW. 

Some other tips/suggestions:

  • You should avoid using local variables in LabVIEW.  You have at least race condition because of this.
  • You should have all Arduino VIs in-line (using the reference wire and error wire from the previous Arduino VI for the next Arduino VI).  See the picture below for an example of this based on your code:

arduino.png

Message 2 of 6
(4,340 Views)

yes, i´m trying to use arduino uno  like encoder to control a servo and also read the speed in a motorcicle. i´ve been used the spark in the engine to read the RPM and the servo like speed control

expected speed: 3000 RPM´s

0 Kudos
Message 3 of 6
(4,340 Views)

the problem is when i have  servo VI and tacometer VI together because the VI freezing and the RPM sampling is wrong but the servo works perfectly.

when only have the tacometer the sampling is correct and labview show me in the frontal panel the correct value

0 Kudos
Message 4 of 6
(4,340 Views)

You are slowing down the VI by putting more functions in it.  Therefore, you are going to need to change how you are reading the speed.  You will need to move it to the Arduino with interrupt pins so that it can get every pulse.  Then, you will need a custom LIFA function to read the current value.

Message 5 of 6
(4,340 Views)

ok, i need change pin to the interrupt pins ( #2 or #3) and a custom LIFA

but i have not idea how customize the LIFA is my first time using arduino whit labview

0 Kudos
Message 6 of 6
(4,340 Views)