Velocity control, DC motor

Hi,
Please refer to my attachment, may I ask how to convert my output variable (after coming out from pid vi and marked by biggest arrow) to PWM Duty Cycle duration? The scaling I have done doesn't seem correct. 
[This code is modified from the 9505 example, but I am not using the 9505, and I am not doing the position nor current loop. My hardware set up is just a DC motor with a full-H-bridge circuit, a linear encoder and an fpga.]
Thank you.
Message Edited by xf on 04-25-2009 12:59 PM
Message Edited by xf on 04-25-2009 01:00 PM
Attachments:
velocityControl-code.JPG ‏178 KB

Brian,
Thank you for the suggestion about the speed controllers. Can you give me the names of the manufactures of some DC motor speed controllers?
Buying an off the shelf solution is preferred than designing a custom circuit for my application.
As for your ideal about using stepper motors, I am trying to control existing assemblies that already have the DC motors embedded in them. What I am doing is trying to assist the M.E.s in adding control to their proof of concept models and we do not want to turn a custom circuit board and custom software for a micro-controller for each concept model.
Thanks again for your suggestion.
--Jon

Similar Messages

  • How do you control the motor in the continuous mode ?

    I use the NI 7334, I would like to create the program to control the motor in the continuous mode. please help me.
    Thank you very mich.

    Hellow water2006,
    Thank you for using our discussion forums.  In regards to continuous mode, are you referring to a constant velocity motion?  There are several examples on our website which will give you a good start on setting this up.  In particular the "Constant Velocity Move" example which is found at http://zone.ni.com/devzone/cda/epd/p/id/1206
    I hope this helps.
    Regards,
    Vu D
    Applications Engineer

  • Understand​ing velocity control on 9505 FPGA VI

    I was able to quickly use the 9505 Servo Drive example to do closed loop position control on the FPGA but I'm having trouble with figuring out how to modify the code to support velocity control (which I need for a different axis).  I'm trying to make my modifications on the FPGA VI itself rather than on the RT Softmotion side.
    Here are the issues I'm having:
    If I use the PI Velocity Loop with my Velocity and an arbitrary control setpoint velocity, I can see the velocity stabilizes (motor output looks uniform) but I can't correlate it with the velocity setpoint other than a bigger number is faster.  Velocity (from the Encoder loop) seems to readback in values of just 0-2 on my FPGA VI (I don't fully understand the units but I see my position change on my encoder readback in thousands of counts per second).  Why are they so different/how do I scale my encoder velocity correctly?
    Using just the shipping 9505 Servo Drive example (position control), how do I set the velocity of a move from within the FPGA code (in interactive mode)?
    Solved!
    Go to Solution.

    I was able to get my velocity readings to match my velocity setpoints when using velocity control mode by increasing my Timer Config.Target Period and  Encoder 'calls per sample encoder' from 2000 to 40,000.  Now my velocity readback is +/- 1 of my velocity setpoint for my drive range.  This makes sense to me now - if you read the encoder to quickly it hasn't accumulated enough points to accurately calculate the velocity.  It was in the documentation but I didn't fully understand it.
    So now I'm down to one question - (from last post):
    I still don't understand how to set the velocity of a move if I'm using position control (out of the box example) from within the FPGA code (on the 9505 example).  Is the best way to do this just to limit the 'Current Output Range' depending on the max velocity requested?  The NI Softmotion RT VIs and Express VIs are able to set 'Velocity' but I'm really unclear what that the SoftMotion RT VIs are actually doing in terms of interacting with the FPGA code.  Can you explain how that works?

  • Closed loop velocity control based on load cell force

    Hello,
    My application is for a drill, that drills into rocks of various densities for the purpose of collecting rock core samples.
    My setup has 2 motors which get controlled, one spins the drill bit at a constant velocity, the other moves the drill mechanism along a Z axis.
    For efficient cutting, it is desired to apply a constant force between the drill bit and the rock.  I have a load cell which measures the force being exerted by the drill bit on the rock surface, and this force can be adjusted by changing the velocity of the Z axis.  So I would like to employ closed loop control to adjust the Z axis velocity to maintain a constant force on the rock.
    Platform: cRIO 9073, with NI 9505 & 9215 Modules, Labview 2010 Full with RT and FPGA modules.
    The load cell is by Transducer Techniques, and I use their TMO-1 module to condition the signal, the output of which is attached to an input of the 9215 module, where 0-100 lbs equates to 0-8VDC.
    The motors and encoders for the Drill and Z axis are connected directly to the 9505 modules.
    Right now I am using a modified version the example found in ...\examples\CompactRIO\Module Specific\NI 9505\Velocity Control (closed loop)\Velocity Control (closed loop) - NI 9505.lvproj to accomplish velocity control of the motors.
    My questions are:
    1) Do I have the appropriate NI hardware/software for this task?
    2) With my current hardware setup, what would be an appropriate way to control my Z axis velocity rate based on Analog feedback from the load cell?
    3) Development time is a critical factor, so are there any toolkits etc that are easy to get started with that would drastically decrease my development time, or do I already have everything I need?
    Thank you for your time
    -MK Hokie

    1. Your hardware and software look appropriate assuming the motors are compatible with the 9505s.  You didn't mention the NI SoftMotion module in your software list which is something you will need.
    2.  There are a few ways of doing this.  One method would be to have a force PID loop that would attempt to maintain a force setpoint by directly outputting values to your torque loop.  In this case, the drill would essentially move as fast as it could while maintaining the force setpoint.  Another option is to have the force loop output a velocity setpoint.  You would then have a velocity PID loop that outputs torque values to the torque loop.  By adding this additional velocity loop you could have control over your maximum and minimum velocities.  There are likely other alternatives as well, but these are the first two that come to mind.
    3.  Unfortunately there are no shipping examples that close the loop on force feedback.  My advice would be to start with the NI 9505 shipping example and adapt it to your needs.  There are quite a few things you will want to change though.  Do you know if you will need to use the trajectory generator to move the drill into position before starting the force control?
    Assuming you don't need any trajectory generation, you can scrap the entire RT portion of the NI 9505 example and just create the necessary FPGA code.  On the FPGA, you won't need the Spline or Synchronization code either because this information would no longer be coming from RT.   You could take these out and replace the position loop with a force loop and possibly a velocity loop and your FPGA program would basically be finished.  In fact the only real motion IP that you will need is for the encoders (assuming you want velocity control) and PID.  Then you would need to create an RT VI that allows you to send down enable, disable, PID gains, and setpoints. 
    If you do need trajectory generation, you would want to keep most of the example code the way that it is, but then program in a 'Force Mode' that utilizes the force and velocity controly as described above.  You could think of it as having two different routines programmed side by side. 
    Regards,
    Burt S

  • Control DC motor position

    Dear member
    I dont know how to control the position of motor, if inputing the Motor Driver Voltage into PWMA, I can only control the velocity of the motor, what should I do?

    Could you please provide some information on your hardware setup? Make, model number, required inputs etc.
    Also, could you please expland on what you mean by inputting driver voltage to PWMA? If you're having trouble controlling the motor, I recommend viewing the manufacturer's datasheet to understand the specifications of the drive/motor's input signals.
    Finally, could you please post the VI itself rather than screenshots.
    -Mike
    Applications Engineer
    National Instuments

  • 7342 velocity control

    Refer to the question, ,
    In 7342's user manaul, it is recommanded that use current loop in driver and velocity or position l...

    Okay. I see what you're talking about. I'm including the text here so I don't have to look it up again. It appears that the difference between closing the torque (current) loop and the velocity loop on the motor drive itself is that the parameters used for PID control of velocity set up in MAX for the motion controller wouldn't be able to be utilized. If you want to have that nice velocity control through the software on your PC rather than through whatever interface you might have through the motor drive, the velocity loop needs to be closed back on the controller and not externally on the drive.
    Hopefully this is helpful to you. Best of luck.
    Jim
    "National Instruments recommends that when you use the UMI-7774/7772 with a servo mo
    tor drive, you use the torque (current) mode option on the drive instead of the velocity mode to simplify the system setup and tuning. In torque mode, only the current loop is closed on the drive. Both the position and velocity loops are closed on the motion controller using encoder feedback. When you use torque mode, you can set all of the control gains with the National Instruments motion controller software. Using torque mode on the drive also reduces noise and enables you to achieve high position repeatability in the motion system."

  • How to use sinewave to controll my motor run automatically.

    Hello
    I am now tring to use a waveform(sinwave ) to control my motor run automatically .I am using  labview2010 and EPOS50/5. Is there anyone can give me your suggestion? Thanks in advance.The attachment is the program for my epos.
    Attachments:
    epos and sinewaveform.vi ‏34 KB

    PS: My program for epos can work, but I don not know how to combine the sinewave program with the epos program to make motor run automatically.
    Thanks your suggestion in advance.

  • How do I control the motors in a third party usb toy with LabVIEW?

    Any suggestions?

    Hi, if you are only wanting to control motors than you have a lot of options. Use the parallel port with a current driver, use the serial port and a micro to control the motor. If you want to interface the USB device than this is where to get started.
    http://digital.ni.com/public.nsf/allkb/42B604435E3F9604862565E20043CD30
    http://zone.ni.com/devzone/cda/tut/p/id/4478
    LabVIEW 8.2,8.6,2009...still learning

  • Assigning digital port to control stepping motor

    Hi
    I want to control optical encoder, DC motor, Digital camera, Stepping motor, Electric lamp using LabVIEW and Data aquisition card. I am
    facing problem in interfacing stepping motor to DAQ device and configuring the digital output port using measurement and automation explorer.
    I am attaching the document showing configuration of measurment and automation explorer. I want to assign four line digital port for controling
    stepping motor. I want to assign DIO0,DIO1,DIO2,DIO3 for stepping motor. But the signal is going to other ports as well. Please somebody help me
    out of this problem.
    Jayaprakash.
    Attachments:
    Measurment and automation explorer.doc ‏99 KB

    Answered on your other post.

  • How to control DC motor in a simulation loop??

    Hi,
    I am Xiaofei, a beginner of LV. We plan to use feedback control on 2 DC motors using Simulation loop. Now the question is: i am not quite sure if the simulation loop is only a virtual simulation of the system, or it can be used to control the real system. We will use 2 encoders to detect the actual postion of the motor shafts, and the decoding code works well in a while loop, as the attached VI. But we don't know how to make it work in a simulation loop. Whenever we put it in a simulation loop and click "run", there's no response  no matter what we do on the system. So if you know, could you tell me if the simulation loop is suitable for our application and what we can do to run the encoders in it? Thanks a million!! 
    Xiaofei

    Hi Xiaofei,
    Thanks for posting on the NI forums!  Can you tell me a little more about your setup?  What do you mean by Simulation loop?  Do you mean Simulation Module or Simulation Interface Toolkit?  What hardware are you using to control the motors and read the encoder feedback?  What kind of motors do you have?  Can you read the encoder inputs in LabVIEW when you turn the motors by hand?
    Thanks,
    Maclean G.
    National Instruments
    Applications Engineer

  • How to use waveform to control the motor(EPOS2)

    Hello
    I am now tring to use a waveform(sinwave ) to control my motor in labview2010, I am using the EPOS50/5. Is there anyone can give me your suggeation? Thanks in advance.

    need more detail on the hardware (motor and data card) you are using. also What do you mean by using sine wave to control motor? 
    Kudos are (always) welcome for the good post. :-)

  • Using BNC2110 DAQ In Order to Control Stepper Motor

    So basically my goal here is to use LabView to control the direction and the steps of the stepper motor.
    I have BNC 2110 (connected to PC), Lin Engineering's 4218M-54P-04 Stepper Motor, and Lin Engineering's R701 Stepper Motor Driver.
    The specification documentations are attached.
    I know that the driver and the stepper motor are compatible.
    Is it possible to control the motor through Labview(PC) < - -> BNC2110 < - -> R701 Driver < - -> Stepper Motor, without the motor's own controller?
    An example of a controller for this particular motor would be on this website.
    I would much appreciate your support.
    Thank you.
    Attachments:
    4LeadBipolarSteppingDriver-linengineering--4218m-54p-04.pdf ‏652 KB
    DriverR701.pdf ‏379 KB

    Hi jhprks,
    It would appear that the stepper motor controller that you list communicates via RS-232 or RS-485.  You can make serial calls in LabVIEW using the Serial or VISA commands.  It could be something to look into.
    Further, we do have a multitude of ways to accomplish this with our hardware; here are a few resources to take a look at, with the first being an example of how to do this with a multifunction DAQ device:
    Using Software Timed Digital IO to control a stepper motor with DAQmx:
    http://decibel.ni.com/content/docs/DOC-6385
    Stepper motor control via Parallel port:
    http://zone.ni.com/devzone/cda/epd/p/id/3611
    High Performance Stepper/Servo control:
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/10026
    Stepper Motor Theory of Operation:
    http://zone.ni.com/devzone/cda/ph/p/id/248
    Stepper motor Drives:
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/3308
    Adam
    Academic Product Manager
    National Intruments

  • Controlling Stepper Motor

    Hi All.
    I am pretty new to Labview, and am looking for some advice in controlling a set of two stepper motors.  I have some experience with controlling stepper motors, but previously I used Matlab to create a binary script that was read into Labview to create a motion that I desired for the two motors.  Now I am hoping to control the motors using coordinates read in from another system (not an encoder, but a completely different system).  I basically just want the motors to follow the X and Y coordinates as they are read into Labview from the other system.  Any ideas are appreciated.
    Thanks!
    Jacob

    By LabVIEW driver I'm ssuming you mean the DAQ drivers and I'm also assuming since you're using a DAQ to control the motors you don't have an actual motor controller which means you will have to write the code to perform the function of a physical motor controller.
    Since it sounds like you're starting with a pretty low-level interface, I would say the next step is to write a wrapper that lets you input a) Step Direction and b) No of Steps to make in the direction
    Then you could use that function within what will ultimately be your "motor controller" which will keep track of where the motor currently is based on previous steps, and use that to enable the use of an absolute position your high level input.

  • Powders dosing machine? Direct control of motors?

    Hi Everyone,
    I hope this was not posted below but I begin my worki with nxt and labviev and have some problem.
    I want to build a powder doser which consists of two powder feeders (driven by motors) and laboratory weight controlled by RS232.
    The aim is to be able to make precise mixtures in a way that weigh weights empty box, make tare, then one feeder adds some powder (A) weight checks how much was given- if not enough adds some more etc..etc.. then proceeds with powder 2 and make mixture ..
    The problem is that I know that I can write NXT program on labview to run NXT brick, but this would be quite complicated to use - the best way would be to take direct control over motor via NXT- so when I want motor to move few degrees it doesnt have to start program in nxt brick, just do it from LAbview program level... IS it possible ? Can I use NXT brick as a motor controller itself?
    Thanks
    Marek
    Solved!
    Go to Solution.

    Marek,
    This is possible both in the NXT Module 2009 and earlier NXT toolkits.  In 2009 you simply need to write your NXT code in a VI that is not target to the NXT (e.g. it is targeted to My Computer/Main Application Instance).  The NXT VI's know when they are targeted to the computer and automatically send Direct Commands to the NXT brick via USB or Bluetooth.  
    In earlier versions of the NXT toolkit you will have to use the NXT Direct VIs to accomplish the same task, which isn't as seamless as the new method but works just the same.  Please let us know if you have questions as to how to implement this.
    Cheers,  
    Mark
    LabVIEW R&D

  • PCI-7344 Servo Velocity Control

    Hi,
    I have several servos to control fast changing velocity with ComponentWorks++.
    The samples included in samples directory take the following steps:
    1.flex_load_rpsps
    2.flex_load_rpm ;velocity
    3.flex_load_target_pos;postion
    4.flex_start.
    For a velocity control, is it correct to call the function
    flex_load_rpm and flex_start in repeat during a servo is running as a new velocity should be given?
    And when the position is not important due to the velocity control and the very long length, which value can be given for flex_load_target_pos function?
    flex_load_target_pos fucntion also can be overridden during servo runnig as like velocity?

    You should call Flex_set_op_mode and set your controller for velocity mode. This way you don't have to load a target position. (flex_load_target_pos)
    Yes you can repeatedly call flex_load_rpm and flex_start to change velocity on the fly.
    Hope this helps.
    Ken
    Applications Engineer
    National Instruments

Maybe you are looking for