Sync DAQ measurements with motor controller

Hi all,
I've been grinding my head for days on this problem.
I've got an NI DAQ reading an analog voltage and a Maxon EPOS2 motor controller.
I want to read analog voltage from the DAQ at a frequency of 1800Hz and around 25 samples. For every set of samples, I want the EPOS2 motor controller to read its encoder position and have write to measurement file log all the data.
The problem I'm having is that although data values from the DAQ are recorded, they lag behind the encoder values provided by the EPOS2 by approx 50ms. This lag time changes as a function of the DAQ's rate and number of samples.
I attached an example data file. If you scroll all the way to the bottom, you'll see that the right most value (time from computer and I believe EPOS?) is different from the left most time value which came from the DAQ waveform.
I've attached my code to this post. Would some form of rendezvous or queue be applicable? Any thoughts would be most helpful.
Thanks
Attachments:
APS_linear1_5_stable.vi ‏137 KB
8_17_11_25s_1800Hz_150_2.txt ‏977 KB

Hello Ruben_D
I'm sorry this is causing you an inconvenience!  Can you please provide a link to the EPOS2 install file as I seem to be missing a number of their dependent VIs.  Thank you very much!
Sincerely,
Greg S.

Similar Messages

  • Speed measure with DAQ, how to override the noise

    Hello.
    I try to measure spped using the counter input. My VI didn't work, so I look at the singnal I get from the encoder and I saw, I get a lot of noise in my signal. That's why program shows wrong values. I connect my signal between PFI8 and DGND on my DAQ 6212. My encoder (torque transducer) gives me 60 pulz/revolution. Is it possible to nullifythe noise with program, or there is a problem with ground. I tried many different ground options, but didn't work
    Hope you have any idea.
    Thanks a lot.
    Simon

    Hello Mateusz. Thank you for responding me.
    You can see my signal taken from scope and check my vi file. Noise causes regulator of the motor I drive. If regulator is switched off there is no noise and if I turn my motor by hand, I get correct values of velocity, but when I turn on the controller, I get full of noise in my signal, so DAQ card reads all those noise as many signals, so it displys velocity much greater than it's real. I moved my daq card away from controller as much as possible and used coaxial cable, but noise still appear. I hope you have any idea.
    I hope you don't mind, because notes in my vi are written in my language. I just wrote them, that I can see what I was doing.
    Regards. Simon
    Attachments:
    DAQmx velocity.vi ‏45 KB
    scope_0.JPG ‏118 KB

  • Can DAQ send signal to motor controller?

    Dear all,
    I have been busy with a project since 6 months. This project involves a DAQ which acquires loadcell samples while a linear motor pressing on a loadcell.
    the DAQ i am using is "NI USB-6343", the linear motor controller is Newport SMC 100(has its labview drivers). I am controlling both of them with labview and I managed to build my application. BUT there is only one problem.
    The problem I am facing is: The motor controller has a limited response time like 220 ms while DAQ is acquiring sample in every 1 ms.
    So while running the tests, when DAQ's acquired value reached 5 Newton preload, the vi. stops the linear motor using the motor controller's labview drivers. Since motor controller's response time is high, this preload goes over 5 Newton, because the linear motor keeps pressing the loadcell due the the motor controllers late response time.
    So what I want to know is that: When the certain value is reached, can I force the Motor Controller to do "stop.vi" action by DAQ? , for example, Can I manage this with DAQ trigger signal options?
    Note: I built my application with case structures(like move the linear motor in true case untill a value is reached, then get to the false case structure to stop the motor and return home position)
    Kindly waiting for your responses,
    I really want to solve this problem, please help me.
    Sincerely,

    Dear apok,
    Please see the attached view of my vi. I can not try to enter lower preload to match with what I really want, because it is unpredictable and it is not professional solution.
    It is always 220 ms for motor controller. Isn't there any solution with DAQ triggering options or something else?
    Kind Regards,
    Sincerely.
    Attachments:
    Loadcell&MotorControl.png ‏286 KB

  • CANopen: the PC doesn't communicate with the motor controller

    Hi there,
    I'm new with both Labview and CANopen and I'm trying to write a RXPDO on my Linmot motor controller(VI attached). I'm using a PCI CAN Series 2 card. 
    My VI worked just once ; I was able for example to move the motor with the JOG commands. 
    Now the VI runs without errors but any control word is not really sent to the controller.
    Sometimes (don't know why!!) after the CANopen create interface.vi, the interface object results "Not executed" but even when it is regularly executed, the motor doesn't receive the command.
    Can anyone help me to solve this problem? 
    Regards
    Alessandra
    NOTE: the linmot controllers need the count nibble to be incremented for each new command; I've set the auto-increment using the linmot software. 
    Attachments:
    ControlWord send.vi ‏26 KB

    Hi Loura,
    thank you for your suggestion. Unfortunately I already know those labview VIs, they are well developed but they don't run over the CANopen protocol.
    I think the problems I'm having in using my controllers with Labivew and CANopen could depend on the fact that the LV canopen library are not intended for use with the latest version of Labivew (which is the version I'm actually using).
    (It's the only explanation I have for strange behaviours dealing with open / close / reset can objects)
    Bye
    Alessandra

  • Move motor and make a measurement (thorlabs motors and drivers)

    Hi everybody, 
    I was just born in this Labview  world and I´m quite lost. I´ll explain my situation: 
    I have three motors from thorlabs (T-cube Stepper Motor controller) in three directions (x, y and z). What I need is to move the motors from initial position until final position in small steps in order to make measurements in every stop (this is other story). So, the thing is I need to measure one line in x stopping wherever I need, then come back to the initial point, go one line down in y axis and start the line in x again (as many times as neccesary). I think a state machine is what I need for this purpose, but I have no idea. 
    Could anyone help me with this??
    NOTE: the computer is an old xp without internet conection and there is no possibility to install labview packages as NI-DAQmx so I must use the motors nodes and properties that Thorlabs provides. 
    Thank you very much!!!
    Solved!
    Go to Solution.

    Times to wait BEFORE a measurement is started is something you have to do manually since it's up to the user.
    As far as how long to wait for the measurement to complete, the manual has examples of using registers and buffers to find out when the measurement is complete using a linear sweep (this is how I do it).  The idea is to pre-set the buffer equal to the number of datapoints (say 100 over your IV range), instruct what to measure (current, voltage, both), and poll the registers to find out when the buffer is full (say every 100-500 ms).  Let the keithley 2400 set the voltages for you over the specified range and return the data set when completed.
    As far as knowing when the movement is complete, you'll have to see if there is a way to detect that with your equipment (otherwise stick with the pre-programed delay).  IF these are illuminated IV measurements, you could do the following.  Source ZERO volts and measure current.  check periodically after the movement commands are sent.  Once you measure a current, the Jsc for the cell, you have contact.
    For data storage, use shift registers on the state machine itself.  Clear the register when starting a scan, and insert each measurement as it is taken (2D array, or array of clusters).  Another possibility is to use a separate while loop to save the data (a consumer) with the data being passed in a Queue and appended to file after each scan (this will help if you are concerned about failures resulting in lost data).  After each measurement, enqueue the data into a queue handled by this consumer.  (you'll need to keep track of which file to append data to).

  • Linear actuator, motor controller and labview. Establishing connection.

    Overiew:
    I have a 12VDC linear actuator (potentiometer built in) connected to power and Jrk 21v3 USB Motor Controller with Feedback (http://www.pololu.com/catalog/product/1392). The USB motor controller connects to the computer through USB, actuator's feedback wires connect to the motor controller.
    Problem:
    Establishing connection between the motor controller and labview.
    What I have done so far:
    I installed drivers to the motor controller and windows detects it. NI MAX detects my motor controller (pic attached), but for some reason, when i try to access it through daq assistant in labview it doesnt see it. I also tried accessing it through VISA with no results..
    Help will be appreciated.
    Thanks
    Peter
    Solved!
    Go to Solution.
    Attachments:
    problem.jpg ‏124 KB

    You have a few things you need to look into:
    When you installed the software, did it install a USB > Virtual Com Port dll such as FTDIchip or similar? If so, when you hook up your device, it'll reveal itself as a normal (new) Com Port in Device Manager. You then need to try to talk to that com port.
    If you are trying to use the native USB on the board (as MAX has detected for you), then you'll need to use the .NET framework code provided by the manufacturer (probably written in C#), and make your own Constructors in LabVIEW. If you've never done this, it isn't trivial.
    I would call the manufacturer and just tell them what you are trying to do. They've probably dealt with LabVIEW before, and may have an example to get you started.
    edit: For fun, I followed the link you provided (which doesn't really work). I searched their site for "LabVIEW", and indeed got several hits. This one thing I downloaded (can't resist looking at code) was a gigantic turd ball. However, it did appear to use a normal Com port.
    Richard

  • VXM Stepping Motor Controller Driver

    Hello All, 
    It's my first time to write in this forum. I am a new with using LabVIEW and very optimistic to get  assistance.
    I am trying to controll a stepping motor controller (VXM-1 Model) with Labview, which is moving a Velmex Unislide. I need help to do a code LabVIEW that control VXM-1 Model and measure the displacement of a Velmex Unislide. How could you help me out ?. 
    Please be advised that I am using LabView 2010 and Windows XP. 
    I am looking foeward to hearing from you.
    Thanks for any assistance in advance. 
     

    Using VISA 5.0.3 is fine, but upgrading couldn't hurt.
    In terms of where to start programming.  I would recommend taking a look at the "Simple Serial" example VI under Hardware Input and Output>>Serial in the example finder.  You'll need to change the "*IDN?/n" command to something that the controller is actually expecting.  It looks like the VXM can be given commands in "interactive" mode, in which you send a command and the controller immediately executes that command, or in "standalone" mode, in which you define a command script, download that script to the device, then the script is executed without any further host interaction.  These two differences are explained on pages 8-9 of the user manual.
    The command set is explained there as well.  A couple important notes from that manual:
    "The standard RS-232 communication settings on the VXM are 9600 baud, 8 data, no parity, and 1 stop bit."
    "When sending commands that require a value, the commands must end with a carriage return (Enter key or Return on most keyboards), comma, or a period."
    There are control examples given starting on page 26 of the user manual.

  • How to use external timebase for Two Edge Separation measurement with PCIe 6351

    Hi
    I am working with PCIe 6351 x series DAQ card.
    counter measurements.
    Here i need to measure the time/no edges between two edges. Falling to Raising of two signals.
    I got the measurement with internal time base.
    here i need to synchronize the measurements with external clock from the external setup.
    so i need to use that external clock,timebase for the counters.
    Any solution please..
    Regards,
    Hari

    First, the VI you mention is NOT for STC timer/counters. Therefore, it won't work.
    If you want to get the time interval between two edges, you want to use the Functions -> Data Acquisition -> Counter -> Count Events or Time VI. This will do the function you are looking for.
    Mark

  • Script for synchronizing the clock with Domain Controller

    Hi Everyone,
    In our environment, we have Mac machines which are joined to window's domain. Once in while machine will not log on to domain because the OS clock had a different time than the domain controller and sooner you fix the clock, machine will start communicating with domain controller.
    I was wondering if there is an easier way to do this using script which can run every few hours to force the OS clock to synchronize with the domain controller.
    Thanks,

    You don't need an Applescript to do that.
    Enable the NTP server on the Windows Domain Controller (perhaps start here: http://technet.microsoft.com/en-us/library/cc773013.aspx).
    Then setup the Macs to use NTP (Network Time) to sync to the domain controller.

  • Using older servos with new controller

    My group has a three-axis stage controlled by an old Galil DMC-230
    motion control board, Galil ESA-10-75 amplifilers and three dc servo
    motors (from Galil too, I think).  The board is mounted in an
    ancient computer running DOS.  To make matters worse, the hard
    drive seems about to give out.  We would like to leave the stage
    and motors alone but replace the controller and amplifiers.  We
    are considering using an NI PCI-7344 controller with an NI MID-7604
    Motor Drive.
    My questions are:
    What are the main things to consider when matching a servo motor to a controller?
    Has anyone done anything similar (using older servos, but replacing controller and drive)?
    Should I just give up and beg the boss to buy new motors as well?
    Thanks for any advice!
    Telemaque

    Been there and almost done that. We have a legacy DOS Galil based (DMC-630 controllers with SSA-12/40 drives) system with brushed servos that is on it's last legs.
    Matching servo to drive amps- look at max currents, voltages, and inductances on the motors to see if drive can accomodate. Are they brushed or brushless motors. Also check if encoders and hall signals from existing motors and limits from stages compatible with new controller.
    Personally, I would suggest new motors since you may not know their history of (ab)use and depending on their ratings, may be a minor percentage of total retrofit cost. You may also want to have the stages sent out for refurbishment if time permits. They have probably seen a lot of use with little or no cleaning and lubrication. Mechanical wear also takes it's toll. On the system I mentioned above, we were experiencing loss of accuracy and repeatability- the lead screws and nuts were trashed.
    Just a couple ideas to start with.
    Good Luck
    AK2DM
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

  • Send DAQ measurement results through serial ports

    Hi, All
    I use PCI-6034E for measurement. After DAQ gets data, I send them to another computer through serial port (com1). I write a Virtual C++ program, which calls NI-DAQ library functions to implement DAQ data sampling (multiple channel scan) and sends measurement data to another computer through serial port under request. DAQ data sampling and serial communication are implemented in two threads. They are running concurrently. They share a global memory for measurement data. The serial communication thread will do infinite wait and send data only when another computer sends a request through serial port.
    I met two problems. First, when I reduce the size of DAQ measurement buffers (piBuffer and halfpiBuffer, I us
    edouble buffer model), DAQ measurement is often interrupted by the message "[DAQ_DB_HalfReady] returned NI-DAQ warning 10846. Your application was unable to retrive data from the background acquisition buffer fast enough so the unretrieved data was overwritten with new data. ...". I want to get run time data so I need to reduce the buffers as small as possible. How can I solve it ? The second problem is that the serial port gets error data (nothing) from measurement computer sometimes, especially when DAQ initializes itself and finishes work. It looks like that there is a conflict between DAQ and serial port. Does anyone have similar experience about this? Any suggestion?
    Thank you in advance.
    Le Cai

    Le Cai,
    You are correct that the number of scans to read is equal to half of the buffer in double buffer mode. I was mistaken and referring to a standard (non double buffered) operation. However, you can increase the size of your buffer without affecting the period of your acquisition. A buffer of 60 is quite small and, as such, will be more prone to overflow errors. The rate is actually set through the DAQ_Rate() and DAQ_Start() functions. For more information on these functions and how to configure the scan rate, please see the NI-DAQ Function Reference Manual.
    NI-DAQ Function Reference Manual for PC Compatibles
    http://digital.ni.com/manuals.nsf/websearch/1630A0B68738B269862567C1007A2912?OpenDocument&node=132100_US
    A good place to start would be the example titled, "DAQdoubleBuf.c" which ships with the NI-DAQ driver. If you installed the examples for Visual C++ when you installed the NI-DAQ driver you should be able to find this example in the \Program Files\National Instruments\NI-DAQ\Examples\VisualC\AI folder on your computer. This example would be a good template as it is very close to what you are trying to do.
    If you observe that you only receive the overflow error when you are operating the two threads, thus ruling out the buffer size as being a potential problem, you may want to examine whether or not your second thread is placing a lengthy exclusion on your data buffer during the period when your first thread is trying to move the data. If your first thread has to wait during the half-buffer transfer this could easily cause the overflow, as the acquisition would be running but the transfer would be paused. Instead of placing a mutual exclusion around one piece of global memory you could try using a queue instead. A queue approach will allow you to pass the data from the first thread into a queue to be read, when convenient, by the second thread. In this method the first thread would never have to wait as the transfer would just be a handoff.
    Regards,
    Justin Britten
    Applications Engineer
    National Instruments

  • How do I establish serial communicat​ion using LabView to two stepper motors using a motor controller​?

    I currently use an off the shelf motor controller to run my two stepper motors. It already has integrated a firmware software that sends commands to operate each motor. I would like to create an interface where I can send these commands using LabView. If someone can point me in the right direction I would appreciate it.

    Look at the examples for the serial VISA vi.  Something like Basic serial write and read.vi is a good starting point.
    Have you searched for a LabVIEW driver  at the NI LV driver network?   Asked the vendor?
    If you write your own driver with the serial VISA vis remember to open and configure the port only once at the beginning and close it at the end of your program. 
    Message Edited by Henrik Volkers on 07-13-2009 04:21 PM
    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 ǝɥʇ'

  • Using a Phidget Motor Controller and attempting to get a feedback loop

    Hello! Recently, I aquired a Phidgets 1065 motor controller and a compatible motor with built-in encoder. Currently, I am trying to write a program that allows me to input a position, and the motor moves at a user-specified speed until the encoder reaches that position. However, the original instructions to the Phidget VI's are so vague, I'm not entirely sure how to tackle this problem. Any help would be appreciated!
    Thanks! 

    It looks like Phidget has a lot of documentation on its website. This webpage might be helpful to get started: http://www.phidgets.com/docs/1065_User_Guide . This user guide shows how to connect the wires. Notice that both the motor control cables and the encoder cables are connected to the motor controller. I believe that the position control loops are performed on this controller/drive itself.
    Phidget also has LabVIEW VIs that you can use to set the motor position. This new position is sent to the motor controler through the USB connection and the motor controller will control the motion to that new target position. See this document to get started with the LabVIEW API http://www.phidgets.com/docs/Language_-_LabVIEW#Quick_Downloads . See this document for more information about each of the Phidget VIs: http://www.phidgets.com/documentation/web/LabVIEWDoc/index.html I believe that you would need to look at the section that talks about the servo control module.
    Take care,
    Jeremy P.
    Applications Engineer
    National Instruments

  • Interfacing TETRIX/NXT HiTechnic Motor controller to myRIO

    I am an Adjunct instructor at a Junior College.
    We are implementing the Intelitek "Advanced Engineering with myRIO" curriculum.
    This is a brand new program and we have received the software, course materials
    and the myRIO controller but it will be close to mid term before we get the
    rest of the hardware based on the TETRIX Prime robotic platform and interface
    board.
    I have borrowed an older TETRIX kit from a local High School that was used with
    the LEGO NXT and it hast the HiTechnic Motor controller with the NXT connector
    interface.
    What I am wanting to do to get the student started (we just had the 2nd week
    meeting of a 14 week course) is take the motor controller with the NXT cable
    and interface it to the I2C interface on the myRIO.
    I had found online a German site that has a board that will directly connect
    the NXT sensors to a myRIO.
    I was wondering if you have any VIs that might help met get this working
    quickly, even the code details from the NXT version of Labview for the Tetrix
    controllers would probably help.
    Thanks in advance
    Scott Willis

    Hi Swillis,
    Unfortunately we do not have an specific library to communicate with the Tetrix controllers. The following link, contains information related to the NI LabVIEW Module for LEGO® MINDSTORMS®, but it is not supported and will not necessarily work fine for the myRIO programming.
    Regards
    Regards,
    S.Jimenez

  • LabVIEW driver for a ControlTechniques motor controller

    Anyone know of LabVIEW driver for a ControlTechniques
    Unidrive motor controller?
    Or any info/pointers to programming them via LabVIEW?
    Any help much appreciated
    Paul
    Dr Paul Rocca - Managing Director
    Brill Engineering Ltd, 3 Longwood Court,
    Love Lane, Cirencester, Gloucestershire
    GL7 1YG. www.brill-eng.co.uk
    Phone: 01285 883888 Fax: 01285 883876
    NI Alliance Member Since 1992
    Please note that calls may be recorded using our leading edge digital
    recording product AudioPC.
    Any opinions expressed in the email are those of the individual and not
    necessarily of the Company. This email and any files transmitted with it are
    confidential a
    nd solely for the use of the intended recipient. It may
    contain material protected by lawyer-client privilege. If you are not the
    intended recipient or the person responsible for delivering to the intended
    recipient, be advised that you have received this email in error and that
    any use is strictly prohibited. If you have received this email in error ple
    ase notify the Security Manager by telephone on +44 (0)1285 883821 or by
    email to [email protected]

    LV can interface to 232, 485, Devicenet... depending on what the controller has.
    You could find a LV/CVI driver for this (232/GPIB/ethernet only) instrument at http://www.ni.com/devzone/idnet/default.htm . If it's not listed there, it leaves you with one of a couple options. First, I would like you to submit a request for this driver at: http://zone.ni.com/idnet97.nsf/instrumentdriverrequest/
    We develop drivers based on demand and popularity so the more requests we have for it, the greater the possibility that we will develop one.
    If you would like to try developing your own instrument driver (or modify the existing one), we have documentation, model instrument drivers, and driver templates to help at :
    http://www.ni.com/devzone/idnet/development.htm
    We also have a syndicate of third party vendors that specialize in National Instruments' products and services. Some of the vendors specialize in driver development. I would suggest contacting one of the Alliance members at:
    http://www.ni.com/alliance
    An instrument driver is a collection of functions that implement the commands necessary to perform the instrument�s operations. In short, someone read the instrument user manual and implemented some of the functionality in a program for the end user. Instrument drivers are not necessary to use your instrument. They are merely time savers to help you develop your project so you do not need to study the manual before writing a program. With all of this work already done for you in the driver, instrument drivers can significantly reduce development time.
    There are example VI's in LV on Instrument Connectivity. If you go to the Help menu >> Examples.. >> I/O, you will see a couple and Examples.. >> Fundamentals for File and String manipulation. I would suggest tweaking them to suit your application. Also the specific command that your instrument responds to can be found from it's manual.
    Some useful resources for your application are
    ni.com > NI Developer Zone > Development Library > Instrument Connectivity
    http://search.ni.com/?col=alldocs&layout=TechResources&ql=a , to search examples and knowledge bases
    Hope this helps.

Maybe you are looking for