Controling Position and Velocity of trolley

Hey,
I am working on an application for a engineering design project that requires me to control the position and velocity of a trolley on a linear track.
I have done some work in LabWindows before controlling the speed and position of a linear movement but am having some troubles shifting my knowledge from a small application to what I am working on now. This is what my plan is; I currently have a motor (DC 24V 88A), String potentiometer to determine linear distance travelled (there was risk of slip and need of high precission), sufficiently sized power supply and BNC-2110 DAQ.
My plan (which I am looking for some feedback on ... no pun intended) is to use LabView to create a PWM (which has already been done) to control the speed of the motor via the counter turning on and off a power mosfet completing the Motor's circuit. By varying the time on and off I hope to control the speed. 
After this has been completed I hope to hook up my string potentiometer to the Trolley and see how it's position changes over time (i.e. determine the speed at which the trolley is moving at for a variety of different % time on and off). This will act as an open loop test, which I was hoping to then figure out a practical transfer function for the motion of the trolley and then somehow use the String Pot as a feedback sensor to complete the loop and create a PI controller. I am having a hard time wrapping my mind around how I am suppose to put the later bit into practice. It all sounds fine on paper but actually approaching an implementation of this idea is boggling my mind.
Any input or pointers would be greatly appreciated. Am I on the right track or am I looking at something completly wrong... being a student I guess I don't know exactly how things are done in practice in industry, just what is written in books so any help would greatly appreciated.
Thanks!
Mac

Mac,
starting with an open loop system, determining the transfer function and designing the control algorithm is a reasonable approach albeit a little bit academic.
A more empiric approach is tuning the closed loop motion control system by means of test functions like white noise or a setpoint step. Here you can find some information about tuning a motion control system by analyzing the step response of the closed loop system (Please note, that this document refers to NI motion control boards, but the general approach of the tuning process is universal).
This brings me to something very essential. Stable control systems require a deterministic real-time environment. You haven't provided explicit information about the environment that you are intending to use, but it sounds like you are planning to use a Windows based system with LabVIEW. This is not recommended, as such a system can't guarantee stable control loop timing, which is at least as important as the right set of PID parameters.
So my recommendation here is to use either a motion control board which runs the control algorithm onboard or to run the application with the DAQ board under LabVIEW RealTime (could run on a PXI-system or on desktop PCs that meet certain requirements). If you are going for the second approach, you may also consider using the NI SoftMotion Development Module.
If there is any kind of campus license of NI-Software available at your university, all the required software components should be already available for you.
Last but not least here are some considerations about the power circuitry. You have suggested to use a PWM signal that controls a single mosfet. This approach is not feasible in most applications, as it doesn't allow you to control the position and the speed of the motor accurately. To do this, you need to be able to drive the motor in both directions. You could do this by using an H-bridge circuitry, but this requires some more considerations when designing the control algorithm. In fact in most cases you would work with two cascaded control loops. The inner control loop is the current control loop, that generates the signals for the H-bridge, while the outer control loop is the position/velocity control loop.
Depending on the focus of your project, you may also consider using a commercial motion drive that provides the power circuitry and the current control loop. Those devices typically provide a +/- 10 V input for an external control signal that is provided by the outer control loop.
I hope this information provides some ideas to getting started.
Kind regards,
Jochen Klier
National Instruments

