Teaching pack · UAT 202

A 15-week teaching plan, 5 worksheets, a scoring rubric and a map from the course description to the lessons, for instructors to evaluate and adapt before teaching.

Last updated: · 3(2-2-5) · Per week: lecture 2 h, lab 2 h, self-study 5 h; 60 contact hours per term

Coverage of the course description

The lessons fully teach 10 of 10 description topics. Each topic lists the modules and lesson sections that teach it, and incomplete topics say what is missing.

Description topicModulesWhere it is taughtStatus
Components of automation systemsM1Module 1: components of an automated system · factory levels in ISA-95 · where people fitCovered
SensorsM2Module 2: presence sensors · the 4–20 mA signalCovered
ActuatorsM2Module 2: actuators (solenoid valves, pneumatic cylinders, motors)Covered
RelaysM2M3Module 2: relays and contactors: circuits and contact ratings (coil, NO/NC contacts, latching circuit, flyback diode, resistive against inductive ratings, AC-1/AC-3 utilisation categories, Example 2 choosing a relay or contactor for the station loads) · Module 3: ladder logic compared with the relay seal-in circuitCovered
Sequential controlM3M5Module 3: ladder logic, start–stop circuit and TON timer · Module 5: the sequence as a state machineCovered
Basic PLCsM3Module 3: the PLC scan cycle · ladder logic · IEC 61131-3 languages and safetyCovered
Feedback controlM1M4Module 1: open loop and closed loop · Module 4: the feedback block diagram, ON/OFF, P, I and D, and integral windupCovered
Industrial robotsM5Module 5: industrial robots: types and teaching positions (ISO 8373 definition, IFR structural types, cobots under ISO 10218-2:2025, teach pendant, lead-through, offline programming, TCP and user frames, Example 3 a landing pad moved during maintenance) · designing an automation system (Example 4 a robotic battery-swap station)Covered
Device interfacingM2M5Module 2: PNP and NPN, the 4–20 mA signal · Module 5: Modbus, a common language for devices, and automation inside the droneCovered
Introductory automation system designM5Module 5: designing an automation system (the five design questions, Example 4) and the battery-swap station design labCovered

Weekly teaching plan

WeekTopicPre-classLectureLabEvidence
1 M1Components of an automated systemRead module 1 up to 'Components of an automated system'Sensor, controller, actuator, process and disturbanceWorksheet 1 part A: break down three automated systems around youComponent table for three systems
2 M1Open loop and closed loopRead 'Open loop and closed loop'; run Example 1, a conveyor under extra loadWhy feedback holds speed under load changes and the role of gainWorksheet 1 part B: classify open or closed loop; run Example 1 varying load and gainSpeed under load at several gains
3 M1ISA-95 levels and the role of peopleRead 'Factory levels in ISA-95' and 'Where people fit'; take the module 1 quizISA-95 levels 0–4 and levels of automationWorksheet 1 part C: draw the battery-swap station, mark ISA-95 levels and human decision pointsStation diagram and quiz result
4 M2Presence sensorsRead module 2 'Presence sensors'Inductive, capacitive and photoelectric sensors, detectable materials and sensing rangeWorksheet 2 part A: test three sensor types on metal, plastic and a battery boxDetection-range table
5 M2PNP and NPNRead 'PNP and NPN'Sinking and sourcing and matching sensors to PLC input modulesWorksheet 2 part B: read labels, identify types and wire sensors to the PLC under supervisionWiring diagram checked by the lecturer
6 M2The 4–20 mA signal and actuatorsRead '4–20 mA' and 'Actuators'; run Example 1; take the module 2 quizScaling, broken-wire detection, solenoid valves and cylindersWorksheet 2 part C: measure a 4–20 mA loop, test a broken wire and drive a cylinderWorksheet 2 report and quiz result
7 M3The PLC scan cycleRead module 3 'The PLC scan cycle'Read inputs, execute, write outputs, and the effect of scan timeWorksheet 3 part A: install CODESYS and write a start–stop circuit with E-STOP in LDFive-case test table for the start–stop circuit
8 M3Ladder logic and timersRead 'Ladder logic'; run Example 1, simulating the conveyor PLCContacts, coils, latching and TONWorksheet 3 part B: add a 1.0 s TON for the arm and compare with Example 1LD program and comparison
9 M3IEC 61131-3, safety; midtermRead 'IEC 61131-3 languages and safety'; review modules 1–3; take the module 3 quizMidterm examination (modules 1–3)Worksheet 3 part C: write the same logic in ST and try a button press shorter than the scanWorksheet 3 report and midterm score
10 M4Feedback block diagram; review of rates and accumulationRead module 4 through the review section; run review examples A and BSetpoint, error and derivative and integral as seen in dataWorksheet 4 part A: run Example 1 with different ON/OFF hysteresisSwitching count and oscillation band
11 M4ON/OFF, P, I and DRead 'ON/OFF, P, I and D'Steady-state error of P and the role of the I termWorksheet 4 part B: raise Kp and record the steady-state errorKp versus steady-state error table
12 M4Integral windup and choosing a controllerRead 'Integral windup'; take the module 4 quizCauses of windup and how to stop accumulationWorksheet 4 part C: windup test from a 45 °C cabinet; use a real fan rig if availableWorksheet 4 report and quiz result
13 M5The sequence as a state machineRead module 5 state-machine section; run Example 1States, transitions, timeouts and the safe stateWorksheet 5 part A: write the station state machine in CODESYS; test normal, timeout and emergency-stop casesTest results for every state
14 M5Modbus and automation inside the droneRead the Modbus and in-drone automation sections; run Example 2; take the module 5 quizRegisters, function codes and relays in ArduPilotWorksheet 5 part B: read registers over Modbus TCP and command DO_SET_RELAY in SITLRegister readout and SITL log
15 M5Industrial robots and mini-project presentationsRead the industrial robots and design section; run Example 3; prepare the station system diagramThe five design questions and arm capacityPresent the battery-swap station design, demonstrate the program and answer safety questionsMini-project (design, program and presentation), scored with the rubric

