DC motor control via ctr1/ctr0 pwm output stops outputting after one loop through.

Working on this project to control an H-bridge controlled
motor using pwm output from ctr0/ctr1 for ccw and cw on the motor. A sensor detects where it is at and each cycle goes from black to white. For some reason, the motor only turns on once and then nothing comes out of the ctr outputs after that. Anytime the program is stopped and restarted it works for one cycle. Or if just the program is run at the skipcolor sub-vi. this can be run multiple time to control it properly. During the actual run it doesn't work. Any implementation device would be great. I am using the PCI-MIO-16E controller.
Programs attached for reference.
Attachments:
SkipColor1.vi ‏111 KB
MotorControl2.vi ‏99 KB
PROJECT 2a2.vi ‏18 KB

Hey suspencefull,
You are probably going to have to think about re-designing your code. Your pulse train is not continually generating because you do not have it in a loop. When you use the DAQ Assistant to create a continuous pulse train, LabVIEW will prompt you if you want it to automatically add the loop. You must have deleted it or chosen not to add the loop.
There will, however, be problems though when you add the loop back in. The SkipColor sub VI will not finishing executing until the loop is finished and therefore you will never move out of the first frame of your sequence. I would suggest redesigning your code so that these thing can occur in parallel.
Please let me know if you have further questions.
Regards,
Chris Delvizis
National Instruments

