PID controller on NXT

Hello,
I'd like to include a PID controller in my NXT-Program. But I can't use the LabVIEW Toolkit, because these VIs can't be compiled.
Howcan I realize such a control without PID-Toolkit?
Can show me anybody an example for implementation, please?
Regards, Maddien

Full PID control might be difficult since you would need to implement it from scratch, but simple proportional control is fairly easy.  There is a good example of this in the book LabVIEW for LEGO MINDSTORMS NXT.  
Message Edited by BLAQmx on 09-17-2009 09:59 AM
Mark
LabVIEW R&D

Similar Messages

  • NXT PID Controller from PC

    Hello,
    I've implemented a PID controller on PC to control NXT Robot in this steps:
    1. NXT sends the sensor value (Light sensor) to PC.
    2. PC performs all calculations (PID controller and motor power for each wheel)
    3. NXT receives the powers of motors and applies to corresponding motor.
    With USB connection, robot follows the line very well and execution time is only 15 ms. But with Bluetooth, execution time up to 60 ms (!!) and the robot cannot follow the line properly.
    Is it normal that Bluetooth has this latency? The only solution is to implement the PID controller directly on the NXT?
    I've attached the robot's program.
    Thanks!
    Attachments:
    Robot 9 (enviat).vi ‏20 KB

    Bluetooth is always going to be slower than USB, and best performance would be doing the PID control on the NXT.
    Can you attach your host side program as well so we can see how you are sending/receiving messages on that pc? 
    Are you using a mac with built in bluetooth radio? Sometimes people get better performance on mac with an external dongle.
    Another option would be disabling the status check when a message is written to the NXT. 
    See the following vi: 
    C:\Program Files (x86)\National Instruments\LabVIEW 2012\vi.lib\NXT\DirectCommands\NXTToolkit.DC.MessageWrite.vi
    There is a true constant on the diagram that specifies "requireResponse". This enables getting a response back that the messageWrite succeeded. I'm not sure how important it is, but setting that to false would reduce the number of bluetooth transactions in the loop by one.

  • Circuit for auto tuning of pid controller in lab view

    Hi sir
    for my  project in auto tuning of pid controller using labview,for that
       i require a simple  circuit diagram(lab view figure) and have no problem in running for that
    i will be very thankful  to you

    Hi!
    I am not sure if I completely understand the question but if you are wanting to do autotuning for PID there is actually a VI that will do it for you.  It is called PID Autotuning.vi and can be found under the PID Control pallete in LabVIEW.  The LabVIEW Help file also contains more detailed information on the inputs and outputs to the VI.
    Carlton
    CLD

  • Thruster control using PID controller

    Dear All,
    Actually my project is related to heading control of an underwater system using PID controller - A Labview Application.
    Till now, As per this forum discussion, I have completed the rotation count measurement of a compass C-100 device using Event structure and cFP controller.
    Now I need to integrate the PID controller for thruster control according to the count value measured.
    Could you please anyone guide me to start implementing the same. Please do the needful.
    Thanks and Regards,
    Dinsulpri.

    Dear nathand,
    Actually I need do a heading control application of a underwater system by using PID controller by the help of thrusters.
    According to this,Firstly,I have completed the rotation count measurement of the system by interfacing the compass C-100 (for checking) with the cFP controller.It is working fine.
    Now I need to do the PID controller part based on this count value measures, that is , I need to give the control signal to the thruster in order to release the twist of the system.
    I just gone through the PID part in the labview and understood the concept and simulated the basic examples given in that.
    My Understand as follows, Please validate the same and give me your suggesion on this,
    1) Need to give Setpoint should be a thruster voltage .
    2) I dontknow what to give in the process variable field.
    3)Apart from this, how can I show this concept schematically with out connecting the thruster manually? Is it possible to show the demo in chart analysis format? 
    Please validate the above points and guide me to start working on this task.
    The rotation count measurement application, Till now I did was attached with this. Please go through the same.
    Thanks and Regards,
    Dinsulpri.
    Attachments:
    Compass_Event Structure.vi ‏18 KB

  • PID controller

    Hi All,
    I Have to design a PID controller based on standard Labview 8.2 and I've tried to do so but still facing problems with it. I think there might be a mistake in one of the connections in the PID controller. Even when I tried to simulate it with a simple transfer function, I could not get any response.
    please have a look on the attach files and tell me what wrong with it .
    Regards,
    saed
    Attachments:
    final pid2.vi ‏30 KB
    PID2.vi ‏27 KB

    Hi saed,
    there still is Rube-Goldberg in it See comments in attachment...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    final_pid2e.vi ‏26 KB

  • Factors to be considered while designing a PID controller

    Hi ,
    I am designing a PID controller for a temperature control system.
    What are the factors should i consider to decide the PID controller range?
    I have to adjust the heater voltage to keep the process temperature under control.
    How to simulate the program without actually getting the process temperature??
    Will the PID Controller work with any relation (for simulation purposes)between heater voltage and process temperature??
    Am not an expert in PID controller.............
    could someone guide me ...........
    Thanks,
    radhika

    Hi Radhika,
    For guidelines on setting parameters of your PID controller, you can search and find good information in books and all over the web (e.g. root locus and Bode plots).
    As far as LabVIEW is concerned, you might want to take a look at the Control Design Toolkit, and its manual, available here.:
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/13854
    And you could use something like a simulate signal express VI to simulate an input to your system.
    Hope that helps! Take care,
    -Sam F, DAQ Marketing Manager
    Learn about measuring temperature
    Learn how to take voltage measurements
    Learn how to measure current

  • Usage of PID controller instead of ON OFF controller

    respected sir,
           I pursuing  btech final year in the stream of instrumentation.sir i have a doubt  while go through my project,can i use PID controller  instead of using ON OFF CONTROLLER. would you please suggest me the possible ways which are going to implement in my final project intelligent wheel chair.i am eagerly waiting for your valuable acknowledgement.
    thank you,
    with warm regards,
    BOMMAREDDY

    Hi!
    I am not sure if I completely understand the question but if you are wanting to do autotuning for PID there is actually a VI that will do it for you.  It is called PID Autotuning.vi and can be found under the PID Control pallete in LabVIEW.  The LabVIEW Help file also contains more detailed information on the inputs and outputs to the VI.
    Carlton
    CLD

  • PID controller loop

    Hi,
    I have a problem to control the torque's setpoint.
    I'm using the example in Labview 6.1 PID controller loop.
    The process variable measures the torque and it's the same value indicated in the torquetronic, but the system isn't regulate as I want.
    I always have the upper limit(10V) to the servovalve,so I have 7Nm even if I put 2Nm in the setpoint box.
    I'm sure that the parameters in MAX are good (to the range).
    How can I regulate the torque??
    My PID values are: P=0,2 ; I=5 ; D=0 Are they right??
    Salutations

    Hi,
    I am assuming that if the voltage to the servo valve is increased, the torque increases, and if it is decreased, the torque deceases.
    First, test the setup in open loop, that is, set the voltage directly to the servo (0--10V)(without using the loop), does the torque value changes accordingly, if not you have a mechnaical/electrical problem.
    If it reponds, then
    Start with D=0, and small values of P and I, and monitor the voltage output of the PID,
    then incease P and I in small increments
    In general, as P and/or I are increased, the voltage output and torque also increase. Large values will make the system torque/voltage osciilate.

  • Temperatur​e control using pid controller

    sir i ve a doubt that how should i control temperature at a particular value using this PID controller here i attach screen shot of my block diagram.please show me the path how should i controll
    Attachments:
    Capture.PNG ‏20 KB

    Hi,
    I am also looking for some what same situation. Did you get any answer?

  • Laser frequency stabilization using pid controller

    Does anyone know of an example where the PID controller in LabVIEW has been used to stabilize the output frequency (wavelength) of a diode laser? A PID module for our laser can be purchased, but I'm hoping to try a LabVIEW-based system. Ideally, we'd like the long-term (minutes) variation of frequency to be a few MHz.

    The input to the PID is the process variable which is the output of the lock-in. The lock-in is processing a signal which is related to the frequency of the laser. Is the set point in frequency units or something else?
    The output of the PID goes to the current input of the laser controller.  The only scaling in the PID is based on the values for Kp, Kd, and Ki. 
    So it seems likely that some conversion will be appropriate. Do you know enough about your optical process to have a value for the frequency change per volt of output of the lock-in? Do you know the frequency change per amp of laser controller input? You should be able to combine those values to determine an appropriate scaling factor.
    You used "accuracy" and "precision" in successive sentences and I wonder if you have them confused. Accuracy refers to how close to the actual value a measured or commanded value is. Precision essentially refers to the number of significant digits in a value.
    You have set the precision of the value written to the laser controller to 2 digits after the decimal point. If you want more precision (an if the instrument supports it), you need to change the format string.
    Increasing the sensitivity of the lock-in is the same as increasing Kp in the PID. At high enough values most systems oscillate.
    My first concern with oscillation would be the time delay. What are the time constant settings on the lock-in? How long does the laser controller take to respond to a command over the GPIB?  Time delays in a feedback system make the system very difficult to stabilize.
    The system I worked on never worked completely to my satisfaction. It always required a significant amount of manual tuning.
    Lynn

  • RT Host VI does not communicate with FPGA VI with PID Discrete controller

    Hi. I am using LV 7.1 RT with PXI 7831R. While developing an application with a PID controller in the FPGA vi, I have run into the following problem:
    1.   After a successful FPGA compile, the code runs directly on the FPGA device and the PID controller works fine.
    2. After I switch to the RT and run the host vi, it shows no activity from the FPGA vi. I look at the while loop count of the FPGA (indicator named 'FPGA-count' in the snaps below)) and it shows 'zero'. I have refreshed the FPGA vi reference but to no avail.
    3. If i take out the PID related stuff from the FPGA vi, then the Host vi to FPGA communication works.
    I have attached snaps of a simplified version of the fpga and RT vi's. If anyone can help, that would be greatly appreciated.
    I also read that the PID control toolkit needs to be installed. It is installed on the host computer and shows in Automation explorer under LV 7.1. Does it need to be installed on the remote machine that is the RT controller as well. if so, then how to do that.
    Thanks
    Attachments:
    RT-frt panel.JPG ‏38 KB
    fpga-block.jpg ‏39 KB
    RT-block.JPG ‏35 KB

    It seems like the FPGA is not running for some reason when you are running the RT VI. Without having the actual VIs to look at I can only make a few guesses why.
    On the Open FPGA VI Reference make sure the option is set to Open and Run, not just Open. Right click on the node to check this option.
    On the RT VI, make sure that stop-FPGA is False before you start.
    On the FPGA VI, make sure that the default value for stop-FPGA is set to False.
    In the RT VI check the error cluster passed to the loop to make sure that there are not errors and the FPGA VI is actually running.
    If you are using the PID function on the FPGA, you do not need any additional SW installed on the RT controller. If you are using the PID function in LV RT then you do need to install the PID toolkit on the RT controller. This is done from MAX (Measurement and Automation Explorer) using the Install Software option for the controller.
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • NXT-G block for HiTechnic Servo Controller

    I'm trying to track down an NXT-G block for the HiTechnic Servo Controller. My son just purchased the controller at LEGO Ed but hasn't found a block for it. After a lot of searching, we did find a block for the HiTechnic DC Motor Controller ( http://joule.ni.com/nidu/cds/view/p/id/1129/lang/en ) and was hopeful that a similar block for the servo controller would be available somewhere. He has spent quite a few years working with RoboLab and NXT-G with LEGO robots and felt that the combination of the NXT, servo controller, and NXT-G 2.0 control and data logging would be perfect for his project.
    Cheers!
    -Glenn

    Ok, I made a Sub VI with it, and put together a simple program. When I try to download it to my NXT, it gives me the error "Cannot open a VI because it is password protected."
    Any idea on how to fix this?
    Attachments:
    Speed_Sub.vi ‏186 KB
    speed_test.vi ‏17 KB

  • Program Structure for PID temperature Controller

    Hi everybody,
    I built a PID temperature controller VI for a third party DAQ board, based on a very basic knowledge in programming.
    Now the VI works fine in both ends "i/ps & o/ps", the problem is that i cant get the response that I'm looking for from the PID controller. Since the system is time critical, I wounder if the structure of the VI is cosing this problem. please if you have any idea, hint or suggestion.
    Marwan
    http://www.geocities.com/marwan_m13/weemee8080.jpg
    Attachments:
    PIC Temperature Control(PID).vi ‏364 KB

    Marwan,
    You say that time is critical. The timeout is set to 1 second in the main loop. You will only get one update per second with this setting.
    Several comments:
    1. I have never seen the event structure used soley to control loop timing like this. No reason it should not work, but that is not its primary purpose. If you were to use the event structure to also handle user events (as it is designed to do), then things could get complicated. The Wait (ms) functions and Elapsed Time Express VIs can perform the timing for you without the risk of unintended consequences.
    2. Generally it is recommended to use only one event structure in a program, unless you have very specific reasons for using more than one. Since you are using them only as timers, the interaction potential is minimal.
    3. Right to left wiring and avoidance of wires hidden behind other objects make code much easier to read and to debug.
    4. Putting the user controls and displays and the write to file functions in independent loops allows the PID function to run at different rates from the user interface and file save functions. Look at examples of Producer/consumer architecture.
    5. Precalculating things which do not change from iteration to iteration can save time. For example multiply by 2.55 rather than multiply by 255 and divide by 100. Also make the datatypes consistent to avoid type coercion (indicated by little dots at the input connections such as the 255 input to the mutliply. Changing the datatype of the 255 constant to Double eliminates the coercion.
    Lynn

  • PID Temperature Controller with myRIO

    I am interested in implementing the LabVIEW PID VI to create a temperature controller using the myRIO for a sous vide cooking apparatus similiar to this: https://learn.adafruit.com/sous-vide-powered-by-arduino-the-sous-viduino/sous-vide. I will be using a slow-cooker as the heating element; for the temperature measurements, I am using the DS18B20 one-wire temperature sensor; and to alter the temperature I am using a relay connected to the slow cooker.
    I have had success getting temperature measurements from the DS18B20 with the myRIO following the guidance of this thread: https://decibel.ni.com/content/docs/DOC-41626#comment-44403, however, I am having difficulty finding a starting place to learn how to use the PID VIs for the rest of the project. In a new VI file, I used the program I had used for the temperature readings as a subVI, and tried to connect its output containing the live numerical temperature measurements into the PID VI, but the live temperature measurements as well as the PID VI output are not being transmitted after running the program.
    Here are a few more specific questions:
    Are there any preliminary steps for creating a PID program to accept live measurements from a myRIO target (should the program be enclosed in a loop for continuous updating of myRIO measurements)?
    What information is transmitted at the "output" terminal of the PID VI?
    Is autotuning recommended for this type of application?
    How does the "PID Autotuning" VI differ from the "PID Autotuning (Temperature)" VI?
    I have attached the files I am currently working with: ("1-wire interface.lvproj" is the project file, "RT Main.vi" is the temperature reading program, "PID_Test" is the new PID VI file I am experimenting with).
    If the content in this post is not appropriate to what is expected to be asked in the forums (not specific enough, etc.), please let me know and I apologize in advance. Thank you for your time and assistance!

    Hello dpull,
    There shouldn’t be any particular configuration that needs to be done, for the PID vi to start using the PID VIs, and if you desire to continously acquire the data from the myRIO, then this within a loop might be appropriate.
    The output terminal transmits the control signal of the PID controller, so basically the action that would have to take place to take the desired value to the setpoint.
    As far as recommending autotuning, it mostly  depends on your application and the precision you need, it would always be better to determine the parameters yourself, but if you don’t require super high accuracy, then autotunning should be sufficient.
    The PID autotunning (Temperature) VI is used for processes that include a dead time, since it’s incorporated into that model, the other one is better suited for processes that don’t have dead time.
    As far as resources go for learning to use this toolkit, I’d recommend sticking to the examples you can find in LabVIEW and maybe the following manual.
    http://www.ni.com/pdf/manuals/372192d.pdf

  • PID anti windup

    I have built a PID controller in labview. Ive
    been using time domain math, integral and continous calculation. And it
    works well. But I need a anti wind up.
    Is there a easy way to
    build this? I want to build it my self, and not use the PID block. Or if anyone could help me using one of the PID blocks, and to get the value from 
    Ygain, Yintegration, Yderivation and Y total. This so I can see how the process react on different changes.
    If
    anyone could make an easy example for me it would be great.
    I have
    tried with case loops etc but I dont get it to work properly.

    Open the Front panel of teh VI from the PID Toolkit and do a "Save as" and in the dialogs, tell LV to not update the callers.
    When you are done saving you will have your own copy of the PID VI that you can play with.
    Dig into that VI and find the values you want and create indicators on the icon connector to return those values each time the hacked_PID is called.
    Byt the time you get that done and play with it a bit, you will have good idea of how it works while at the same time getting a healthy does "so where does this wire go?".
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • Transferring Photos from iPhone 3GS to iPhoto

    IPhone is not visible in iPhoto so I am not able to transfer my iPhone pics to iPhoto. It used to work fine until 3-4 weeks ago! Can anyone help me resolve this I have reinstalled iTunes and iPhoto and Rebooted my MacBook Pro 15'' Message was edited

  • Minor editor bug

    Hi, I noticed couple problems with JDev editor: 1) editor only shows "Brace Mismatch" when cursor is positioned next to it. So when code you think that there is no errors but when you compile errors are reported. 2) some times syntax error are not sh

  • Lion tore apart my digital audio!

    Hi everyone, i have just upgrade my system to 10.7.2 from 10.6.7 and everything work fine except my audio thru optical output. I have pluged to my mac mini's optical sound output and my problem now is that, when I play EVERY MOVIE it works fine the f

  • New Clovertown 8-Core

    What new capabilities does this 8-core architecture bring?

  • Sending email from PL/SQL in oracle

    This is the sample code DECLARE l_mailhost VARCHAR2(64) := 'mail.mycompany.com'; l_from VARCHAR2(64) := '[email protected]'; l_to VARCHAR2(64) := '[email protected]'; l_mail_conn UTL_SMTP.connection; BEGIN l_mail_conn := UTL_SMTP.open_connection(l_ma