Worksheets and instructor guide

One worksheet per module. Students open it on the web, print it or download the .docx. The instructor guide under each worksheet gives the class timing, expected results, discussion questions and notes for students with different backgrounds.

1Worksheet 1 Identifying automation components around you
Analysis activity · About 6 h of class time · CLO1, CLO3

Objective: Break down automated systems, classify open and closed loops and place devices on ISA-95 levels

Equipment

  • Computer with Python
  • Example code at /downloads/uat-202/
  • Paper or diagramming software

Safety

  • Desk work and observation; do not touch powered equipment

Steps

  1. Choose three automated systems, e.g. an automatic door, a washing machine and a drone in Loiter
  2. List sensor, controller, actuator, process and disturbance for each
  3. State whether each is open or closed loop, with reasons
  4. Run Example 1, varying load and gain; record speed under load
  5. Draw the battery-swap station and mark each device's ISA-95 level
  6. State the automation level of each step and where people must decide

Deliverables

  • Component table for three systems
  • Results table from Example 1
  • Station diagram with ISA-95 levels and human decision points

Checklist

  • Table 1 has all three systems, each with sensor, controller, actuator, process and disturbance, and a reason for open or closed loop (System design and communication)
  • Table 2 has at least 6 runs including Kp = 0, every value has a unit, and the error column is 0.5 m/s minus the speed after loading (Device wiring, measurement and test evidence)
  • The Example 1 code with the changed load and Kp is attached and runs, and the table values are copied from its printed output (Correctness of control logic and programs)
  • The station diagram marks the ISA-95 level of every device, the emergency stop button and the points where a person must decide (Safety in design and practice)

Instructor guide

Class timing 360 min

  1. Objectives, review of the sense, decide, act loop and desk-work safety30 min
  2. Break down three everyday systems and fill in Table 190 min
  3. Run Example 1, vary load and Kp, fill in Table 275 min
  4. Draw the battery-swap station and mark ISA-95 levels105 min
  5. Mark automation levels and human decision points; fill in Table 330 min
  6. Wrap-up, questions and hand-in checklist30 min

Expected results

  1. Record: Table 1 Components of three automated systemsTable 1: for example, a drone in Loiter has sensors (IMU, GNSS, barometer), the flight controller, actuators (motors and propellers), position and attitude as the process, and wind as the disturbance; it is closed loop because it measures position and corrects the command. The automatic door and washing machine can be answered either way if the reasoning is right: the test is whether the system measures the result it controls, so a step that runs on a set timer without measuring whether the clothes are clean is open loop. A weak answer says every computer-controlled system is closed loop.
  2. Record: Table 2 Results from Example 1, the conveyor under extra loadTable 2 (the Example 1 model gives the same values on every computer): before the load every case is 0.500 m/s; load 0.1: Kp 0 gives 0.400 (e 0.100), Kp 8 gives 0.467 (e 0.033), Kp 20 gives 0.483 (e 0.017), Kp 40 gives 0.491 m/s (e 0.009); load 0.2: Kp 0 gives 0.300 (e 0.200), Kp 8 gives 0.433 (e 0.067), Kp 20 gives 0.467 (e 0.033), Kp 40 gives 0.482 m/s (e 0.018). Accept ±0.001 m/s for rounding.
  3. Record: Table 3 Devices and steps of the battery-swap stationTable 3: conveyor and batteries at level 0; sensors, gripper valve and fan at level 1; PLC and control screen at level 2; the fleet mission-scheduling system comparable to level 3; business planning (ERP) at level 4 if the group includes it. Human decision points include at least starting a flight mission and inspecting before leaving a fault or after an emergency stop, while conveying and gripping batteries can be automatic.
  4. Question 1: From Table 2, why does the open loop slow to 0.4 m/s while feedback stays near 0.5 m/s? How does the remaining error change as Kp rises, and why should Kp not be raised indefinitely?The open loop does not measure speed, so it does not know it slowed and keeps 2.0 V, while feedback adds Kp × e to the command; for example Kp 8 with e 0.033 m/s adds about 0.27 V (2.27 V). The error shrinks as Kp rises (0.033 to 0.009 m/s at load 0.1) but never reaches zero, because some error must remain to produce the extra command; the PI controller of module 4 removes it. A strong answer adds that too high a Kp can make the system oscillate.
  5. Question 2: Pick one system in Table 1 that your group classed as open loop. What sensor would you add to close the loop, and which disturbance could the system then handle?A strong answer: a wash step on a timer is open loop; adding a sensor that measures water cloudiness and washing until the water is clear lets the system handle clothes of different dirtiness. The answer must name the measured quantity, what uses the measurement and which disturbance it handles; naming a sensor without linking it to a disturbance is incomplete.
  6. Question 3: In the battery-swap station, which step should keep a human decision, and what could happen if the system decided everything itself when it fails?The steps that should keep a human decision are starting a flight mission and restarting after a fault. If the system decided everything, a failed sensor or a battery not fully seated could let a drone take off when it is not ready. A strong answer links to the lesson's point that the level of automation depends on the consequences of failure and that people must understand enough to take over.
  7. Question 4: For the drone in Loiter mode that your group analysed, which parts act as sensor, controller and actuator, and which ISA-95 level is the fleet mission-scheduling system comparable to?Sensors are the IMU, GNSS and barometer, the controller is the flight controller, and the actuators are the motors (through the ESCs) and propellers; wind is the disturbance the feedback loop must correct. The fleet mission-scheduling system is comparable to level 3, as in the lesson. A strong answer notes that the decision to start a mission still belongs to the pilot.

