Basic LabVIEW example or tutorial for motor control beginner?

Hello,
I'd like to control two brushless servo motors using LabVIEW. I've got a PXI7358 controller card and a Copley amplifier. I've read the Getting Started tutorial but otherwise I am new to LabVIEW. I'm looking for a good basic VI and/or a tutorial about how to get started programming the motion of these motors with LabVIEW.
Thanks,
Matthew

Hi, I'm not sure whether this is the right place for asking this question or not and if not, then please guide me to the right place for asking such question. Thanks.
I have a stepper motor with the Vector Network Analyzer Anritsu MS4623B. I got it up and running with the LabWindows/CVI. I need to sync the motion of the stepper motor with my data acquisition. Basically, I have to acquire the data in a way that in the start the motor will come back to home position wherever it was and then I want to move it to the specific position to do the measurements (For Example, I want to measure the 40 GHz channel between 1m to 3m movement of a stepper motor on a linear positioning system (ball-screw)). I've interfaced the VNA with the PC using LabWindows/CVI and I've controlled the clockwise and anti-clockwise movements of the stepper motor using LabWindows/CVI but I'm unable to sync the system in a way that whenever I run the code, the motor will run back to the home position and then move to a specific measurement start position and move till the end position and in between do the increment and stop and acquire the data. Is there any one to help me please? It's really urgent please and I'm doing this thing first time so please guide me in a proper way. I shall really apprecaite that and will be highly obliged with you. Thanks for your time and concern.
Thanks and Regards.
Attachments:
VNA & Motor Control User Interface.jpg ‏199 KB

