Labview beginner at motor control

I need to make a phigits motor with encoder rotate 1 revolution change directions for another revolution and then back to the original revolution.
I have tired many programs but all have crashed the system.  Any advice on how to do this effeciently?
What structure to put them in?
The timed loops look really complicated for my application
Should I be trying to modify the sign of the motor input with a piecewise defined if, if else code?
Thanks for the help!

Did you go to website and look at the examples for labview? http://www.phidgets.com/docs/Language_-_LabVIEW#Quick_Downloads

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

  • 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

  • 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] 

  • 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

  • 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.

  • DAQ and motor control in the same VI

    Hello,
    I am a beginner in labview and I am trying to control a maxon motor and run a NIDAQ at the same time. Basically, I need to measure the pressures and the angles at the same time and record these.
    The problem that I am facing is that when I execute the VI, the motor runs first and this is followed by the measurement. I have twiddled around with it a lot getting a lot of help from this community but I can't figure it out. No matter what I do the motor starts running first and after the motor has completed its movement then the DAQ takes the measurements.
    Is there any way to run the motor and the sensors together? I can run the motor seperately and I can run the sensors separately in their own VIs but can't seem to run them sequentially.
    Any help would be appreciated.
    Aman
    Attachments:
    VI.jpg ‏64 KB

    In LabVIEW, your wires between VIs (and structures like While Loops) determine the order in which things happen.
    There are several approaches that you can take to de-couple the motor and DAQ processes.  The most obvious would be to put the motor control in one while loop, and the DAQ in another.  Yes, you can do this in LabVIEW.  Just don't get too carried away.  Each loop usually will go to a separate core to run.
    If there is data that has to be shared between the loops, you can use local variables, or the Value property nodes of the controls and indicators of your VI.
    Machine Vision, Robotics, Embedded Systems, Surveillance
    www.movimed.com - Custom Imaging Solutions

  • Maxon Motor Control and NI UMI7774

    Hello,
    I am using maxon motor control PWM servoamplifier ADS 50/10 for my application.I am currently working on a project that requires me to get the precise position (mesure) with an incremental encoder with 2 channels A and B. I am Using NI Motion, NI UMI-7774,NI PCI 7550, and Labview 10
    I try to connect my maxon direct with the Labview Hardware NI UMI 7774 and i don t know how to do this.
    anyone have any idea?

    Hello,
    can you please give me some more informations about the problems you see with the connection?
    Generally you have to at least connect the "Analog Output", the "Ground" and the "Enable" from the NI-7350 with the Maxon ADS 50/10.
    You can find an overview about the pins of the NI UMI-7774 here on page 16/17:
    http://www.ni.com/pdf/manuals/373359c.pdf
    The connector for the Maxon you can find here:
    http://www.farnell.com/datasheets/6244.pdf
    Please tell me, what informations you are looking for.
    Johannes

  • 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.

  • New to Motor Control, Seeking best approach

    Hi...  I have an upcoming task where we want to have a LabVIEW based motor control applied to a round, rotatable table inside a coating chamber.  The table will be on the order of 20 inches in diameter, made of aluminum and I will guess that it might weigh around 10 pounds.  We will have four equally spaced quadrants where a silicon wafer will sit in each quadrant.  On command we want the table to move to one of four locations where it will hold for quite some time (minutes to hours) while that one wafer is exposed to coating material.  Then we will want it to move to the other three positions in a similar way.  We want to have feedback that the table is where we think it is and we want to be able to define and return to a "home" position when desired...   There is a possibility that we might also want small motors on each of the four individual stations, meaning we would add some planetary rotation capability for each quadrant while still having overall motion control of the larger 20" round platform..   I'm not yet sure of the desired rotation speed of the small planetary components. but let me guess at say from once per second to once per minute...  On the other side I can imagine a case where they might want these to truly "spin" at say 1000 rpm.  For the larger 20" table I would say that needs only to be able to move one quarter of a revolution in say 10 seconds but when it stops it needs to hold accurately...    
    We will have a PC running LabVIEW controlling this and other features of the process...  Certainly a PCI backplane will be available but we have budget to also buy other interface chassis if that's what is recommended... It's a one time deal so we only need to build one system.  
    I am seeking feedback on what's the best motor type, controller, interface, etc for this kind of application...  Your thoughts???   Any feedback will be much appreciated...  thanks.. bob...

    Hi Bob,
    Here are a couple of links to get you started:
    Configuring a Motion Control System
    This is a good general intro to motion control and breaks down what NI provides in the way of Motion drives and controllers as well as the pros and cons of the different types of motors we support. 
    NI Motion Hardware
    This is a break down of all the hardware we sell.
    http://www.ni.com/motion/
    Please let me know if you have questions after looking through these links.
    Message Edited by Michelle_B on 10-20-2008 02:35 PM
    --Michelle
    Instrument Control R&D
    National Instruments
    Instrument Control
    Machine Vision

  • Position drift during the stepper motor controlled back and forth motion

    Hi everyone there,
    I get a headache position drift problem during the stepper motor controlled back and forth motion. I have been wroking on the problem for the last two weeks, and still can not figure it out. So I write down here my problem in hope of getting some clues from those have some experiences in stepper motor motion control.
    My goal is to use a stepper motor to drive a beam flage fixed onto the shaft to go back and forth for a certain angle, and this back and forth motion needs to be stable and reproducible within hours. With the SMD1 stepper motor driver, I only need to send in a pulse train to control the number of steps(the pulse frequency defines the stepping rate), and another pulse to controle the direction (i.e., cw or ccw). To do this, in LabView, I used the counter of the DAQ board to produce a finite pulse train to step the motor, and used one digital line to produce a pulse to switch the direction every 500ms, the timing is contolled by the software.(I used the oscilloscope to monitor these two pulses, the pulse train produced by the counter looks very stable, and delay between the pulse edges of the direction pulse and the pulse train is also very stable within 500ms. There seems no software timing problems at such a long delay.)  And this labview controlled motor appears to work perfectly as I required, the motor steps a defined number of steps at one direction, and then steps back at the origin position. But after running for a few minutes, the back position shifts gradually(I can not observe a obvious shift at the first few minutes) with repect to the origin position(the position I start running). I looked it up at the manual and also the website, I got a clue that this might because the motor steps at the resonace frequency of the motor and hence misses or takes extral steps sometimes. So I changed the steping rate from 1Hz to 1000Hz to see if the shift disappears or gets smaller at certain frequency range, but the shift always exists.
    I did observe the shift got smaller within the same running time when change the step model from full step (1.8degree/step)to half and quarter step model. According to this, the motor did miss steps (or pulses) during running, the quarter step model has smaller shift due to the smaller steps.  But I also noticed that the motor always shift at one direction, no matter I started with clockwise or counter-clockwise, this seems really strange to me. Because the motor should shift at each direction with the same probability if we assume the motor missis steps randomly.
    There is something must be wrong, either the labveiw program or the motor, but I don't even know a clue of this weird shift problem. And because of this, I haven't made any progress in my lab for the last three weeks. So any suggestions could be very helpful for solving this headache and will be really appreciated.
    Thanks a million in advance and Merry Christmas!
    Li

    Hey, Brian Beal,
    Thanks for your quick response. "accel" and "decel" mean acceleration and deceleration, am I understanding right?
    If yes, then I don't have these in my LabView program, I just generate one TTL pulse train and one TTL pulse with LabView and send them into the SMD1 stepper motor driver.
    The pulse train steps the shaft, and the other switchs the direction.
    Yesterday, I confirmed that if the motor steer always at one direction either CW or CCW, then the stepping were very stable, no missing or extra steps happen for hours.
    And I also observed that the motor took one extra step  from time to time when the direction changes. And this only happens when the direction switch from CW to CCW. (bizarre!)
    I guess this indicates that some pulse noise happens when the motor switch the direction too often.  But I just don't have any clue for irregular extra steps.

  • Can I modify the Arduino sketch 'LIFA_Base​.pde' to include some motor control

    Hi there,
    I am new to Labview and Arduino. I have two Inertial Measurement Unit sensors and I wish to send the readings to a PC via Bluetooth. I read that I can perform this using the LIFA. Can I modify the Arduino sketch ‘LIFA_Base.pde’ to include some motor control? I wish to use the readings earlier to control the motor to move different directions. At the same time, I wish the readings can be sent continuously to the PC wirelessly?

    The newest LIFA_Base.pde has motor controls. The issue that I see is that the VIs are designed to be connected to the Arduino through serial.
    You could have an Arduino connected to the computer and another Arduino connected to the motors. Each Arduino is equipped with Bluetooth to create the wireless connection.
    Alternatively, and probably easier... create your own case in the LabVIEWInterface.pde to handle Bluetooth commands from the computer. In this case, you would only need one Arduino with Bluetooth (connected to the motors). *Assuming your computer has Bluetooth and you can send Bluetooth commands.
    It is hard to give suggestions without knowing the whole system. Hope this helps.
    Edit: Also, you should upload your Arduino (LIFA) related questions to the LIFA Board: https://decibel.ni.com/content/groups/labview-inte​rface-for-arduino
    CLD Certified 2014

  • 9474 motor control

    Hi together,
    i´m new here in LABview forum.
    I got the following problem.
    I got a EC-motor, which were controlled by PWM- signal.
    base:
    The interface of the motor has a "high"- Signal the whole time on it´s control- input, which is ok, because i want to interrupt it (PWM from 0-100%) with my NI card.
    I can generate the PWM- signal by NI cDAQ-9174 with NI9474 digital module from 0-100% if it´s not connected with the control-input of the interface, but í´m worry when i connect it, because then i got the whole time a "High- signal" and can´t steer this motor
    I already checked my wirements, but they are ok (same GND a.s.o)
    Thanks and the best regards
    Jo

    hi Jo,
    How do you manage to determine that your duty cycle is correct when the motor control is not connected but incorrect when the control is wired?
    Best regards 
    Florian Abry
    Application Engineer Group Leader
    NI Germany

  • Step motor control

    I would like to buy a hardware and a step motor  for control with labview. Could you please offer any configuration . I have to push with this motor a load equal to 1 kg.
    Regards 

    I'm going to assume that you are familiar with National Instruments Offerings for Motion, and that it is not what you are looking for.
    Here is a link, just in case: http://www.ni.com/motion/
    The most basic stepper motor control system will look something like this:
    LabVIEW-compatible DAQ with Digital Outputs, and Counters.  These provide the Step and Direction signals.
    A Stepper motor.  NEMA 23 and NEMA 17 are common choices.  Larger (NEMA 34) and smaller (NEMA 11, NEMA 8) choices are also avaliable.
    A stepper driver with support for step and direction signals in the voltage range that your DAQ can supply.  This is typically going to be 24 VDC.
    The torque capability will depend on the driver, the motor, and the speed that you need to run at.
    Machine Vision, Robotics, Embedded Systems, Surveillance
    www.movimed.com - Custom Imaging Solutions

  • 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

Maybe you are looking for