PID Control motor DC 12v

Hi everyone,
I wanna control a 12v DC motor using PID control toolkit 8.2.
- a close loop control system
- using a DAQ model: NI USB-6008
- how do make a DC motor speed control 12v with PID control
Im stuck at getting pid.vi and i wanted to know what is the problem.
pls help me on my problem, if can pls make an example VI for me
Thanks !
Solved!
Go to Solution.

Well there are a lot of things you need to do this, LabVIEW software being only a part. Firstly, most DAQ cards will not source sufficient current to actually power a motor, particularly a USB6008, so you will need some form of amplifier/power driver. For closed loop you will need some feedback to tell you what the motor rotation is, usually a slotted wheel with a LED and sensor (if this is a project for school or hobby one source you might look at is an old wheeled mouse). So with these two you have a way to drive the motor and then detect its motion. Then you can get to the idea of doing PID, which is taking the feedback (from whatever sensor you end up using) scaling it to match whatever you are using, and apply it to one of the PID equations to get it to match the target value.
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion

Similar Messages

  • Pid control motor

    I am trying to build a PID control that will be controlling two motors for a small balancing robot.  I am using an accelerometer and am unsure how to build a vi that will be used with a the arduino mega.

    What did you make your servomotors do? (I suspect it would have at least involved Proportional control, which is the first part of PID control).
    I recommend you start by learning basic PID theory (http://www.ni.com/white-paper/3782/en , or Google some lecture notes). Apply that knowledge on a single motor, to control its position via PID. I assume you're using a servomotor, so use the Encoder signal as your PID feedback.
    Then, learn how to interpret your accelerometers (Google it).
    Then, combine those to use both your accelerometer and encoder as PID feedback, to control one motor's position.
    Then, combine two motors to build your balancing robot.
    These will probably take you a few weeks. Good luck!

  • NI Robotic starter Kit DANI PID control

    Hello
    I have this great kit and interested to do a kind of research of PID control on the two DC motors.
    I already saw links that can do this job but I noticed that I can not find any technical datasheet having the motor paramters ( Mechanical or electrical)
    I plan to bulid a tranfser function usig these paramters and then design a PID controller to make a speed control.
    I searched the internet for the datasheet for these motors and could not find.
    I think I should use a system identification for these parameters...so the question is
    Is it possible to do any experimental system identification for identification of the DC motor parameters without deassebling them from the kit???
    and how to do this job using labview??
    if any has the datasheets for these motors (TETRIX DC Drive motor, part number 39083) it will be helpful  ...
    Thanks
    A.Hakim

    Hello ShishKeBobby
    Thanks for your reply, but realy these information I knew, I need more information like a datasheet for this DC motors concerning the electrical and mechanical parameters.
    I searched for the tetrix DC drive motor, part no. 39083 on pitisco web site but I could not download the datasheet.
    these are the information I need
    Motor constants (KT, KE)
    Motor internal resistance (Rm) and inductance (La)
    Motor friction (viscous friction)
    Interia (J)
    , thanks 
    or I am thinking to get these parameters by system identification but I dont know how without disasseblying of the dc motor from DANI and having a benifet from Labview and the assembled Morors in DANI.....
    what you think?
    Thanks for help
    A.Hakim

  • Toolkit for feedback system? Motion; PID; Control/Simulation???

    Hi, I have to develop/program an organ bath system - a feedback system mimicking real sinusoidal breathing oscillations (shown in attached images). I have NI Labview 8.5, NI-Motion 7.6, a linear motor (M-235 DC-Mike actuator), an MID-7654 Servo Power Motor Drive and a pressure transducer. I believe I will need to control the PID controller and am aware of the PID Control Toolkit as well as the Control Design and Simulation Toolkit for NI Labview. However, is it possible to control the system using the NI-Motion software I have at the moment? If not, do I have to purchase both the PID and Control/Simulation Toolkit or just one? Thanks in advance...
    Attachments:
    feedback design1.JPG ‏25 KB
    feedback system1.JPG ‏42 KB

    Dear Garry,
    Do you have a motion controller to interface the MID-7654 to your
    computer and LabVIEW? This would be the PCI-734x or PCI-735x. If you
    do, I believe that you could implement your application with LabVIEW
    and NI-Motion. You could do so by using the analog feedback feature for
    the control loops for each axis. Then, you could specify the optimal
    sinusoidal moves/pressure patterns that mimic real breathing patterns.
    The analog feedback from your pressure transducer will be used during
    the move(s) to maintain the pressure that you want.
    Please see Chapter 13 here for more details:
    NI-Motion User Manual
    http://www.ni.com/pdf/manuals/371242c.pdf
    Here is also a good discussion forum post on Analog feedback:
    Can i use NI-7358 to implement a hybrid position force/torque control system?
    http://forums.ni.com/ni/board/message?board.id=240&thread.id=2976&view=by_date_ascending&page=1
    I believe that the above option would work for you, and you would not
    have to use the Control Design and Simulation Module or the PID
    Toolkit. Please let me know if you have any additional questions. I
    haven't actually set up a system with analog feedback from a pressure
    transducer before, but I believe that the above would be a very viable
    option.
    Best Regards,
    ~Nate

  • Labview PID control for virtual CNC lathe

    i am currently in my third year at UMIST, on the Mechanical Engineering (MEng) course. I am designing a control system for a miniaturised CNC lathe for my 3rd year project. For integration between the computer and actuators, i am planning on using Labview 7, but am currently having problems learning how to utilise the PID control toolset to create a virtual system response. I am planning on being able to input a specific transfer function for, say, a DC motor, and a ramp input, for example, and being able to view the output response as i vary the P, I and D gains. Some help with regards to the block diagram set-up for such a system would be greatly appreciated.

    The best place to look for this kind of information is the shipping examples of LabVIEW. Open LabVIEW >> help >> find examples. Another good place is online. Go to Advanced Search and look in the example programs.

  • I have a big delay in my real time pid control

    hi ,
    since i don't have a digital input module i tried to use the serial port RS232 on my Crio to read the data from an absolute encoder in order to perform PID control for  a dc motor, but the problem is that the data took too match time to be read; there is a big delay between the first read position and the next one,and when i change the slide controller the indicator took time to change, although it should be instantinouse, here is
    a snapshot of my vi. 
    please i need help.

    Hi Moho,
    Looking at your code I see a couple of things that might be causing the issue. How long is the delay that you are experiencing? You are trying to transfer 2000 bytes every loop which will cause some delay. You also have a lot of mathematical operations that can take time between loop iterations. Also what is the VI that you have manipulating your waveform? Have you looked into the PID VIs?
    Scott B.
    AE NI

  • I need to design fuzzy controller with pid control .

    hi ,
    I need to design fuzzy controller with pid control . to control   Dc servo motor i have NI DAQ PCI 6251 anyone help me??

    ssaara,
    Along with the shipping examples, here is a link to the PID Control Toolkit User Manual. Fuzzy Logic control is discussed in Part II of the manual, Chapters 5 and 8 are good starting points.
    --Michelle
    Instrument Control R&D
    National Instruments
    Instrument Control
    Machine Vision

  • PID control of Counters (PWM)

    Hello everybody!!
    I work on a closed loop PID controlled problem (Labview 8.5) and I have a couple of questions in order to make some progress!
    Firstly, I have to declare that my loop is composed of 2 AI channels (2 accelerometers), 1 AO channel (excitation channel-shaker), and 2 CO (for pulse creation PWM-controllers). The idea is very simple. When the AI (channel 1) value surpass or underpass a predetermined threshold value, then the appropriate CO should be activated in order to apply the necessary control forces and simultaneously to copy my data values of both AI channels in binary style for CPU velocity reasons! BUT, with the PID controller I want to optimize the Duty Cycle value of the pulses!
    My questions are :
    1) Why when I put Kp=Ti=Td=0 ( = run WITHOUT control) I can copy ALL the AI samples and when I start to activate the PID controller (let’s say for only Kp=0.5) I CAN’T copy ALL the AI samples? Where is my fault?
    2) About the PID vi which I use, is it correct or I should use the PID vi for ARRAYS?
    3) And finally, about the Boolean statement just before the Case Structures and the Shift Register, is it ok/necessary?
    I attach two vis, the ReadBinar .vi is used to read my binary files generated in the end of running of the Control.vi.
    Best regards
    Grigorio
    Attachments:
    Control.vi ‏277 KB
    ReadBinar.vi ‏162 KB

    Hello Zach!
    First of all, I want to thank you for your kind interest on my problem!!
    I must describe you the desired process with the Control.vi. There are two AI channels writing down the acceleration of a structure in two different points (for velocity reasons I use Binary Type storage for my data). One AO channel for structure sinusoid excitation (shaker) and two CO channels for controlling two solenoid valves with which I want to control my structure acceleration (minimize it as well and fast as possible)!!
    In order to help the description, let’s ‘cut’ the block diagram of Control.vi into three pieces (Before While Loop – Inside While Loop – After While Loop).
    In Before While Loop section, the main question is about simultaneousness. The DAQmx Start inside the Flat Sequence Structure, do you think that is necessary, ok? I want to run my experiment for 30s and to collect 6000 samples with 200 samples/s. In addition, in the CO DAQmx timing, I have set 200 samples/channel in order to be able to change the duty cycle value because of the conditions inside the While Loop. Do you think that everything in this section works well? 
    Inside the While Loop, firstly in the DAQmx Read, I have set 200 samples per Input Channel, which is also equal to the AI and AO Sampling rate! Before some days I have put there -1 and unfortunately the total written samples were less than 6000!! My main problem is how I can check all the read data without losing run velocity and simultaneous if one sample is >0 then it goes further to the first PID.vi (left solenoid valve) or if that sample is <0 then it goes further to the second PID.vi (right solenoid valve)!! When a sample has gone to a PID.vi, then I want to tune the duty cycle of the controller (PWM control) as well as possible in order to achieve the Setpoint value for the second AI channel. Are all these possible? If not, what do you suggest me?
    In addition I compare the present duty cycle value with the previous one in order to be inside a tolerance value (let’s say 0.1). Moreover, is it correct the Case Structures where I want to share the positive and negative AI samples before going to the respective PID ?
    Finally, After the While Loop, I believe that everything is OK. I just finish all the tasks.
    I have to mention that I work on a PCI-6289 and Labview 8.5.
    With best regards!
     Grigorio
    Attachments:
    Control.vi ‏288 KB
    equal within tolerance.vi ‏9 KB
    ReadBinar.vi ‏163 KB

  • I am looking to control a 4-way hydraulic solenoid valve. Do I need a PID control toolset, or can i control the system through my 16E4 daq card and scxi chasis

    I am looking to control a 4-way hydraulic solenoid valve. Do I need a PID control toolset, or can i control the system through my 16E4 daq card and scxi chasis

    I think you're asking 2 different questions.
    The PID control toolset is for using PID loops for control; it's just software.
    The DAQ card and scxi chassis are hardware. If you have the appropriate signal conditioning cards in your chassis to control/monitor your solenoid valve, then you can run a PID loop.
    I believe the simple answer is: the PID control toolset is the best way to do control, but there are simple PID VI's (even on this website) that you can download and use for simple control.
    Mark

  • PID control in a windows CE Labview application

    Hi there,
    I want to build an application that will control the temperature in some ovens, using PID control. The application will be running in a controller (or a touch panel computer) with windows CE OS. I have Labview 8.6, PID control toolkit 8.6 and Touch panel module 8.6. The problem is that the PID vi's don't seem to work in touch panel module. 
    Is there any way to implement PID control in a windows CE Labview application?  
    Thanks in advance.
    Solved!
    Go to Solution.

    I think with a timed loop you can run reasonable good timing down to 1 mSecond. I think 1 mSecond is the lower limit for non realtime systems like Windows/windows CE. And if you have the PID toolkit this will supply you with the functions you need. You do not need an extra CE PID toolkit. This because  the touch panel module run under your standard Labview environment. But I do not know if all the functions in the PID tool like fuzzy logic are compatible with CE. Have you also considered Windows Embedded as OS for your module. With windows Embedded you can run standard Labview built exe files
    Both Windows Embedded, and XP Embedded can be trailed
    http://www.microsoft.com/windowsembedded/en-us/products/westandard/default.mspx
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Steps to create vi file for PID control in 8.0 pro without specific PID addons.

    Per my other posts, I am testing a friend's software to see if this is what we would like to use.  I would prefer to use their software for our initial work to help offset the cost of the software.  Problem is their software is 8.0 pro without the extra PID stuff.  I am curious how one gets started creating a custom PID algorithm to be used in series between an input and an output.  I have viewed several tutorials but all seem to simply point at the PID toolkit that is not availalbe to me right now.  I realize it might be more work to create one but probably the only option at this point. 
    To simply the process, lets just compare a single input and output where the software will control the output to obtain to desired input.  in  tutorial, I was following right along until the PID loop was added and that seems to be just a drop and go type of deal in which would rarely apply to a real work application. I am simply trying to learn how PID systems are written into the block diagrams.  
    Hopefully my question makes sense.  

    asdfs wrote:
    Per my other posts, I am testing a friend's software to see if this is what we would like to use.  I would prefer to use their software for our initial work to help offset the cost of the software.  Problem is their software is 8.0 pro without the extra PID stuff.  I am curious how one gets started creating a custom PID algorithm to be used in series between an input and an output.  I have viewed several tutorials but all seem to simply point at the PID toolkit that is not availalbe to me right now.  I realize it might be more work to create one but probably the only option at this point. 
    To simply the process, lets just compare a single input and output where the software will control the output to obtain to desired input.  in  tutorial, I was following right along until the PID loop was added and that seems to be just a drop and go type of deal in which would rarely apply to a real work application. I am simply trying to learn how PID systems are written into the block diagrams.  
    Hopefully my question makes sense.  
    Take a look at the PID Control Toolkit User Manual . It clearly defines the math used and there is absolutely nothing stoping you from writing that code yourself.
    What you will not get by doing it yourself is the auto-tuning as well as all of the supporting and helper sub-VI along with the polymorphic versions that will support arrays of PIDs.
    If you write it yourself and it work good please post up your version for others to review or use.
    Have fun,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to apply notch filter in the PID control

    Dear all,
    I am using PID control in my positioning stage but the output is every noisy with some fixed frequencies(30,50,150Hz). I want to add a notch filter to take off those noise. However, I do not know how to apply the notch filter to the PID module. Could anyone tell me how and show me example if you have?
    Thanks
    best
    Attachments:
    PID_notch filter.png ‏21 KB
    PID_notch filter.png ‏21 KB

    Hi LYnn,
    I am sorry for my late reply. My stage is driven by a voice coil actuator (VCA). The VCA as a resolution of 1 um and range of 6 mm. The NF of the stage does shift when the load is changing. Do you have any advice for controlling such kind of stage?
    BTW, as far as I see, the control frequency is determined in the DAQ Assistant settings and its value is equal to "Sampling rate"/"Samples to read", am I right?
    Thanks
    best
    Attachments:
    VCA stage.png ‏160 KB

  • Level Control with PID Control & Pulse-Width Modulation

    Hi all,
          I have attached my program which I'm having trouble wiring up in the block diagram.... I'm fairly new to labview, but basically I have a level control project with an analog input cistern arm turning a pot for my test tank (configured as DAQ assistant voltage analog i/p) and a pump working off a reservoir (configured as DAQ assistant voltage digital o/p). My electrical side of things is working correctly and I have tested both DAQ assistants I/O's successfully off a basic program, minus the PID & PWM... I found a simple PID control subvi which I think I have wired up correctly, apart from the output variable... I also found a bit of code for PWM using the square waveform vi (far right side of the program) which I have tried to include in the program, but I've been unsuccessful with that. The ideal operation i'm looking for with this project is to be able to enter different values for the setpoint, for the PID to kick in to find that setpoint each time using the PWM to drive the pump, which has a flow rate of 13L/min. I have a manual valve to release water from my test tank which I can set accordingly.
    My questions are;
    - How do I connect the 'output variable' of the PID subvi to my DAQ assistant digital output(both DAQ assistants are set at 1 sample on demand)?
    I have a 'number to boolean array' function, but this gives an error saying that the number of tasks generated are not the same...
    - How do I wire up the PWM bit of code? Do I need to include the 'error in & out' tabs?
    -Am I on the right track with this program or am I way off the mark?!
    Any feedback on this would be greatly appreciated. Thanks for your time,
    Richie
    Attachments:
    PID-RichLevelControl.vi ‏91 KB

    Rich-MechatronicsStudent wrote:My questions are;
    - How do I connect the 'output variable' of the PID subvi to my DAQ assistant digital output(both DAQ assistants are set at 1 sample on demand)?
    I have a 'number to boolean array' function, but this gives an error saying that the number of tasks generated are not the same...
    - How do I wire up the PWM bit of code? Do I need to include the 'error in & out' tabs?
    -Am I on the right track with this program or am I way off the mark?!
    You're a bit off track.  You need the output of the PID to go into the PWM generator, and the output of the PWM to be written to the digital output.  Right now you have the output of the PID connected directly to the Digital Output in a way that won't work, and the PWM generator hanging off the side not really connected to anything.  Also, the PWM generator isn't really going to work since you're generating it at the same frequency as your PID loop runs.  Try a simpler algorithm such as on/off control first and see if that works for your system.

  • Looking for a reasonable looptime for my PID controler!!

    Good morning!
    I am trying to do a PID control of a combustionchamber.  The setpoint and process value are the output  temperature, the value to  operate  is  the massstream of  the fuel.  My  in- and output datas are refreshed every 50 ms.  My problem is...
    What is a reasonable looptime for my PID control? 
    Do you have any ideas???
    thanks RT

    My group has used the Sun Electronics PC-1000 Process Controller for some time, with good results. There are some instructions in the beginning of this Engineering Note (pdf link) that discribe how to iteratively determine the PID coefficients for a linear system. I'm not a mathematician, so I can't vouch for whole document, but their somewhat antiquated instruments DO work
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • How can I make and wire reffercence signals(ramp,sine,square) to excite and evaluate the behaviour of the system wih PID control?

    Dear all,
    I am Tri, I am a beginer with LV program. Actually I used LV for my reasearch, I had tried wiht very simple thing but the problem arise because I am not familiar with LA. Why I know that problem is simple because I compare with MatLab that I had somtime used before.
    I make a loop of PID control, It worked properly but I don't know how to make a refference signal to wire to the loop for excitating to evaluate the behaviour of the system. Please give me your help.
    Thanks

    Hi Tri,
          I've employed the "simple PID.vi" without a problem, but your example is more complex.  I think you use a Function generator to modulate DAQ inputs?
    Perhaps someone else will be able to infer your intention and identify a flaw in the logic.
    In case someone else wants to run your VI, it may help to build/attach an .llb (some sub-VIs are needed by the VI you atached.)
    To build the .llb, save your VI with Development Distribution options (Alt-F,Alt-W) and attach the .LLB
    1) \File\Save with Options
    2) select Development Distribution
    3) Save
    4) choose "New VI Library"
    But first, It would be helpful to us if you clean-up the code - straighten wire-paths, minimize bends in wires, and try to avoid "tall" diagrams.  Scrolling diagrams up and down is "bad form".  If scrolling is necessary, left&right is preferrable!
    Cheers.
    (and, for the record: in my previous post, Exitation would be wired to "Process Variable", Not "Set Point" (ouch!))
    When they give imbeciles handicap-parking, I won't have so far to walk!

Maybe you are looking for