Similar Messages

  • Use incremental rotary encoder to measure the absolute position and velocity

    Hi all,
    I faced a problem by using incremental rotary encoder to measure the absolute position of the rotation. 
    I'm not using NI-Daqmx but NI-motion module. In NI-motion module, I use read encoder position.vi to read the position of the encoder. 
    However, the readings is in incremental form. I'm doing the feedback control, so I need the absolute position and velocity.
    Is there any functions or vi in the labview that can be used to transform the information of incremental encoder to the absolute one?
    Thanks
    Jun Wong

    Jun,
    1. The incremental encoder provides incremental position. After switching on the encoder power the encoder counts upwards or downwards. For the absolute position you need the index (R or I) signal. I don't know which type of incremental encoder you have but there should be A, B and (I or R) signals. The index signal should reset the counter to zero setting this way a pseudo-absolute-position (which is lost after the first switch of). Most of the motion controllers have a mode, just after switch on, in which the controller search for the Index. This mode is called Homing. 
    2. Velocity. It's very simple. You sample the position with a fix sampling clock. Let's say: 10kHz. The speed is: (Actual Position - Previous Position) / Sampling Period. Pos[n] = 10.000inc, Pos[n-1] = 9.900inc. Speed = 10.000 - 9.900 / (1/10kHz) = 1.000.000 inc/sec. If one increment is 0.0001mm then the speed is 100mm/sec.
    Paul 

  • Define Control Position and Size Numerically (in a new Properties page)

    It would be quite helpful to have a Property page for Front Panel Controls and Indicators where you can define the size (height, width) and position (top, left, related to its container, which can be a panel, a sub-panel, a Tab control, a cluster,...).

    Duplicate: Add Position to the Properties Dialog

  • Determining position and velocity using an accelerometer

    I have a test subject (elevator), and I'd like to use an accelerometer and graph out position v time, velocity v time, acceleration v time. Has anyone ever done this? I am getting stuck on how to obtain my velocity and position when the elevator is at a constant velocity. I tried to use statistical analysis and determine the velocity based on the length of time during acceleration but the timer for max value seemed to keep increasing even when velocity was at zero. Can anyone give me insight on this project?

    Zero acceleration is NOT the same as zero velocity.
    Zero acceleration just means your velocity is not changing.
    I set up a test that used an array stating I had a constant acceleration for a given period of time, then 0 acceleration for a given period, and then a negative acceleration. This was so simulate the elevator moving from the ground level to the top floor. 
    In a simulation, if your +accel is the same magnitude as your - accel, and the +accel time is the same as the -accel time, and if you start from a velocity of 0 and a position of 0, then it seems like your simulation would be correct: the elevator is at rest, it takes off at a certain accel rate until it reaches "cruising speed",it cruises for some time, then decelerates to where velocity = 0, and remains there.  Position is somewhere other than zero.
    Maybe you can post your simulation code?
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Encoder Position and Velocity Measurements and Force Measurements

    Hi,
    I am using a USB 6210 DAQ Card and an optical encoder and force transducer together in an MRI room to measure the power ouput of a patient pedalling on a recumbent ergometer. I would like to obtain synchronous measurements and output this to file. I have started working on the code for the encoder. I am struggling to get the frequency measurement and encoder position outputting fast enough. Any idea why this is? For the force measurements will this be with the same configuration just adding Vi's for analog input. Also I know using the write to measurement file vi is quite slow to write to a spreadsheet what is the more efficient method for doing this.
    Regards,
    Darren
    Attachments:
    Angular_Position and RPM.vi ‏46 KB
    Angular_Buffered.vi ‏80 KB

    Hello Darren,
    The fastest file to write to in LabVIEW is a binary file.  The specific file type used by LabVIEW is the Technical Data Management (TDM) file.  The TDMS file is a version of this file specifically designed for streaming applications.  You can find several examples of writing to this file in the NI Example Finder (Click Help -> Find Examples).  By using the search tab, you can use the keyword “TDMS” to search for all of the examples that use the TDMS file type.  The example Cont Acq&Graph Voltage - Write Data to File (TDMS) can be found from the search tab, or by using the path Hardware Input and Output -> Analog Measurements -> Voltage.  While the data acquisition part of this example pertains to analog input, the same file input structure can be used with your counter input tasks. 
    What do you mean that the encoder and frequency measurements are not fast enough?  Each rising edge of the sample clock source will latch the current value of the measurement into the FIFO and transfer this value into the buffer.  At this point, how quickly you can read the buffer will affect how quickly the user is updated with the newest measurement information.  Since you have specified the number of samples to read in your buffered example, the read VI will wait until that many samples are available in the buffer before returning a measurement (this could slow down the update rate for the user).  By specifying -1 as the number of samples to read, you will read all available samples in the buffer.  If there are no samples available, nothing will be returned, but the VI will continue to execute.  Hope this helps. 
    Regards,
    Browning G
    FlexRIO R&D

  • How to Measure Position and Velocity with a Single Counter with myrio

    Hi Everyone , I need your help .
    I got myrio a few days ago for my project which is a electric vehicle drived by wireless mode so first problem faces me that I have encoder and it give me counts (decreasing or icreasing) which I can't convert it to veolcity any one may help , I will be grateful ???????????????????

    Hey Hesham92,
    As you mentioned the myRIO encoder counts pulses.  These pulses will typically come from some type of encode such as a quadrature encoder.
    Look at your encoder datasheet and it should explain how it works (which mode it uses) and the resolution (ie rotation per pulse).    If the encoder is attached to a wheel you can use some simple math to determine how many cm the wheel moves per encoder pulse.
    Let us know if you have questions about this (please also post more info about your setup such as the encoder, what it's attached to and what you need to measure).
    Thanks!
    -Sam K
    LabVIEW Hacker
    Join / Follow the LabVIEW Hacker Group on google+

  • Can the position and szing of a control element in a View be controlled from the ViewModel?

    Is it possible to change the position of a control, say a label, as a response to some action/operation from the ViewModel?  Like if one response to something is true then place the label in the top left corner.  If false, place the label
    in the lower right corner.  I realize you could have a label in each position and just set the visibility.  But can the position and sizing of said label be controlled from the View Model?  What would be a sample coding of this?  would
    it be in the xaml or combination of a method in the ViewModel and the xaml? 
    Rich P

    First off Rich, say TextBlock to yourself ten times.
    Use a TextBlock rather than a label.
    There are a bunch of different ways to do this and the easiest is to have two controls whose text is bound to the one property.
    Bind the Visibility of each to another 2 properties in the viewmodel.
    Collapse one and Visible the other.
    The reason for that is that it's easier.
    Technically, you could put one textblock in a grid and use margin to control this.  You could animate x y co-ordinates and move the textblock mysteriously across the window if you put your mind to it.
    Or you could put it in a row/column "cell" of a grid and change which cell it goes in - but that would involve some mechanism like messaging from the viewmodel to the view and is not really ideal if you can avoid it.
    I'd have a pair of textblocks, here's one:
    <TextBlock Name="TopLeftMsg"
    Text="{Binding Msg}"
    Visiblity="{Binding TopLeftVis}"
    Both would bind to a public string property msg in the viewmodel.
    They each get their own public visibility property  and that'd be switched between Visibility.Visible and Visibility.Collapsed.
    Sizing of textblocks is best fitted to content because all you see is the text.
    Textboxes are arguably different because you can see the things.
    Hope that helps.
    Recent Technet articles:
    Property List Editing;  
    Dynamic XAML

  • How can i design square signal which having a positive and negative values equal to each other and separated from each other by controlled time or distance

    How can i design square signal which having a positive and negative values equal to each other and separated from each other by controlled time or distance, As it is shown in the figure below. and enter this signal in a daq.
    Solved!
    Go to Solution.

    By the time you spend for the nice diadram you might have done the vi
    Your DAQ like to have a waveform (array of values and dt ak 1/samplerate)
    If you set the samplerate you know the array length , create a array of zeros, and set the values of both amplitudes ... 
    Since I don't want to wire others homework here are some pictures
    And there are some drawbacks is room for improvement in my solution, just think of rounding errors ... and what might happen if the arrays get bigger ....
    Spoiler (Highlight to read)
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

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

  • How to accomplish Torque and velocity control of an axis using NI motion controller

    Used torque transducer as a primary feedback. I am able to control the torque. Used Encoder feedback as secondary feedback to control velocity. But when I run the axis at 5 rpm, I observe velocity variations of more than 200 %. What is the nessasary change Should I make to control both Torque, velocity accurately?

    Hello,
    Here are a couple of suggestions that might help:
    - Tune the PID parameters so that step response will be overdamped
    - Increase the PID loop update period
    - Reduce the noise on the analog signal coming in. 7350 series controllers are going to be better for this because they have a 16-bit ADC resolution versus 12-bit on the 7340 series.
    Hope this helps! Let me know if you have any questions regarding this.
    Best regards,
    Yusuf Cavdarli
    Applications Engineer
    National Instruments

  • JSlider or similar for controlling position in sound files help please.

    You know how winamp, wm player , etc, and JMStudio all have a "slider" bar to control position, along with a "numeric readout" of the current position.
    Fairly new to Java, but know this isn't a difficult thing to do, just haven't found out how to do it.
    Do not care if it is with JavaSound API or JMF, either is fine, just learning.
    Have read up on Sliders at:
    http://java.sun.com/docs/books/tutorial/uiswing/components/slider.html#labels
    But do not understand how to implement it with Audio file usage.
    My goal as a new programmer is to create a simple audio playing Applet:
    For a GREAT idea on what it will basically do check out:
    JMStudio:
    http://java.sun.com/products/java-media/jmf/2.1.1/jmstudio/jmstudio.html
    My goals are to have:
    Applet
    GUI with: Pause/Play button and a SLIDER to control position, just like described.
    Have it load and play an audio file when a link is clicked on using the PARAM tag from html
    I know about the open source/commercial products,,,, but I'm trying to learn, and those are too in depth to try and learn from right now, trying to take baby steps, and having difficulty finding anything beyond play()
    loop() and stop()
    searched google, groups, yahoo with various phrases.
    Thank you!

    You have to use a JSlider and combine its events with the setMediaTime method of the player.

  • Control panel and Console not working

    Hi,
    I have installed various Java Runtime Environments, all of which run applets flawlessly. There is one problem though, I need to enter an application that needs a certificate for security, and the dialog opens as a blank screen. I'm not positive, but it is similar to when I open the control panel and the console; a blank screen. Is there a way to fix the control panel and console so it doesn't show up as a blank screen, short of reinstalling the OS? I am thinking if I fix the control panel, it might fix the security dialog.
    System: XP SP1

    I have noticed that when i maximize a window that is blank ( i.e. the console or java web start) the screen refreshes and the window is displayed.

  • Control + Click and Drag

    Hi there,
    Scenario
    I need to use Google Chrome on my early 2011, 13' Macbook Pro (running Mavericks 10.9.2) for an online job. They have their own interface which is only supported by Chrome and not Safari or any other browsers.
    Problem
    On some specific tasks that I do, I need to draw a box on the interface while Pressing the Control key, but when I press Control and Press mouse button to draw the box, it brings up the MENU.  This doesn't seem to be working with Command key either, since unlike windows, CTRL is COMMAND in mac.
    I need to figure out how do Control + Click and Drag in the interface.

    I don't see anything via that link that I can relate to this posting.
    If you want to make the change in frames happen solely based on the direction (x) that the mouse is being moved, then you need to test the current position of the mouse against the last known position...
    var startPosition:Number = mouseX;
    wwr_mc.gotoAndStop(10);
    stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouse);
    function onMouse(e:MouseEvent): void {
        if (mouseX-startPosition >= 0) {
            wwr_mc.nextFrame();
        } else {
            wwr_mc.prevFrame();
       startPosition = mouseX;
    I am not sure what you find as being too fast.  When you are doing things relative to an extended event, such as a mouse being moved for some time, then it is highly likely that the event will execute the event handler function repeatedly... as fast as the frame rate of the file allows.  So if you want more control of the rate at which mouse moves effect nextFrame/prevFrame function calls, then you need to build in some form of delay.  In the example below, it takes the form of removing the mouse move event listener for a short period using a timing function (setTimeout in this example, though you could use the Timer class as well)
    var startPosition:Number = mouseX;
    var delayTime = 250; // 0.25 sec
    wwr_mc.gotoAndStop(10);
    stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouse);
    function onMouse(e:MouseEvent): void {
        stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouse);
        var currentPosition:Number = mouseX;
        if (currentPosition-startPosition >= 0) {
            wwr_mc.nextFrame();
        } else {
            wwr_mc.prevFrame();
       setTimeout(setListener, delayTime);
    function setListener(){
       startPosition = mouseX;
       stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouse);

  • TS3274 I went to an Apple store yesterday and the guy there did something and now the ipad only works in the vertical (portrait) position and not the horizontal (landscape) position.  How can we make it work in both positions?

    I went to an Apple store yesterday and the guy there did something and now the ipad only works in the vertical (portrait) position and not the horizontal (landscape) position.  How can we make it work in both positions?

    Just in case you are not running iOS 7 and don't have the control center feature.....
    If you see a lock icon in the upper right corner of the screen - then the screen orientation is locked.
    Try the side switch above the volume rocker first and see if that unlocks the screen. If that doesn't do it and you are running iOS 5 or 6, double tap the home button and swipe to the right and look for the lock icon all the way to the left.
    If you are running iOS 7, swipe up from the bottom of the screen to get to the control center and the lock icon is in the row of icons at the top all the way to the right.
    If the screen is unlocked but still will not rotate, reset the iPad.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the button

  • Encoder position to velocity

    I am a beginner DAQ user and am trying to use a PCI-6110S to measure the velocity of rotation of a quadrature encoder. i am able to monitor the position change, but do not know what time component i can use to convert the position to velocity and acceleration. pls advise.

    Hi ALL,,
    i've seen the link that u give to me..
    As my picture below..
    I've gotten a position value in single sample..
    When
    i use your advice(it's a N sample method that is formed in array and of
    course it uses sample clock method by ither counter)
    So how can i easily develop RPM(velocity) value by its position? and even i get fixed time interval i can't..
    ~my optocoupler just has 2 output:
    TTL signal and ground 
    Any comment would be appreciated..Thank
    Ariawan. 

Maybe you are looking for

  • Facetime dont work

    my facetime dont work whith lion

  • Want to reinstall software due to "Error 48: File or folder does not exist." but can't find discs !

    In 2010, I bought the student version of CS5 including Photostop, InDesign, Illustrator, and some other things. The package was $200 contingent on me being a design student and I was required to send them documentation and everything. Now, nearly 2.5

  • Importing Home Folder after new hard drive and Lion Update

    (Okay, long title.) Had to replace my hard drive. Was running Tiger.  Backed up my entire Home Folder only, on an external harddrive, before it failed completely. Hard drive replaced, and then loaded Snow Leopard, updated to latest version, 10.6.8. R

  • Performance problem due to anonymous blocks

    Hi, One of the users on our database has created a procedure consisting of many blocks like the one given below: begin select func1(var1,var2,var3)into vcompvalue from dual; if vcompvalue < 0 then vcompvalue := 0; end if;      exception when no_data_

  • Newbie question Temporary Tables

    Hi, I'm trying to do a comparison between 2 tables but since the realtionship between them is a many --> many I need to summarise the data from each before doing the comparison I've done this before in SQL server by using temporary tables as in SELEC