Similar Messages

  • Need help with LabVIEW code for motor control.

    Hi,
    My name is Sasi. I am a BME grad student working on my thesis topic of evaluating spine implants for low back pain. For this I am building a test machine that would apply pure moments to a spine specimen. I am using LabVIEW 8.5 to implement control of a brushless AC servo motor. My requirement is,
    Step 1: Initialize the motor.
    Step 2: Start moving it at a uniform RPM to the right (This RPM value too user can enter).
    Step
    3: While doin Step 2; simultaneously read torque cell data (Using DAQ
    asst.). DAQ o/p is from 0 V to 10 V; 0 V being -10 Nm n
                10 V being  +10 Nm
    Step 4: When Torque value reaches +10 Nm, i.e 10 V, the motor stops.
    Step
    5: From the position where motor stopped (i.e no need to reset to
    initial position) Start moving in the opposite direction at the same
                uniform RPM as in Step 2 while reading torque cell data.
    Step 6: Once again when torque reaches -10 Nm, i.e. 0 V, the motor should stop.
    Step 7: Repeat 'Step 2' to 'Step 6' 3 times.
    Step 8: Reset motor postion.
    Till now I have managed to get the motor to move forward n backward @ a desired vel, accl, n deceleration for 3 cycles. I am attaching my code. I am having problem inserting the code for reading DAQmx amidst all this. Can anyone help me out.
    Thnks,
    Sasi.
    Solved!
    Go to Solution.
    Attachments:
    Test_012609.vi ‏35 KB

    Hi Sasidhar,
    I took a look at your problem and I think I have a workable solution for you.  I definitely agree with Lynn's suggestion of using parallel loops.  This will allow the DAQmx portion to run uninhibited by the motion portion, and vice versa.  Plus, you only need to iterate the motion loop whenever the voltage level crosses a threshold.  So, by iterating on the motion code in the same loop that you are iterating on DAQmx code, you are essentially wasting processor.
    I created a VI that should do what you are wanting.  I tested it out myself and it works great.  You might have a tweak a few things to apply to your system (like motion board ID and DAQmx physical channel, etc.).  I used two parallel loops and event-based programming.  Basically the motion loop starts the motor spinning at the specified velocity.  Once the motor is spinning, it waits for the DAQmx loop to tell it that the voltage value has crossed the threshold.  When the voltage value exceeds the maximum threshold (which I set to a value slightly less than 10 to allow for jitter and saturation), the DAQmx loop signals the motion loop that it can finish its iteration.  The motion loop stops the motion, reverses the direction, and starts the motion again.  Once motion has started, it again waits for the DAQmx loop to tell it that a threshold has occurred, but this time, it is looking for a minimum threshold.  I used "Occurrences" to implement the event-based programming in LabVIEW.
    I have commented the code rather thouroughly, so hopefully the comments will answer any remaining questions.  The benefit of using event-based programming for this is that you save processor time, and your motion is more closely synchonized with the DAQmx.  Instead of iterating the motion loop as fast as you can, checking for updates each time, you just pause it, and wait for the other loop to tell you when to start up again.  In the mean time, the processor doesn't have to worry about iterating that loop over and over again.  Also, when the occurrence does occur, you catch it immediately, instead of having to wait until the next iteration.  Thus, you are more closely synchronized with the DAQmx portion of the code.
    I hope this will help you.  Please post back if you have any questions about the code or its implementation.  Good Luck!
    Message Edited by Wes P on 02-03-2009 05:18 PM
    Wes P
    Certified LabVIEW Developer
    Attachments:
    Motion and DAQ.vi ‏59 KB
    DAQmx Loop.png ‏24 KB
    Motion Loop.png ‏17 KB

  • FPGA programming for motor control using free downloadable IP cores for PWM and Quadrature encoder interfacing

    Hi,
    I have a cRIO-9014 with a NI9505 DC brushed servo drive module, and I would like to program the FPGA for PWM and Quadrature encoder interfacing using the intellectual property IP functions mentioned in the "CompactRIO Motor Control Basics Tutorial":
    Quadrature Encoder dX Method (FPGA, Use in SCTL).vi
    Pulse Width Modulation (FPGA, Use in SCTL).vi
    I made a search at ni.com/ipnet but I couldn't find them.
    Where can I find free downloadable IP cores for PWM and encoder blocks to include them in my FPGA interface program?
    Thanking you in advance,
    Manuel
    Solved!
    Go to Solution.

    Found by myself (google search!) at:
    https://lumen.ni.com/nicif/us/codepowelecguide/content.xhtml

  • Why does Labview VI pause intermittently during motor control while loop?

    I'm performing some biomechanical testing using Labview to control stepper motor actuators. I have a PCI-7334 controller card and a MID-7604 driver. The testing is run in load control using a while loop that sends a number of steps to the stepper motor that is proportional to the difference between the actual and desired load. The VI intermittently pauses though and sits in active for several seconds (~5 sec to 20 sec). What could cause this problem?
    Thank you in advance for your assistance.

    Without the subVIs it is hard to see what is going on.
    Some general comments:
    1. Block diagrams should be limited to the size of one screen.  Yours is over 4 times as wide as my 27" screen.
    2. Sequence structures should be avoided.  LabVIEW is a datflow language and only rarely are sequence structures required. There is almost certainly a way to write your program without them.
    3. The use of local variables should be avoided.  Again, they have a place but most likely they are not needed in your program. They are prone to race conditions, make extra data copies, and force execution in the UI thread.
    4. Floating point data types are not recommended as case selectors. They will be rounded and coerced to integers.
    5. Learn about the Producer/Consumer Design Pattern and state machines.  
    One possible cause of your slowdown is having the Write to Spreadsheet File.vi inside the while loop. This VI is convenient to use but it opens, writes, and closes the file each time it is called.  I have no way to tell how much data you write on each iteration but as the file grows the OS may need to re-allocate space for the file or fragment the file. These operations can be slow.
    Do you really want to Abort the program in the False case?  This will leave any outputs in the last state they had been set. This could have your motor(s) running, clutch engaged, ...  In programs which control physical hardware an orderly shutdown procedure is usually better: set all outputs to a safe condition, close files, close DAQ tasks, and indicate the status to the user.  Calling Stop allows none of this to happen.
    Lynn

  • I need an example vi about stepper motor control

    Hi.
    My system is consist of pc-tio-10 controller, SLOSYN SS2000D6 driver, NEMA 17 stepper motor,and labview5.1.
    I'm trying to give a pulse to the motor, take a pulse from the motor and control the nmotor. But I don't know what to do. So I want to see the example vi.
    Please let me know where I can get appropriate example for this case. Thanks.
    Jee

    Here is an older example from LV 3.X, but the concept is still valid.
    Attachments:
    STEPPER.TXT ‏2 KB
    STEPPER.LLB ‏197 KB

  • Quanser DC Motor Control Trainer Missing Some VI's

    Hi, my name is Ansel. I am working on a project to set up an NI ELVIS with the Quanser DC Motor Control Trainer board and create a few very simple experiments demonstrating basic mechatronic functions.
    I've been unable to utilize the VI's that came with the Quanser DC Motor Control Trainer board. The disc that was included must have been faulty because not a single file (not even simple html files) would open. I contacted Quanser about this and was directed to a website (http://www.meqtronics.com/public/requests/QCI_TEMP/QNETCDv1.20forLabVIEW8_5/) from which I was able to download the content of the disc. The files I downloaded seem not to be broken, however when I attempt to run one of the VI's, such as "04-QNET_DCMCT_Speed_Control," all but four of the sub-VI's necessary are found. The four missing VI's are "Intergrator.VI," "Integrator (DBL).VI," "Transfer Function.VI," "and "Transfer Function (DBL).VI." I have all the necessary components installed, as far as I know, and a search of my computer's hard drive returns no results for any of these VI's. I am running the full version of LabVIEW 8.5.
    I would appreciate advice from anyone concerning this issue, but I'd also like to know if the Quanser Trainer VI's are the best way to learn how to create my own very simple VI's. All of the documentation I have found on the internet has referenced the trainer VI's that were supplied, so without them I haven't made much progress. I am only interested in a very simple open-loop system for controlling motor velocity as well as a slightly more complex closed-loop system. Is it worthwhile to get the Quanser Trainer VI's working or could I build these experiments from scratch?
    Thank you for your time.
    Ansel
    Message Edited by Ansel on 04-29-2008 04:50 PM

    Ansel,
    Just to clarify, the version of the NI-ELVIS software that you may have is not the reason for the missing VIs in the Quanser program you downloaded.  The VIs in question are included as part of the LabVIEW PID Toolkit, which I'm assuming is not installed on your machine. However, these particular VIs (Integrator, Transfer Function, etc) are fairly out of date, and they are only included in the PID Toolkit to support legacy code.  I'm not sure if you have access to the PID Toolkit (it is also included as part of the LabVIEW Real-Time Module), but I would not suggest purchasing it just to get this Quanser code working.
    If you are going to be focusing on simple open-loop control of the Quanser DC Motor, you could start by looking at some of the basic DAQmx examples.  Driving the motor at a certain velocity would just require supplying a constant voltage through a DAQ output.  If you want to do more advanced closed-loop control, the LabVIEW Control Design & Simulation Module might be worth taking a look at.  Take a look at the 3-hour Control Design & Simulation course here.  It is written specifically with the Quanser DC Motor board in mind.
    Chris M.

  • Can I use SoftMotion to simulate a PID motor control loop using a Solidworks model?

    Hi
    I'm not a labVIEW user yet. But I probably will become one when I can do the following:
    I have a Solidworks model of a complex machine with multiple servo motors. Can I use labVIEW plus SoftMotion to calculate the needed motor forces and aply these forces on the Solidworks model making some parts in the model move and can I get positional feedback from the Solidworks model which I can use in labVIEW to calculate the motor forces again. This way I could use labVIEW to simulate the complete motor control loop including some PID filtering.
    I could find some posts about SoftMotion, but they all seem to handle about SoftMotion in combination with external hardware. But I would like to do a complete software simulation.
    I hope this is possible.

    Hi Melomania
    Solidworks for SoftMotion works in an interesting manner. First SoftMotion runs in labview and plots a trajectory path based off the input from the user. The generated points are controlled by speed, velocity and acceleration. These generated points are sent to SolidWorks where the physics engine takes over. SolidWorks calculates the ammount of force required to move the component the given distance and also if there are any collisions that take place. Basically the whole process is open loop with no PID being implemented. The purpose for the software is to test your motion system for collisions and calculate the required torque for your motors to move and the velocities and accelerations provided. A system prototyped with SoftMotion Solidworks will still need to be tuned when constructed in the real world.
    For your application I would look into Control Design and Simulation Toolkit.
    Thank You
    Eric Reid
    National Instruments
    Motion R&D

  • Stepper motor control - missing MG17Motor ActiveX object

    Hello,
    I am trying to contrl Thorlabs TDC 001 using LabView 9 SP1. Whe I follow the tutorial to create an ActiveX control(http://www.thorlabs.com/images/TabImages/GuideToLabVIEWandAPT.pdf), I can't find the MG17Motor option even though I have installed Thorlabs APT.
    Does aanyone kknow how to solve this?
    Cheers!

    Hello,
    I used attached Labview code to manage stepper motor control (TDC001 Thorlabs) to translate a sample in my setup, but since some time I obtain an error constantly (attached log). This translation system still works properly with thorlabs software, it also worked with this code, therefore I am really confused why such an error occurs. I just got started with Labview and programme wasn't created by me, so maybe someone explain what is wrong.
    Thank you in advance, Vasili

  • Quanser DC Motor Control Trainer missing VI's for labview 2009

    Hi my name is phillip, a student developer working with labview 2009 and the Quanser DC Motor Control trainer with ELVIS II. I have failed to run the VI for speed control, it appears to be broken and says four sub-vi's are missing and they are "Intergrator.VI," "Integrator (DBL).VI," "Transfer Function.VI," "and "Transfer Function (DBL).VI.". I happen to have installed the control design and simulation toolkit but this has not solved the problem. Please help!!!!

    Hi Phillk, I have the exact same problem with the missing VIs for the Quanser DC motor control with the NIELVIS also for Labview 2009.
    Can you please tell me where I can find these VIs? Can you send them to me if it is possible?
    I would really appreciate it, 
    I need the Transfer Function.vi,  Transfer Function (DBL).vi and the integrators too.
    Thank you, 
    Carlos M. Rodriguez  
    [email protected] 

  • Looking for the basic Tutorial for Labview 5

    I have a student who I would like to have learn labVIEW. But all of my systems are running labVIEW 5.1 I am looking for the tutorial which starts assuming that you know nothing of this program, and steps you through writing several programs.

    There was a tutorial included with the LabVIEW 5.1 CD. You can also find some links to on-line tutorials here as well as links to some LabVIEW books. I don't know how many of the tutorials or books are specific to LabVIEW 5.1 but the basic LabVIEW functions haven't changed that much and there should be enough to get someone started.

  • DC Motor Control - AKD Drive and LabVIEW Softmotion

    Dear all,
    I need to control a DC motor, which basicly has to rotate from -15 degrees to +15 degrees with changeable frequencies/time period.
    The motor is used for inducing vibrations, thus the frequency and positioning must be (easily) controlled in LabVIEW.
    My setup looks as follows:
    cRIO 9082, NI 9514 C-Module, AKD Servo drive and an AKD DC Brushless motor.
    Until this point i have used a "Contour move block - repetitive" for controlling the engine using a table, however, this doesn't allow me to configure velocity and acceleration etc. Furthermore, I don't know what units the block inputs are (radians, degrees, units/rotations whatsoever) - See pictures for details on diagram and setup.
    Also, i would like the possibility to actually see and/or control a PID-controller using the feedback option.
    So, i short, i basicly want to:
    - Control the positioning of my DC motor (from -15 to +15 degrees).
    - Control the motor using a PID controller (not necessarily needed, but i would like the possibilty)
    - Control the velocity, acceleration, deceleration and frequency/time period.
    Thanks in advance - looking forward to some good answers! 
    Have a great easter holiday.
    Best regards,
    Jzaulich
    Attachments:
    Motion and error.PNG ‏20 KB
    Project tree.PNG ‏22 KB

    Hi Anders,
    Thanks for your reply.
    I have the softmotion module installed and working - thats not the issue.
    However, at the moment i'm using the "countour move" example provided with the SoftMotion module.
    It works fine, however, it doesn't allow me to change the system too much and the unit of the input is not denoted anywhere (radians, degrees, revolutions etc.).
    As i am all new to both LabVIEW and SoftMotion there's obviously a lot of obstacles.
    I would like to model the motor control using a PID regulator with the position as input - is this possible, without making it too complex?
    Best regards,
    JZaulich.

  • Using LabVIEW for temperature control with AMREL SPS200-50-A022 power supply

    Hi, I hope someone can help me out. I'm an ME undergrad with pretty much no knowledge of LabVIEW. I am working a project which requires a temperature controller. Previously, we were using an SPS120-10 power supply from AMREL and a grad student wrote a LabVIEW VI which performed feedback temperature control. The VI would acquire temperature from a Benchlink which acquire the temperature from a thermocouple. The VI also monitor the output voltage & current and determine the power output and heater resistance from those values. When a desired temperature is set, the VI compares the actual temperature to the set temperature and adjust the voltage/current setting to achieve the desired temperature. The VI was designed to keep temperature deviation to within +/-0.5 deg C. I'm not sure of the data refresh rate, but it's on the order of seconds since the system has a small thermal mass and we're operating in the 800+ deg C range. When we were using the SPS120-10, the device used GPIB for communication with the PC. Due to higher power output demand for the heater, we switched to an SPS200-50, which only has an RS-232 port. First of all, I was wondering if someone could help me modify the VI so that it could communicate with the SPS200-50 through the serial port? In addition, the drivers for the SPS120-10 and SPS200-50 might be different. If modifying the VI to communicate through the serial port isn't enough, I would need to figure out where to modify the VI with the SPS200-50 drivers, which is provided by AMREL. If anyone would like, I can send you the VI files so that you can take a look at the block diagram and tell me where to modify it. I'm still not 100% certain I understand how to read LabVIEW block diagrams.
    Please let me know if you need any additional information. Any help would be appreciated. Thanks in advance!

    I have looked over your vi. First of all you have to do some changes in the "ARSPS Initialize.vi" See picture.
    The best way to check instrument communication is to send the *IDN? Command. The instrument will indentify itself in response to this command. The vi I have included is a labview example. Use this Vi to test your communication. Do not progress before this is working. The VI is also an excellent example on how to set up and close down RS232 communication.
    The VI "Tfeedbackpowercontroller-nolvdt-Dinh.vi" looks OK so I guess it will work then your RS232 communication with the SPS200-50-A022 is working
    good luck
    PS as mentioned before you will find all the RS232 details in the instrument manual
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)
    Attachments:
    sample.PNG ‏38 KB
    Basic Serial Write and Read.vi ‏29 KB

  • Really need help (motor control using labview)

    hi all readers,
    im new beginner. really need help for my project. i've been assigned to monitor/control motor using labview 8.5 (using NI DAQmx). the problem is, the techinician told me that i cant use 3phase motor with this card. things that i need to displayed using labview is :
    torque
    power
    current
    voltage
    speed
    really appreciated if readers can help me with this:
    wut type of motor shud i use that compatible with NI DAQmx
    thanks a lot.

    Hi fauziana,
    NI data acquisition devices are primarily designed to take measurements, so it's a good idea to measure the signals that you have mentioned with a DAQ device.
    You also can use DAQ devices for control tasks, but for reliable and deterministic control behavioryou typically need to use a real-time operating system (not Windows!). If you want to learn more about the pros and cons of using DAQ devices for motion control tasks, please refer to these threads. Still for standard motion control tasks it's much more efficient in terms of development time, to use a dedicated motion control device for the motion control part of your application.
    In general the control part is independant from the motor type, as these devices only generate control signals (+/- 10 V). There are many power drives available, that accept this type of control signal and you should select your motor according to the requirements of your application.
    For a more detailed system consulting, please contact your local NI branch. To select the products that fit best to your application requirements a face to face discussion is much more efficient than a discussion forum thread, because there are a lot of parameters that need to be taken into consideration. If you tell me in which country you are living, I can provide appropriate contact data to you.
    Thanks and kind regards,
    Jochen Klier
    National Instruments

  • Labview example for data capture using 5102 scope card

    How can I program a Labview Vi to control, and capture a waveform using the 5102 scope card. I need to be able to set it up to continually capture a waveform (Channel 1 and Channel 2) when triggered on a rising edge of channel 1 and then store the data on disk automatically, then wait for the next trigger.
    Any help or tips as to how I could do it would be helpful.
    Thanks
    Allan

    Allan,
    Please find the attached zip file that has some useful LabVIEW examples with scope 5102
    Zvezdana S.
    National Instruments
    Attachments:
    scope.zip ‏181 KB

  • Simple motor control with Labview

    Can anyone suggest a simple motor to be controlled by labview. I am interested in making a small scale elevator that is controlled with a labview interface. If anyone could point me in the right direction it would be greatly appreciated. - Bryan

    Attached is the vi for the program.  I will also try and attach the C code for the project.  It took a lot of failed attempts to get it working so I hope this works for you.  I don't have a schematic for you, but if you look over the C code it should let you know.  Also I used the CCS development kit 16F877A.  I'm not great at programming in C so there is a good chance you can clean it up a bit.
    I'll keep an eye on this post if you have any questions, when winter comes I'll probably work on this some more.
    Message Edited by nutmegzzzz on 09-19-2005 01:56 PM
    Attachments:
    Serial Read with Timeout version 1b.vi ‏169 KB
    LED and Motor Control from LabView - Complete.c ‏3 KB

Maybe you are looking for

  • Mail Adapter Use Mail Package, Mail Body and Attachment

    Hello Have some body a idea, how I can configure the mail adapter with use mail package, that I have in the mail a attachment with content from the messages and a mail body with also text from the message. Thanks for your reply. Regards Tom The diffe

  • When I click on pictures they will not enlarge

    when I go to a website and there is a photo of an article for sale and I click on the picture to enlarge, the new window opens up blank

  • Looking for external Lightscribe DVD burner drive

    Does anyone have experience or a suggestion for an EXternal Lightscibe compliant DVD burner for Windows 8.1?

  • Number to Word Convert Function

    Dear All, Plz anybody have function name which can convert NUMBER to WORD. example:  1213 to One Thousand Two Hundred Thirteen thanks, RP

  • Problems with 2 computers and one ATV.

    Hi All, I am still having a few problems setting up my ATV as I want to. I have searched the forums and learned loads, but I still have a couple of areas that I need help on. I have a 40Gb ATV. I have an iMac G5 and a PB G4 both connected wirelessly