Discussion questions

  • Is every computer-controlled system closed loop? Give an everyday example that contradicts this belief.
  • If the battery-swap station ran fully by itself, who should be responsible when a drone takes off with a battery that is not seated?

Adapting to student background

Upper secondary (M.6)
Have them derive the steady state v = (0.5 + 0.125Kp − load)/(1 + 0.25Kp) from the code before running it and predict Table 2 first; pair them with a peer who has wired or repaired real equipment when analysing everyday systems.
Vocational certificate
Start from real equipment they know, such as the building's automatic door, and have them point to each part before writing it down; hand out Example 1 with the lines to edit already marked, and read the error as lost speed.
Diploma
Extension: add random noise to the measured speed in Example 1, see how much a high Kp makes the voltage command jump, and propose a usable Kp.

Common student mistakes: Common mistakes in the module 1 lesson

2Worksheet 2 Testing sensors and actuators on the training rig
Lab · About 6 h of class time · CLO1

Objective: Test presence sensors, wire PNP/NPN correctly, measure a 4–20 mA loop and drive a pneumatic actuator

Equipment

  • PLC training rig with 24 VDC supply
  • Inductive, capacitive and photoelectric sensors
  • 4–20 mA calibrator or multimeter
  • Solenoid valve, pneumatic cylinder and compressor
  • Metal, plastic and battery-box test pieces

Safety

  • Power off before connecting or removing any wire; the lecturer checks before power-up
  • Wear safety glasses with compressed air and vent pressure before removing hoses
  • Keep hands and cables clear of the cylinder stroke

Steps

  1. Test the three sensors on the three test pieces and record detection distances
  2. Read sensor and input-module labels; identify PNP/NPN and sinking/sourcing
  3. Power off, wire to the diagram, have the lecturer check, then power up and test
  4. Measure the loop at 4, 12 and 20 mA and check with Example 1
  5. Disconnect one signal wire, observe the reading and check the program flags a fault
  6. Drive the solenoid valve, time the cylinder stroke and state whether it is single or double acting

Deliverables

  • Detection-range table
  • Checked wiring diagram
  • mA versus scaled-value table and broken-wire result
  • Cylinder stroke-time record

Checklist

  • Table 1 has all 9 cells (3 sensors × 3 test pieces) in mm, with "not detected" written where nothing was detected (Device wiring, measurement and test evidence)
  • The wiring diagram carries the lecturer's signature from the check before power-up and shows PNP/NPN and sinking/sourcing matching the labels (Safety in design and practice)
  • Table 2 has rows for 4, 12 and 20 mA and the broken wire, and the broken-wire row shows a fault message, not a temperature (Correctness of control logic and programs)
  • Table 3 has at least 3 runs and records that air was vented before every hose was removed (Safety in design and practice)
  • The answer to question 1 chooses a sensor for all three jobs, with reasons from Table 1 (System design and communication)

Instructor guide

Class timing 360 min

  1. Safety briefing: power off before wiring, safety glasses and venting air30 min
  2. Test the three sensors on three test pieces; fill in Table 175 min
  3. Read labels, wire up, lecturer check, then power-up test75 min
  4. Measure the 4–20 mA loop and test a broken wire; fill in Table 275 min
  5. Drive the solenoid valve and time the cylinder; fill in Table 360 min
  6. Wrap-up, questions and hand-in checklist45 min

