04-15-2012 02:10 PM
Hey guys:
I'm working on a project to control a wheelchair using LIFA and an Uno. The chair requires an analog voltage of about 1.25V to move. I built a simple program using PWM write to send the signal in response to a boolen (true/false) control. When true the Uno should send out 1.25V and when false the Uno should send out nothing or 0V. Sounds simple. However, my program sends the 1.25V, but then cycles between 0V and 5V when false causing the relays on the chair to constantly trip. The cycling rate seems to be due to the time delays in the Init or PWMwrite sub.VI's. I don't know if LabView has an analog write command, but I haven't seen it on mine (2009 Student Ed).
I was able to program the board to control the chair with analogWrite and without LIFA but some things came up and I now have to communicate with LabView. Can someone please help. I attached a segment of the program I'm using. How can I get a "steady" 0V and 1.25V. (In terms of PWM and analog signals that is)
04-15-2012 03:34 PM
04-15-2012 06:33 PM
The PWM Write Pin LabVIEW function simply uses analogWrite() on the Arduino. So, if you have it working with analogWrite() on Arduino then it should work equally as well with LabVIEW the way you have it. The only thing that I notice is that you are only executing the function once then closing out the Arduino. If you want the program to run continuously then you need to add a while loop around the button and case structure. Remember to make sure that the init and close VIs remain outside of the loop.
Also, you don't mention what pin you are using so make sure you that you are either using pin 3 or you need to specify the correct pin in LabVIEW.