LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Closed loop feedback control of stepper motor with force feedback sensor

Hi All,

 

I'm at my wits end here as this is the last step of my coding but it doesn't seem to work out! I have basic knowledge of programming/feedback control so any help will be very greatly appreciated!

 

I'm trying to create a close loop control feedback of my stepper motor, I've used the labview examples VI Cont Pulse Train (8253).vi for velocity control and Write to 1 Dig Port (8255).vi for direction control. Both were very lightly modified only.

 

For feedback, it is achieved via analog input from my force sensor, read into the AI Sample Channels.vi and output into a Array to Spreadsheet String for writing the data into an excel file. I tapped the same output to display the current reading, and that is where I intend to tap the feedback too.

 

I have two options, using the PID control loop.vi as a base for my feedback control, or achieving the same control with logic gates-this option is not as elegant but I'm running out of time and have no idea how to use PID/logic gates effectively to control my motor.

 

This are the specifications I am using:

Labview 6.1

DAQ card: PCI-1200

 

I'm very grateful for any help that anyone can render in this - a sample .vi of some sort or anything!

 

Ronald

0 Kudos
Message 1 of 2
(5,084 Views)

Hi Ronald,

 

Normally what we do to achieve PID control is to acquire the feedback signal, send it to the PID.vi of the PID Toolkit, and generate the output from the PID.vi.

 

So basically you need to have PID Toolkit installed with your LabVIEW, and then you can use PID.vi from the Functions Palette. 

 

 

You DAQ card is a legacy device, which refers to an earlier line of DAQ devices. In the late 1990s, NI has introduced a new line of products, DAQmx.

The DAQmx devices have an improved performance, and the API is more intuive and easier to use. However, the driver of NI-DAQ (legacy) and NI-DAQmx are incompatible, and many functions only support NI-DAQmx. To read more about the difference, refer to this FAQ

http://zone.ni.com/devzone/cda/tut/p/id/3021

 

In DAQmx, we can use one DAQ Assistant Express VI to do the measurement and another to do the generation. But Express VI is not supported by NI-DAQ (legacy). So you have to use the NI-DAQ functions to program the acquisition and generation. Nevertheless, the structure of your program should be the same.

 

I have found some example codes doing PID control using NI-DAQ (legacy), but I haven't checked them since currently I don't have an earlier version of PID Toolkit that supports LabVIEW 6.1 installed in my computer. I'm still looking for it. Maybe you want to have a look at them first.

 

PID Control Loop

http://zone.ni.com/devzone/cda/epd/p/id/1058

Creating a PID Control Loop Using an E Series DAQ Device and Pulse-Width-Modulated Output

http://zone.ni.com/devzone/cda/epd/p/id/989

Using the PID Toolkit to Implement a Control Loop with ON/OFF Control Output

http://zone.ni.com/devzone/cda/epd/p/id/4058 

 

 

Hope this helps.

 

Guo Min

Applications Engineer

National Instruments ASEAN 

 

Message Edited by piggieq on 09-29-2008 02:55 AM
0 Kudos
Message 2 of 2
(5,041 Views)