Expected results

  1. Record: Table 1 Detection distance of each sensor and test pieceTable 1: the inductive sensor detects only the metal piece, so the plastic piece and plastic battery box must read "not detected" (a box with metal parts may be detected on that side only). The capacitive sensor detects all three, and the photoelectric sensor detects whatever blocks or reflects its light. Distances in mm depend on the model: compare them with the sensing distance on the label or datasheet of the model used, which the measured value should not exceed. The lesson gives no distance figures.
  2. Record: Table 2 The 4–20 mA loop of the 0–100 °C temperature transmitterTable 2 (0–100 °C transmitter as in Example 1): 4 mA = 0.0 °C, 12 mA = 50.0 °C, 20 mA = 100.0 °C. If the calibrator is off by ±0.1 mA the temperature is off by about ±0.6 °C (0.1/16 × 100). The broken-wire row should read about 0 mA, which is at or below 3.6 mA, so the program must show "fault: low" rather than a negative temperature. Extra points if chosen: 8.8 mA = 30.0 °C, and 3.8 mA computes as −1.3 °C but must warn to check the sensor.
  3. Record: Table 3 Pneumatic cylinder stroke timesTable 3: times depend on the rig's cylinder, air pressure and valve, and the lesson gives no figures. What matters is that repeated runs at the same pressure give similar times. A single-acting cylinder has one air port and returns by spring when the valve closes; a double-acting cylinder has two ports and uses air both to extend and to retract.
  4. Question 1: From Table 1, which sensors detected the plastic battery box and which did not? Explain by working principle, then choose a sensor for three station jobs: the metal gripper arm, the battery box and the drone on the landing pad.The inductive sensor misses the plastic box because its electromagnetic field detects only metal; the capacitive sensor detects it because its electrostatic field detects metal and non-metal. As in the lesson: the metal gripper arm uses an inductive sensor, the battery box a capacitive sensor and the drone on the pad a photoelectric sensor. A strong answer cites the group's own Table 1.
  5. Question 2: When the signal wire was disconnected, what current did you read and what did the program show? Why does this signal start at 4 mA rather than 0 mA, and what should the station do when it sees such a reading?A broken wire gives about 0 mA (at or below 3.6 mA), so the program must report a fault rather than a temperature. The signal starts at 4 mA (live zero) so that a true zero can be told from a broken wire. The station must go to a safe state, such as stopping charging, and call a person to inspect.
  6. Question 3: If a PNP sensor were wired to a sourcing input module, what would happen when it detects an object? Explain using the direction of current.A PNP sensor connects the signal wire to the positive supply, so current flows out of it and it needs a sinking input that takes current in. A sourcing input also pushes current out, so no current flows through the input and the PLC sees no signal even though the sensor works (its own indicator may still light). Check the manuals of both the sensor and the input module.
  7. Question 4: The charging cabinet's 230 V AC fan draws 6 A. Under the team's 1.25 margin, may the Omron MK-S relay, rated 10 A resistive and 7 A inductive, switch it? Why?No. The fan is an inductive load, so it is checked against the 7 A rating, not 10 A, and 6 × 1.25 = 7.5 A exceeds 7 A; choose a relay or contactor with a higher rating. A strong answer explains that the magnetic energy in the coil makes an arc as the contacts open, which is why the inductive rating is lower.

Discussion questions

  • If a sensor works and its own indicator lights but the PLC sees nothing, in what order would you look for the cause?
  • Why would the station choose a 4–20 mA current signal over a voltage signal on long cables?
  • Which station task should use a servo rather than a stepper, and how would you know a stepper had lost steps?

Adapting to student background

Upper secondary (M.6)
Have them work out Table 2 with x = x_min + (I − 4)/16 × (x_max − x_min) before measuring, and draw PNP and NPN current directions on paper before wiring; pair them with a hands-on peer for wiring and the multimeter.
Vocational certificate
Let them wire and test the real parts first and explain the principle from what they saw; hand out a partly filled mA to °C table and have them check it with the Example 1 code.
Diploma
Extension: design the MK-S relay connection with a flyback diode so the PLC switches the 230 V AC fan, and draw a start–stop latching circuit with relay contacts; the lecturer checks the drawing, and no 230 V is wired.

Common student mistakes: Common mistakes in the module 2 lesson

3Worksheet 3 Programming the conveyor PLC
Lab · About 6 h of class time · CLO2

Objective: Write and test LD and ST PLC programs with an emergency stop and timer, and explain scan-cycle effects

Equipment

  • Computer with CODESYS Development System and a simulated PLC
  • Python and the module 3 example code
  • PLC training rig if available

Safety

  • Mostly simulation
  • If testing on a real rig, confirm E-STOP cuts the outputs before starting the conveyor

Steps

  1. Create a CODESYS project with a simulated PLC
  2. Write the start–stop circuit with E-STOP in LD as in Figure 2
  3. Test five cases: press START, release START, press STOP, E-STOP while running, reset E-STOP
  4. Add a 1.0 s TON for the arm and compare with Example 1
  5. Write the same logic in ST and compare readability
  6. Shorten the button press in Example 1 below the scan time and explain the result

