LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LIFA Base starts motors running on upload

As soon as I upload LIFA Base to my Arduino Uno (R1), both motors connected to Pins 5 and 6 start running continuously at full speed (not desirable).

When I use the following VI that is written for my motor shield, it works correctly:

https://decibel.ni.com/content/docs/DOC-27770

However, when I push the "Stop" button the motors go back to running at full speed.

How can I fix this in the arduino code?

Thanks

-Steve

0 Kudos
Message 1 of 14
(12,834 Views)

Try this cleaned up version of that VI (I removed the analog inputs since they don't relate to the shield based on the info on the website).

I added a the "Set Digital Pin Mode" VIs because you should always set the pin mode before using a pin.  Then, I added the "Set Digital Pin" VIs immediately after the loop to set the motor speed to zero when you hit the stop button.

Let me know if it works.

0 Kudos
Message 2 of 14
(5,770 Views)

I'm sorry. I was ambiguous with my first post. My problem is not with the VI, it is with the arduino sketch (LIFA Base). As soon as I uplaod the sketch to the arduinon, both motors start running full blast.

Thanks,

-Steve

0 Kudos
Message 3 of 14
(5,770 Views)

The VI that I posted above was intended to address the motors being on after you hit the stop button.  As for when you upload the sketch, you might need to set the appropriate pins to 0 in the firmware (possibly in the setup section).  So, try changing the setup code in LIFA_Base.ino:

void setup()

  // Initialize Serial Port With The Default Baud Rate
  syncLV();

  // Place your custom setup code here
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
}
0 Kudos
Message 4 of 14
(5,770 Views)

This worked. Thanks! The reason I didn't do such a thing to begin with, was that I hadn't analyzed the code to see how the interface worked and to ensure I wasn't going to break the labview interface by setting pins in setup().

0 Kudos
Message 5 of 14
(5,770 Views)

but how i can use PID for controlling This Dc MOTOR with Labview interface arduino thank's

0 Kudos
Message 6 of 14
(5,770 Views)

I would like to do that too!  PID and DC motor control from a Temperature sensor input.

0 Kudos
Message 7 of 14
(5,770 Views)

After a really quick search on Google, I found this short and sweet video about a PID control (Doesn't even require the PID toolkit):  http://www.youtube.com/watch?v=qMydcfZ_ZSs

0 Kudos
Message 8 of 14
(5,770 Views)

Nathan, I have been trying to make the labview interface work with my motor shield (OSEPP version http://osepp.com/products/shield-arduino-compatible/motor-servo-shield/) I can not seem to get it. Would it be possible to post the L293D_&_L298_Interface_Arduino.vi file that is compatible with LabView 2010?

My biggest uncertainty is what Arduino pins correspond to the various motors on my OSEPP motor shield? According to osepp, it should be the same as the adafruit version (but my shield has 4 motor connections etc.. ) so I am a bit confused.

Thanks for any help,

-Tom

0 Kudos
Message 9 of 14
(5,770 Views)

Here it is for LabVIEW 2009

0 Kudos
Message 10 of 14
(5,770 Views)