Lab 2, PID control of motor and auto tuning

Time and place

  • HVL Robotics Lab, Øyrane 12, 6800 Førde, 2. floor (under Reodorklubben).
  • Time: TBD.

Equipment

  • Motor, the red model with a motor and variable load.
  • Beckhoff CX and IO`s
  • Some device with a browser, connected to lab WiFi
  • If you need to debug, or you`re just interested, take a look thru the IO list on GitHub

Description

In this lab you will auto tune a PID to control the speed of a motor. Software is done, you will do the tuning.

Your PID will be given a score, less is better. Take a screen dump of your score and PID gains, send it to me, and receive a thumbs up for completing the lab.

The motor model can be a fun, practical challenge for three reasons

  1. The varying load is an un-measured disturbance (but you can estimate it)
  2. Deadband/sticktion, the motor doesn’t turn before it gets a bit of throttle
  3. It`s comparable to cruise control subject to varying uphills.

Not to mention it`s old and worn, varying in behaviour from day to day.

The overall workflow for you to do is

  1. Turn on stuff
  2. Get to the user interface thru a browser
  3. Have fun
  4. Use the auto tuner, maybe improve tuning manually.
  5. Get a score
  6. Win

Steps

  1. Connect to the local lab WiFi with your device (PC, smartphone, tablet) and go to http://172.31.1.142/Tc3PlcHmiWeb/Port_851/Visu/webvisu.htm.. If all is well, go to the next step, else:

    1. Check that the motor IO is connected to Beckhoff IO modules, see io_list
    2. Check that IO`s are connected to Beckhoff CX.
    3. Check power supply to motor, IO, CX, router. Turn these on.
    4. Wait for green lights. Else, call for help.
  2. Click PWM to get to the right screen.

  3. The SC01 (speed control) CA is a NORSOK I-005 (IEC PAS 63131) template for control of analogue signals (PID). Select manual, internal mode, play around with the manual output.

    1. Switch all resistors down (off).
    2. Set your manual output to something that gives a steady speed (maybe 50%).
    3. What is the resulting speed? What is the ratio between manual output and resulting speed?
  4. Set your internal mode gains. This PID is in standard form, so I and D are in units of seconds. Maybe try Kp,Ti,Td as 1,5,2.

  5. Try your PID

    1. Set a desired level YR as 50%

    2. Switch to auto (still internal)

    3. Observe your PID.

      1. Move the YR around
      2. Move the manual switches to vary the load
    4. Adjust tuning until you get a smooth speed control, the desired speed is reached smoothly and the switchable loads is handled ok.

  6. Turn off all switchable loads, run the test, get a score.

    1. Happy? Done. Else, keep tuning, ask questions, take the opportunity to understand control theory.

Reg tek rulez!