Deliverables

  • LD and ST project files
  • Five-case test table with results
  • Explanation of the short-press result

Checklist

  • Table 1 has all 6 cases, including pressing START again after resetting E-STOP, and both LD and ST match the expected results (Correctness of control logic and programs)
  • In Table 2 the gripper timing in CODESYS matches Example 1 within one scan cycle (0.1 s) (Device wiring, measurement and test evidence)
  • If a real rig was used, there is a record that E-STOP was shown to cut the outputs before the conveyor started, and STOP and E-STOP are NC contacts in the program (Safety in design and practice)
  • Record 3 explains the result using the scan cycle and the actual times tried, and compares LD with ST on at least two points (System design and communication)

Instructor guide

Class timing 360 min

  1. Objectives, review of the PLC scan cycle and emergency stop safety20 min
  2. Create the CODESYS project with a simulated PLC40 min
  3. Write the start–stop circuit in LD and test it with Table 1100 min
  4. Add the gripper TON and compare with Example 1; fill in Table 270 min
  5. Write the same logic in ST and retest70 min
  6. Short-press trial, wrap-up and hand-in checklist60 min

Expected results

  1. Record: Table 1 Testing the start–stop circuit with E-STOPTable 1: press START, motor on; release START, motor stays on because the M contact holds it (seal-in); press STOP, motor off; E-STOP while running, motor off at once; release E-STOP, motor stays off; press START again, motor on. LD and ST must agree in every row; a motor that runs only while START is held means the seal-in is missing.
  2. Record: Table 2 The 1.0 s gripper TON compared with Example 1Table 2 (Example 1, 0.1 s scan): motor on at 0.5 s; battery arrives at 2.0 s and the gripper closes at 2.9 s (1.0 s counted on the tenth scan); E-STOP at 4.0 s turns motor and gripper off; START at 6.0 s turns the motor on; from 6.5 to 7.0 s the battery is present only 0.5 s, so the gripper stays open; STOP at 8.0 s turns the motor off. CODESYS may differ by up to one scan (±0.1 s) depending on the task cycle set in the project.
  3. Record: Record 3 The effect of a press shorter than the scan cycle, and LD compared with STRecord 3: a press shorter than the scan that falls between two input reads is never seen. In Example 1, a START press from 0.52 to 0.57 s (0.05 s) does not start the motor at 0.5 s, and it first starts at 6.0 s; a press that spans a read, such as 0.48 to 0.53 s, is still seen, so the result depends on timing. LD versus ST: LD looks like a relay circuit and is easy for electricians to read, while ST is shorter and handles complex conditions and calculations more easily.
  4. Question 1: In Table 1, did the motor restart by itself after E-STOP was released? Which part of the logic causes this, and why does safety require it?No. The seal-in needs START or M to be true; once E-STOP has made M false, releasing E-STOP alone cannot make M true again, so START must be pressed. This matches the ISO 13850 principle in the lesson that a machine must not restart by itself when the emergency stop is released. A strong answer adds that real systems need certified safety devices, not an ordinary PLC program alone.
  5. Question 2: Between 6.5 and 7.0 s the battery is on the belt but the gripper does not close. Why, and how would the result change with a 0.4 s TON?The battery is present only 0.5 s, short of 1.0 s continuously, so the TON never completes and resets when its input drops. With a 0.4 s TON the gripper would close at 6.8 s and open when the battery leaves at 7.0 s, and in the first window it would close earlier, at 2.3 s (simulated from Example 1). A strong answer notes that a shorter preset filters bouncing signals less.
  6. Question 3: From Record 3, what happens with a press shorter than the scan cycle? With a 0.1 s scan, what is the approximate worst-case response, and how should buttons or signals be designed?A signal shorter than the scan may not be seen at all. The worst-case response is about two scans, 2 × 0.1 = 0.2 s. Signals should last several scans, or use an input that captures short pulses (such as an interrupt, if the PLC model has one). A strong answer uses the group's own trial times.
  7. Question 4: Why are STOP and E-STOP wired normally closed (NC)? What would happen with a broken wire if they were wired normally open?Wired NC, a broken wire opens the circuit and the machine stops by itself, which is safe. Wired NO, a broken wire means pressing stop sends no signal to the PLC, so the machine cannot be stopped, and nobody knows until it is needed.

Discussion questions

  • If two rungs write the same output, what happens, and how would you find this mistake in a long program?
  • Which station tasks suit LD, and which suit ST or SFC?

Adapting to student background

Upper secondary (M.6)
Have them write the truth table of M = (START ∨ M) ∧ STOP_NC ∧ ESTOP_NC before programming, and trace the first three scans of Example 1 by hand to see read, execute and write.
Vocational certificate
Start from the familiar relay seal-in circuit and convert it to LD contact by contact; get LD passing every case first, and let them edit ST from a prepared template.
Diploma
Extension: test on the real PLC rig after the lecturer checks the E-STOP, and add a rung that counts passing batteries with a counter, with their own test cases.