Similar Messages

  • Hi, my name is Amit, my hot corners stop working after some time. Have to go to mission control to reset them, however they stop again after some time. This is annoying. Can someone please assist to solve this problem? Thanks Amit.

    Hi my name is Amit, after upgrading to OS X Maverick I often have problem of my Hot corners stop working after a short period of time. I have to go to mission control and have to reset them for them to start working again. However this is temparory and they stop working again and this is quite annoying. Can someone suggest a cure to this problem please. I will be grateful. Thanks Amit.

    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Preferences/com.apple.dock.plist
    Right-click or control-click the line and select
    Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item selected. Move the selected item to the Desktop, leaving the window open. Log out or restart the computer and test. If there's no change, put the item you moved back where it was, overwriting the one that may have been created in its place. Log out again. Otherwise, delete the item you moved.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Steppper motor control via RS232

    hii
    i am new to this stepper motor controlss section.
    i am using vaccum compatible stepper motor .. the whole manual of this is ayyached alongwith..and the program made by
    me is also attached along with..i had run the other stepper motor with the same code..i do not know where is the problem..
    please help me..
    thanks
    do not hesitate to give kudos

    Hey Sahil,
    Thanks for posting on the forums. Hopefully this was the thread you were referring to in the Engineer Awesome ni.com/community group discussion. Sorry that you did not receive any feedback from your issue, that is fairly rare.
    Anyway, in regards to the issue at hand. The fact that you are using a stepper motor is not as significant as the fact that you are communicating to your instrument (in this case I would image that it is your motor controller/drive) via RS232. I hate to point you to another resource, but the instrument control forum may be the most appropriate location for your query.
    In the Engineer Awesome discussion, you mentioned that you were able to control the device through a third party application but you were having trouble doing so in LabVIEW. My first reaction after looking at your code is termination characters. Does your controller expect any sort of termination character? Also, are you sure that you are sending the same commands via LabVIEW as you are in the third party application? If you use a port sniffer application to monitor the traffic over your RS 232 connection when your third party application is running and compare that to when your LabVIEW code is running (you could use NI SPY for this when you are using NI VISA), how do the two situations compare.
    If I had to guess, I would think that you are not sending commands/termination characters to your instrument that it is expecting.
    Lastly, a more detailed description of what your issue is, what you have tried, and what is and isn't working would really help everyone understand what is going on and how to help. As it is, it is unclear what the issue is or what you are trying to accomplish.
    Hope this helps.
    -Ben
    WaterlooLabs

  • 2 motor control via joystick in an underwater ROV

    I have a term project.I am doing an underwater ROV with labjack U3 using Labview.I do not know how to control 2 motors with one joystick.It is too complicated.I need help.??

    I'm wondering a bit how you would use a USB data acquisition device for motion control, but as long as long as you don't use this for closed loop control it could be ok.
    But anyway. Here are some links to example that might help you. As you could imagine NI doesn't provide examples for labjack products, but you should be able to adapt the examples to your hardware:
    Joystick Inputs with DAQ Card Outputs
    Motion Control with USB Joystick
    For more example code and tutorials please search ni.com for "joystick LabVIEW"
    Kind regards,
    Jochen

  • Loop through all controls in view

    Hi Everyone,
    I need to cycle through all the controls on a view.
    I have set each of the controls of type UISegmentedControl with a unique tag number.
    I am using this tag number to perform a lookup in database for the value of the segmented control.
    So, my question is this.... how do i cycle through all the controls on a view?
    thank you
    take care
    tony

    alt-088 wrote:
    I think we are close - just one correction.
    The segmented controls are all at design time, there will be no new controls added.
    I'm not clear on what's been corrected. The sample code I gave you assumed all the controls were known at compile time. So I think the example code addressed the problem you're trying to solve. The last paragraph of that post was just an afterthought, to explain what to do in case you ever needed to add controls dynamically.
    -> loop through all controls on view
    -> if control is of type uisegmentdcontrol
    then do database lookup on tag
    Set segment value to value returned from database
    Once again, if I correctly understand the above, the code I gave you does exactly what you want. You haven't indicated you want to take any action when a control is not a segmented control, so I don't see why you'd want to include them in the loop. However, if you actually do need to enumerate non-segmented controls (or other subviews), my last response advised you to set the tag properties of all those other controls, making sure the range of those tags is different from the range of the seg control tags.
    The part that eludes me is the looping through all the controls on the view
    I guess the part that eludes me is why you're so interested in enumerating all the controls, when you only seem to be interested in the segmented controls. But even if you really do need to look at every control, I don't see why you're rejecting the solution I gave you. [viewWithTag:|http://developer.apple.com/iphone/library/documentation/UIKit/Ref erence/UIViewClass/UIView/UIView.html#//appleref/doc/uid/TP40006816-CH3-SW26] is a powerful method which recursively walks the entire view hierarchy to find whatever tag it's looking for. If you use it correctly (e.g. by assigning unique tag numbers that tell you what type of control you've found), it will save you lots of trouble.
    If, for some reason, you insist on doing this job without using viewWithTag, the next best might be something like this:
    - (void)doSomethingWithEachSegCtrlInView:(UIView *theView) {
    UIView *subView;
    for (subView in theView.subviews) {
    if ([subView respondsToSelector:@selector(selectedSegmentIndex)]) {
    // subView is a segmented control ...
    else {
    // subView is not a segmented control ...
    if ([subView.subviews count]) {
    // this subview has its own subviews
    [self doSomethingWithEachSegCtrlInView:subView];
    Note that the above is a more difficult, more error prone method than the sample in my first response. Firstly, it needs to recurse in case any controls are placed on subviews of the main view (or on subviews of those subviews, etc.), a capability already built into viewWithTag. Secondly it needs to identify the type of each subview object. [respondsToSelector:|http://developer.apple.com/iphone/library/documentation/Co coa/Reference/Foundation/Protocols/NSObjectProtocol/Reference/NSObject.html#//appleref/occ/intfm/NSObject/respondsToSelector:] is the preferred way of identifying the class of an object, especially when the selector argument represents one of the methods you intend to use. However there's no reason to get into the business of identifying the class of an object, when you could have given that object a unique tag number in the xib, where there was no question about its class.
    Hope the above communicates the solution better than my first response!
    - Ray

  • Motor control using pwm,pid

    Hi all,
    Can anyone help with this please.
    I have a counting circuit from a hall effect sensor and am controlling a motor using a PWM.I am controlling the speed of the motor varying the duty cycle and the motor is wired via solid state relay.these run fine.
    What i am trying to do now is connect through a pid as to control the speed of the motor.
    My understaning is that the set point is from the duty cycle, the process variable is the feed back from the sensor (rev per min) and the output is back to the motor to increase or decrease speed.
    Is this the correct understanding? and if so can you help with setting up.
    Attached is my vi.
    Regards Anthony
    Attachments:
    rev per min 5.vi ‏117 KB

    Continued from here: http://forums.ni.com/t5/LabVIEW/Error-200290-when-running-a-pulse-count-and-pwm-program-together/m-p...
    Please look at what I wrote there. You need only one loop. The PID and Counter Write functions should all be inside that same loop, along with the measurement. The PID will do nothing useful outside a loop.

  • Software Feedback-b​ased PWM Motor Control

    Hi all, I'm trying to design a software based feedback controlled motor using the USB 6009 (which does not have hardware pwm capability).  I will be actively detecting the rotational speed of the motor and adjusting the software PWM in response, so the PWM does not have to be very acurate.  The user will input a desired RPM value - this value will be compared with the detected RPM and the software will adjust the PWM.  There doesn't need to be any PID control, just a linear stepping of PWM until the detected RPM of the motor is within a certain range of the desired RPM.
    The output of the 6009 controls the motor digitally using an H-bridge and I will need to be able to reverse the rotation of the motor.  1 line on the digital output goes to 1 "side" of the H bridge and the other line goes to the other "side."  Only a single side should be active at a time and the other side should be kept at LOW.  I figure this should be easy to implement once I get the PWM-feedback figured out. 
    I am currently hung up on a good method of how to implement PWM using manual software methods and construct the actual feedback mechanism.
    Here is the VI I have so far (crude PWM using mod-n of the output loop iteration counter (which isn't a linear stepping)).
    Thanks 
    Message Edited by gastro54 on 04-14-2009 06:07 PM

    here is the VI
    Attachments:
    motor control.jpg ‏148 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

  • Mac Mini with no monitor controlled via VNC - video output corrupt

    Hi,
    I have a Mini running with no monitor, mouse or keyboard connected (it's used as a Server for my music library) that I control via VNC on my Mac Book.
    Everything works fine until I ever have to reboot the Mini. After the reboot, logging into the machine via VNC shows all the video corrupt (jagged horizontal lines through the whole display making it totally undreadable).
    This happens both with ARD and Chicken of the VNC (tried both in case it was an issue with the VNC software).
    To fix it I have to connect a monitor to the Mini. Then I can just unplug the monitor again and the video output via VNC is fixed.
    Anyone have any ideas? It's driving me nuts
    Thanks,
    Neil

    After some more searching I stumbled across this thread on another forum;
    http://www.macusenet.com/archive/index-t-75211.html
    It seems that the problem can be avoided by connecting the DVI-S-Video adapter that ships with the Mini.

  • More myRIO PWM outputs via FPGA

    I'm working on a project with the myRIO that requires 9 servo PWM signals. I know that the PWM Express VI operates on 8 different pins among the 3 connector ports on the myRIO. After spending a few hours researching FPGA, I was getting no where since a lot of it is beyond my skill level/understanding. 
    So my question is: what is the simplest way to create more PWM signals with controllable duty cycles on the myRIO FPGA? I wanted to have all the servos attached to pins on one connector for simplicity (e.g., all on MXP-A).
    My initial thought was to create more instances of the DIO/PWM mappings under MXP-A in the shipping personality. But then I had a vague feeling that this segment of the VI makes these pins compatible with the PWM Express VI and doesn't actually produce PWM signals. Is that what this does? Or is it possible to make copies of this and rename the registers PWM.A_3..., PWM.A_4...., PWM.A_5..., etc.?
    I looked at PWM Output With LabVIEW FPGA, but that didn't make any sense to me considering it has no documentation. I also found Developing a PWM Interface using LabVIEW FPGA, but I couldn't see a simple way to adapt it to my needs, while keeping the standard functions of the pins on the other connectors.
    Thanks.
    Bob

    Sorry for the delay Sam. I figured out how to add the PWM outputs via FPGA and it works. Then I tried to accomplish this while still retaining the functions of the other connectors. My method was to go into the FPGA personality and replace all of DIO-A's FPGA with my PWM code while keeping all of the FPGA code for the other connectors intact. The files are attached.
    My issue is: in RT Main, I also tried to run something from the MXP-B connector (PWM Express for example) in a parallel while loop while still running my custom PWM on MXP-A. This produced nothing. I read the PWM Express signal on B/AI0 and it was a flatline at zero. However, when I created a new VI that just uses PWM Express on MXP-B, it works fine.
    Is there a reason why the express VIs aren't working on the other connectors simultaneously?
    Thanks,
    Bob
    Attachments:
    myRIO-1900 Customized FPGA.vi ‏388 KB
    RT Main.vi ‏506 KB

  • I'm working on DC Motor control using DAQ. There is sufficient voltage output from DAQ but not current. What should i do so as to drive the motor

    I'm working on DC Motor control using DAQ. There is sufficient voltage output from DAQ but not current. What should i do so as to drive the motor. Could you suggest me appropriate driver IC using which this problem can be solved.
    Saravanan.T

    You really should use a DC motor controller to control a DC motor, look at the 754410 IC for a good example. You should be able to interface these to most DAQ devices.
    Alan

  • A/C three Phase motor control using 1/4 bridge Load Cell output and a USB 9172 Daq

    NI Assistant,
    I am tasked with setting up a Motion Control using two each OMEGA LC712-100K, -50K and -10K load cells to monitor the cable tension on six A/C motor driven winches. I also need to Monitor and calculate a Moment as well as the load slope for Load verses Time.
    I have zero time to develop and I have searched your databases for existing Motor Controls to modify.
    Should I use Case Structures and then place them in a while loop?
    I setup a drawing in Word to visually define the task.
    Signed,
    Patrick Murphy
    Attachments:
    Layout for Testing Spars.docx ‏15 KB

    Hi Patrick,
    The reason why the Motion Control examples will not work for you is beacuse they are meant to be used with the NI Motion boards. Since you are using DAQ boards, the examples are probably not going to be able to help you too much. However, there is one example on the community that might be a place for you to start. 
    pmurphy wrote:  Should I use Case Structures and then place them in a while loop? 
    What exactly do you mean by this? What do you want in the case structure or while loop?

  • 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

  • Motion Assistant and PXI-7354 PWM output

    Hello,
    I have a PXI-7354 Motion Controller in a PXI-1033 rack and I'm trying to prototype a product which has a digital motor controller IC, A3906 by Allegro. The IC is controlled with PWM signals by varying the duty cycle. Now, in the NI 7350 User Manual on page 5-17, it says that "These signals (PWM) are configured in software and are in no way associated with the PID servo control loop." My question is, can I programmatically associate the output of the control loop with a PWM output duty cycle?
    I'm new to Motion Assistant and PXI motion controllers and I appreciate any input.
    Regards,
    Miika Lönnqvist
    Electronics designer, CLAD
    Biohit Oyj R&D

    Miika,
    thank you for the information, but there is no way for the 7354 to drive control signals directly in this fashion. So here are some alternative approaches that could help:
    The 7354 outputs a +/- 10 V control signal. You could build your own circuitry to adapt this signal to the control input requirements of your drive (two voltage to PWM converters; one driven by positive voltage values, the other one driven by negative voltage values).
    Replace the 7354 with an R-Series board. The FPGA on these devices can be programmed graphically with LabVIEW FPGA and it provides both, real-time control and complete flexibility in terms of I/O mapping and control algorithms. Motion control with special requirements is a typcial usecase for these devices.
    You can select from a variety of R-Series boards with different FPGA sizes and I/O setups. If you don't need any analog inputs or outputs, the reasonable lowest cost entry point for your application is probably a PXI-7811R
    Both approaches add some complexity to your current setup. While the first approach is hardware centric, the second approach adds some complexity on the software side. My personal preference is option two, as this provides the highest level of flexibility, which is typically very desirable for a prototyping system.
    In any case I recommend to contact your local NI contact for a more detailed consulting.
    Kind regards,
    Jochen

  • CRIO motor control using AMC Drive

    Hi
    I am trying to setup a simple DC motor control system with cRIO-9081, NI 9401 and AMC PWM servo drive 12A8.  Can someone please tell me if this AMC drive is compatible with my other NI products?  Do I need anything else to setup a simple closed loop speed control for a small DC motor?  Any advice or example is very much appreciated.
    Thanks

    Hi SunnyX,
    It seems like your servo drive is expecting an input of +/-10V analog.  Are you able to confirm this in the device manual?  If that is correct, you will not be able to generate the necessary signal with the 9401.  You will need another module that you can program to output this signal such as the 9263.  
    You could also consider using the modules designed specifically for motion control and the SoftMotion Module to simplify the motion control programming.  Please let me know if you have any additional questions or comments!  Thanks.
    Regards,
    Kira T

Maybe you are looking for

  • Owb / Workflow install

    I am in the process of installing OWB and workflow (to be able to use/deploy process flows). My understanding is that I need to install Oracle HTTP server in a separate Oracle Home, and Oracle Workflow Server into the Oracle Home of the database I'm

  • Changing Billing Schedule Level for Service Contracts created in OM

    Hi, When we create a Service Contract from Order Management, the Billing Schedule Level is always set to Top Level and only one Billing Stream gets created. Can we get the Billing Schedule Level changed to other Levels viz., Equal Amount or Covered L

  • Select current user tables

    Hi, I'm needing to obtain the list of the TABLES which the current user has some privilege. I'm using the following query for doing that: SELECT DISTINCT o.object_name FROM all_objects o, all_tab_privs tp WHERE o.object_name = tp.table_name AND o.obj

  • About to but PS9 need some help

    Im about to buy PS9 and not sure if I should get both the photo and video or not.  My main concern is can I install it on more than 1 laptop and have full use on both machines?  Please help ASAP.  THANKS

  • Airport in macbook pro doesn't auto-find signals quickly and also drops sig

    So recently, my macbook pro, which I use on campus, has been acting up when it comes to the airport. If I close the screen and open it up when I want to use the laptop, the airport won't find WIFI signals even though the computer itself has not moved