Common student mistakes: Common mistakes in the module 3 lesson

4Worksheet 4 Tuning a temperature controller
Lab · About 6 h of class time · CLO2, CLO3

Objective: Compare ON/OFF, P and PI control, test windup and choose a controller for the charging cabinet

Equipment

  • Python and the module 4 example code
  • Temperature-sensor and fan rig via PLC or microcontroller (if available)

Safety

  • Mainly simulation
  • With a real rig, keep clear of fan blades and heat sources and stay below the lecturer's temperature limit

Steps

  1. Run Example 1 with hysteresis of ±0.2 and ±1.0 °C; record switching count and band
  2. Set P gain Kp to 0.6 and 1.2; record steady-state error and explain why it does not vanish
  3. Remove the line that stops I accumulation; start from a 45 °C cabinet and compare with anti-windup
  4. With a rig, implement ON/OFF with hysteresis on a real fan and record the graph
  5. Conclude which controller the charging cabinet should use, with reasons

Deliverables

  • Tables and graphs comparing ON/OFF, P and PI
  • Graphs with and without anti-windup
  • Controller recommendation for the cabinet

Checklist

  • Every row of Tables 1 to 3 comes from the group's own runs with units, and Table 1 covers ±0.2, ±0.5 and ±1.0 °C (Device wiring, measurement and test evidence)
  • The edited code is attached, the line removed for the windup trial is marked, and the code runs (Correctness of control logic and programs)
  • Every graph has axis names, units and the 30 °C target line (System design and communication)
  • The recommendation includes a safety limit, such as cutting charging on overheat, and with a real rig records that the lecturer's temperature limit was never exceeded (Safety in design and practice)

Instructor guide

Class timing 360 min

  1. Objectives, review of the cabinet model and rig safety20 min
  2. Run ON/OFF with three hysteresis bands; fill in Table 170 min
  3. Run P with three Kp values and PI; fill in Table 270 min
  4. Windup trial from a 45 °C cabinet; fill in Table 380 min
  5. Real rig: ON/OFF with a temperature sensor and fan (without a rig, use the time to plot and compare the simulations)80 min
  6. Controller recommendation, questions and hand-in checklist40 min

Expected results

  1. Record: Table 1 ON/OFF control with different hysteresis bandsTable 1 (Example 1 model, cabinet starting at 32 °C, one hour simulated): ±0.2 °C oscillates 29.79–30.21 °C with 127 fan switches; ±0.5 °C, 29.50–30.51 °C with 52 switches (as in the lesson); ±1.0 °C, 28.99–31.01 °C with 27 switches. The same code must give these values. On a real rig a swing slightly wider than the band is normal, because the sensor and the cabinet air respond slowly.
  2. Record: Table 2 P and PI controllersTable 2: P with Kp 0.3 settles at 31.68 °C (error 1.68 °C, u 0.505), Kp 0.6 at 30.86 °C (error 0.86 °C, u 0.519), Kp 1.2 at 30.44 °C (error 0.44 °C, u 0.526); PI settles at 30.00 °C (error 0, u 0.533). Check with the heat balance T = (Q + 600Kp × 30 + h × Ta)/(600Kp + h), with Q = 300 W, h = 10 W/K, Ta = 32 °C. Accept ±0.01 °C.
  3. Record: Table 3 PI from a 45 °C cabinet, with and without anti-windupTable 3 (Kp 0.3, Ki 0.002 as in Example 1, starting at 45 °C): with anti-windup it reaches 30 °C at 15.2 min, dips to 29.66 °C and holds 30.00 °C over the last 20 min; without it, it reaches 30 °C at 14.3 min but cools to 20.56 °C (at about 28 min) and still swings 29.70–33.42 °C over the last 20 min. Accept ±0.1 min and ±0.05 °C.
  4. Question 1: From Table 1, how do narrow and wide hysteresis bands trade temperature accuracy against fan wear? Which band suits the charging cabinet?A narrow band (±0.2 °C) holds the temperature tighter but switches the fan 127 times an hour; a wide band (±1.0 °C) needs only 27 switches but swings 2 °C. A strong answer picks a middle band such as ±0.5 °C, or argues that the batteries tolerate a 1–2 °C swing, and never uses ON/OFF without hysteresis.
  5. Question 2: From Table 2, the steady-state error shrinks as Kp rises but never vanishes. Why, judging by the fan command u that is needed? Why can PI bring it to zero?The cabinet needs about u = 0.53 to sit exactly at 30 °C. A P controller makes its command only from the error (u = Kp × e), so some error must remain to give u near 0.5; for example Kp 0.6 needs 0.86 °C. A higher Kp needs less error but never zero, and too high a Kp risks oscillation. The I term accumulates error until it supplies the needed u by itself, even with zero error.
  6. Question 3: From Table 3, explain integral windup using your own numbers: why does the unprotected version overcool and keep oscillating?Starting at 45 °C the fan is already at full (u = 1) but it is still hot, so the I term keeps accumulating with no effect. When the cabinet reaches 30 °C, the excess still drives the fan hard, so it cools to about 20.6 °C, then overheats past the target and still swings 29.70–33.42 °C after 40 minutes. The version that pauses accumulation while saturated dips only to 29.66 °C. A strong answer uses the group's numbers and explains that the fix is to stop accumulating while the command is saturated.
  7. Question 4: Recommend a controller for the charging cabinet with reasons from your results, and name the safety limit needed in addition to the controller.A strong answer: PI with anti-windup, because it has no steady-state error, does not oscillate and does not switch the fan often; D is not needed because temperature changes slowly and D is sensitive to noise (if the fan cannot vary its speed, use ON/OFF with hysteresis). A safety limit separate from the controller is also required, such as cutting charging on overheat and when the temperature sensor signal fails (module 2).
  8. Question 5: How does a drone flight controller use the same principle, and why does PX4 limit the I term in its rate loop?The flight controller uses the same PID feedback, only much faster, holding attitude hundreds of times a second. When the motors hit their limits (the command saturates), the I term winds up just as in the cabinet, making the drone overshoot or oscillate afterwards, so PX4 limits the I term in its rate loop.

Discussion questions

  • What happens on a real system with a slow sensor if Kp keeps rising, and can the Example 1 model show this?
  • Why should a real system never be tuned without safety limits? Give an example of the damage possible in a lithium battery charging cabinet.

Adapting to student background

Upper secondary (M.6)
Have them solve the P steady state from the balance Q − P_max u − h(T − Ta) = 0 by hand before running and compare with Table 2, linking the I term to the area under the graph in the review section.
Vocational certificate
Focus on the real rig: let them see the fan switch with temperature first, then change one number at a time in the code from a prepared table; explain P and I by analogy, P presses the accelerator by how far short you are, I keeps pressing harder while you are still short.
Diploma
Extension: implement PI with anti-windup on the rig's PLC or microcontroller, drive the fan speed with PWM, and compare its graph with ON/OFF within the lecturer's temperature limit.

Common student mistakes: Common mistakes in the module 4 lesson

5Worksheet 5 Designing the battery-swap station
Lab · About 6 h of class time · CLO2, CLO3

Objective: Design the station sequence as a state machine, link devices with Modbus TCP, command a drone relay and draw the overall system

Equipment

  • CODESYS with a simulated PLC and Modbus TCP server
  • Computer on the lab's internal network
  • ArduPilot SITL and a mission planner
  • Python and the module 5 example code

Safety

  • Simulation and internal network only; no real flights
  • Expose Modbus only on the lab network because the protocol has no authentication

Steps

  1. Write the state machine in SFC or ST as in Figure 1 with a timeout for each state
  2. Test normal, timeout in every state and emergency stop; compare with Example 1
  3. Start the Modbus TCP server and read registers from a PC program; check against Example 2
  4. Configure a relay in SITL, command DO_SET_RELAY in a mission and check the log
  5. Compute arm capacity with Example 4
  6. Draw how drone, station and mission system communicate and where emergency stops are needed

Deliverables

  • State-machine program and test table
  • Register readout and SITL log
  • Capacity calculation
  • System diagram with emergency-stop points

Checklist

  • Table 1 has the normal case, a timeout in all four timed states (LOCK, SWAP, CHECK, RELEASE) and an emergency stop, and every case passes (Correctness of control logic and programs)
  • Table 2 has the 12 request bytes matching Example 2, both register values, and the relay state before and after the command from the log (Device wiring, measurement and test evidence)
  • It states that Modbus TCP ran only on the lab's internal network and that no real flight or fitted propellers were used during relay tests (Safety in design and practice)
  • The system diagram shows how drone, station and mission system communicate, with emergency-stop points, and Record 3 shows every calculation step with units (System design and communication)

Instructor guide

Class timing 360 min

  1. Objectives, network safety and simulation-only testing20 min
  2. Write the state machine in SFC or ST with a timeout for every state90 min
  3. Test normal, timeout and emergency-stop cases; fill in Table 160 min
  4. Start the Modbus TCP server and read registers; fill in Table 260 min
  5. Configure a relay in SITL, command DO_SET_RELAY and check the log60 min
  6. Capacity calculation, system diagram, wrap-up and hand-in checklist70 min

Expected results

  1. Record: Table 1 Testing the station state machineTable 1 (timeouts as in Example 1: LOCK 5, SWAP 20, CHECK 5, RELEASE 5 s): normal case landed 0, locked 2, swapped 15, voltage_ok 17, released 19 s ends in IDLE; LOCK timeout (locked at 6 s) gives FAULT at 6 s; SWAP timeout (swapped at 30 s) gives FAULT at 30 s; CHECK timeout (voltage_ok at 21 s) gives FAULT at 21 s; RELEASE timeout (released at 23 s) gives FAULT at 23 s; an emergency stop at 10 s during SWAP gives FAULT at once. FAULT must hold until a person resets it. Groups using other event times may get other results as long as they follow the timeout rules.
  2. Record: Table 2 Modbus TCP register readout and relay state in SITLTable 2: the request to read 2 holding registers from address 0 on device 1 must be 00 01 00 00 00 06 01 03 00 00 00 02 (12 bytes, sent to TCP port 502). Both register values must match what the CODESYS program wrote, such as station status and the number of ready batteries, which depend on the group's program. The relay state in the log must change at the DO_SET_RELAY item in the mission.
  3. Record: Record 3 Arm capacity calculation (Example 4) and notes on the system diagramRecord 3 (Example 4 assumed values: 6 drones, 20-minute sorties, steps 20 + 25 + 25 + 15 + 10 s): a 95 s cycle gives 3600/95 = 37.9, about 38 swaps an hour; demand is 6 × 60/20 = 18 swaps an hour, so arm utilisation is 18 × 95/3600 = 47.5% (about 48%); at no more than 80% one station serves at most 10 drones (0.8 × 3600/95 × 20/60 = 10.1, rounded down to 10, which uses 79.2%). The diagram should show the drone talking to the mission system over its control link, and the mission system querying the station PLC over Modbus TCP on the internal network.
  4. Question 1: Why must the FAULT state not exit automatically, and what should a person check before the station resumes?FAULT means something went wrong whose cause the system does not know, such as a jammed gripper or a battery not seated; exiting by itself could let a drone take off with an unlocked battery. Before resetting, a person should check why it timed out, the battery position and voltage, the gripper and clamps, and that nobody is inside the working area.
  5. Question 2: Classic Modbus has no authentication. What could a stranger on the PLC's network do, and how does your group's setup prevent it?With no authentication or encryption, anyone on the same network can send read or write commands to coils and registers, for example moving the gripper or setting the station status to ready when it is not. A strong answer says the group ran Modbus only on the lab's access-controlled internal network, never on the internet, and mentions OPC UA, which has security built in, as an alternative.
  6. Question 3: From Record 3, how many drones can one station serve at no more than 80% arm utilisation? How many if the self-test grows to 30 s?At the original values one station serves 10 drones. With a 30 s self-test the cycle becomes 110 s, capacity 3600/110 = 32.7 swaps an hour, and 0.8 × 3600/110 × 20/60 = 8.7, rounded down to 8 drones; with 6 drones the arm is busy 55.0%. A strong answer rounds the drone count down, not up.
  7. Question 4: In the system diagram, where are emergency stops needed, and why can a DO_SET_RELAY command from the drone not replace the station's emergency stop?Emergency stops belong at the station (cutting the arm, conveyor and air) wherever people can reach the working area, and in the mission system's control room. A DO_SET_RELAY command is a message over a link and ordinary software, which can drop or be delayed, while an emergency stop must cut power by itself under ISO 13850 principles, using certified safety devices.

Discussion questions

  • If the mission system sends a drone for a battery swap while the station is in FAULT, how should the two systems be designed to know about each other?
  • Why must a flight controller's inner loop be tuned stable before the outer loop, and where does this resemble the station design?

Adapting to student background

Upper secondary (M.6)
Have them write the full transition table (current state, event, next state) before programming and explain each field of the Modbus request byte by byte; pair them with a tool-savvy peer when setting up SITL.
Vocational certificate
Let them run Examples 1 and 2 first and change event times one at a time before writing SFC in CODESYS; hand out a system-diagram template with drone, station and mission-system boxes, to which they add the links and emergency-stop points.
Diploma
Extension: write a PC program that reads the station status over Modbus every second and sends the SITL drone to land only when the station is ready, then test the case where the station enters FAULT while the drone is on its way.

Common student mistakes: Common mistakes in the module 5 lesson

Scoring rubric

For worksheets and the mini-project. Each criterion scores level (1–4) ÷ 4 × weight.

CriterionWeightExcellent (4)Good (3)Fair (2)Needs work (1)
Correctness of control logic and programs30%Programs pass every test case including timeouts and faults; scan behaviour explainedAll main cases pass; some edge cases missingWorks in some cases; logic errors presentProgram does not work or was not tested
Device wiring, measurement and test evidence25%Correct wiring first time; measurements match calculations; complete tables and graphsCorrect after minor fixes; data nearly completeNeeded much help or data partly missingWrong wiring type or no evidence
Safety in design and practice20%Emergency stops and safe states everywhere; always follows power and air isolation stepsNearly completeKey points missing or steps sometimes skippedSafety not considered
System design and communication25%Clear diagrams and report; choices tied to measurements; precise answers to questionsClear with minor flawsHard to follow or reasons partly missingDesign not communicated

Assessment map: CLOs and how they are assessed Draft

The CLOs are a web-team draft; the course owner sets the final ones (curriculum book, part 4). This table is built from the worksheet and module-quiz data, so it follows any change to the CLOs.

CLOWorksheetsModule quizzes
CLO1 Explain automation components: sensors, controllers and actuatorsW 1W 2M1M2
CLO2 Design basic control logic with PLCs or microcontrollersW 3W 4W 5M3M4M5
CLO3 Relate industrial automation to UASW 1W 4W 5M1M4M5