Teaching pack · UAT 463
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.
Coverage of the course description
The lessons fully teach 12 of 12 description topics. Each topic lists the modules and lesson sections that teach it, and incomplete topics say what is missing.
| Description topic | Modules | Where it is taught | Status |
|---|---|---|---|
| Components and operating principles of smart robotics and automation | M3M4M5 | Module 3: nested loops on one joint · Module 4: the ROS 2 architecture of MM-1 · Module 5: the integration architecture of the cell (the components are taught through the MM-1 case, from the joint up to the cell) | Covered |
| Sensors | M1M4 | Module 1: the perception pipeline and its latency budget · reading a tag's pose with PnP · separating a parcel from the conveyor in a point cloud · Module 4: from the motor shaft to numbers: encoder, gyro and driver | Covered |
| Actuators and drive systems | M3M4 | Module 3: actuators and drive systems: choosing the motor and gear ratio from the load (Example 6 the shoulder, Example 7 the base drive wheels) · Module 4: from the motor shaft to numbers: encoder, gyro and driver | Covered |
| Control systems | M3 | Module 3: identify the joint model with a step test · sampling period and encoder resolution · cascaded position loop and integral windup · torque-level control: dynamic model and computed torque | Covered |
| Embedded systems | M4 | Module 4: embedded controllers in the robot: dividing real-time work between the MCU and the computer (Example 8 the Liu-Layland bound and response times) · from the motor shaft to numbers: encoder, gyro and driver · buses: CAN, Modbus RTU and EtherCAT (MCU programming and peripherals are prerequisite knowledge) | Covered |
| Environmental perception | M1 | Module 1: the perception pipeline and its latency budget · reading a tag's pose with PnP · separating a parcel from the conveyor in a point cloud · from camera to hand: calibration and localization | Covered |
| Inter-system communication | M4M5 | Module 4: QoS: compatibility and command timeout · tf2 and time: look up the transform at the capture time · buses: CAN, Modbus RTU and EtherCAT · Module 5: PLC-robot handshake: check every reachable state · OPC UA: supervisory data and data volume | Covered |
| Motion planning and autonomous control | M2M3 | Module 2: from state machines to behavior trees · deciding under uncertainty: cost-based thresholds · planning an arm motion in configuration space · timing the motion under joint limits · Module 3: cascaded position loop and integral windup · torque-level control: dynamic model and computed torque | Covered |
| Integration of ground robots with unmanned aircraft systems | M1M2M3M4M5 | Module 3: closing the loop on a moving pad: landing on the MM-1 base (Example 8 base-speed feedforward, timing and data age) · Module 4: bridging MAVLink and ROS 2: what flows between the drone and MM-1 (Example 9 ENU versus NED frames and link load) · Module 5: ground robots and drones: the interface and the conditions before approaching (Example 6) · Module 1: reading a tag's pose with PnP (the tag on the landing pad) · Module 2: from state machines to behavior trees (the behavior tree for the battery swap) | Covered |
| Design and prototyping of automated systems | M5 | Module 5: prototype development and proving that it meets the requirements (a requirements table traced to its means of proof) · the module labs of Modules 4 and 5 | Covered |
| Testing and performance evaluation | M1M4M5 | Module 5: MES indicators: the OEE of the cell · prototype development and proving that it meets the requirements (Example 5 how many trials prove R1) · Module 1: the perception pipeline and its latency budget (p99 of the latency) · Module 4: executors and callback groups: is the control loop blocked? | Covered |
| Applications to industrial and service environments | M5 | Module 5: industrial and service work: the ISO 8373 definitions and fleet size (Example 7) · service-robot case study: a medicine-delivery robot on a hospital ward (Example 8 speed zones, stopping and throughput, human-aware navigation) · MES indicators: the OEE of the cell · safety of the cell: scope of the standards and first calculations | Covered |
Weekly teaching plan
| Week | Topic | Pre-class | Lecture | Lab | Evidence |
|---|---|---|---|---|---|
| 1 M1 | The perception pipeline and its latency budget | Read module 1 'Why this matters' and 'The perception pipeline and its latency budget'; run Example 1 | The battery-swap cell case, the stages of the pipeline, timestamps and latency compensation | Worksheet 1 steps 1 and 2: set up the camera and tags; measure the latency of each stage with timestamps | Table of mean latency and standard deviation before and after compensation |
| 2 M1 | Reading a tag's pose with PnP | Read 'Reading a tag's pose with PnP'; run Example 2 | AprilTag, PnP, pose ambiguity, and depth error that grows with the square of range | Worksheet 1 step 3: image the tag at 0.3, 0.6 and 1.2 m; find the RMS depth error with solvePnP | RMS-by-range table compared with the formula and the reference measurement |
| 3 M1 | Point clouds, calibration and the error budget | Read 'Separating a parcel from the conveyor in a point cloud' and 'From camera to hand'; run Examples 3 to 5; take the module 1 quiz | RANSAC, calibration by SVD, FRE versus TRE, and coarse-to-fine localization | Worksheet 1 steps 4 and 5: find the belt plane with RANSAC; calibrate camera to arm base with 12 points and test with 5 independent points | Worksheet 1 report with FRE, TRE and the error budget to the battery bay, and the quiz result |
| 4 M2 | Behavior trees | Read module 2 'From state machines to behavior trees'; run Example 1 | Sequence, Fallback, Retry and the closed forms of success probability and mean time | Worksheet 2 steps 1 and 2: build the battery-swap tree, measure p and t of each leaf, then choose the retry count | Closed-form versus simulation table, and the reason for the retry count |
| 5 M2 | Cost-based decision thresholds | Read 'Deciding under uncertainty: cost-based thresholds'; run Example 2 | TPR, FPR, the cost of a wrong pick versus a skip, and the threshold that minimises cost | Worksheet 2 step 3: collect 200 detector scores, compute TPR and FPR, then find the minimum-cost threshold | Cost-versus-threshold plot and the chosen threshold |
| 6 M2 | Joint-space planning and timing | Read 'Planning an arm motion in configuration space' and 'Timing the motion under joint limits'; run Examples 3 and 4; take the module 2 quiz | C-space, A* on a joint grid, shortcutting and the trapezoidal profile | Worksheet 2 steps 4 and 5: build the C-space map, search with A*, then compute and measure the time of each segment | Worksheet 2 report with the cycle time of one battery swap, and the quiz result |
| 7 M3 | Identifying the joint model and tuning the PI | Read module 3 'Nested loops on one joint' and 'Identify the joint model with a step test'; run Example 1 | The FOPDT model, the SIMC rule and adding Ts/2 to the delay | Worksheet 3 steps 1 and 2: open-loop step test, fit an FOPDT curve, then tune the PI at two values of tau_c | K, tau, theta and a table of rise time, overshoot and command ripple |
| 8 M3 | Sampling period and the position loop | Read 'Sampling period and encoder resolution' and 'Cascaded position loop and integral windup'; run Examples 2 and 3 | The speed step Q/Ts, the added delay, an outer gain no more than a fifth of the inner bandwidth, and anti-windup | Worksheet 3 steps 3 and 4: a table for at least three sampling periods, and a blocked-joint test with and without anti-windup | Sampling-period table and the peak speed after release in both cases |
| 9 M3 | Arm dynamics and computed torque; midterm | Read 'Torque-level control: dynamic model and computed torque'; run Examples 4 and 5; take the module 3 quiz; review modules 1 to 3 | Midterm examination (modules 1 to 3) | Worksheet 3 step 5: build the arm model, check it with a free swing, then compare controllers when the parcel mass is known and unknown | Worksheet 3 report with the controller error table, and the quiz result and the midterm score |
| 10 M4 | The node graph and executors | Read module 4 'The ROS 2 architecture of MM-1' and 'Executors and callback groups'; run Example 1 | node, topic, service, action, the mutually exclusive default group and timers that skip periods | Worksheet 4 steps 1 and 2: write the node graph, set QoS and measure the 100 Hz timer when the groups are separated | Node graph, QoS check and timer-timing table |
| 11 M4 | tf2, QoS, life cycle and sensor interfaces | Read 'tf2 and time', 'QoS', 'Node life cycle and ros2_control' and 'From the motor shaft to numbers'; run Examples 2 to 6 | interpolation at the stamp, cmd_vel_timeout, the life cycle, quadrature decoding, gyro bias and PWM ripple | Worksheet 4 steps 3 to 6: look up tf2 at the stamp, set cmd_vel_timeout, test the life cycle, and decode the encoder while measuring gyro bias | Table of tf2 lookup-policy error, a table of needless stops, and the encoder count results |
| 12 M4 | Bus load and integrating the software chain | Read 'Buses: CAN, Modbus RTU and EtherCAT'; run Example 7; take the module 4 quiz | worst-case CAN frame time and response time, Modbus RTU timing, and EtherCAT processing on the fly | Worksheet 4 step 7: calculate the CAN load of all joints of the test arm and compare it with the load measured by an analyser | Worksheet 4 report with calculated versus measured bus load, and the quiz result |
| 13 M5 | Integration architecture and the PLC handshake | Read module 5 'The integration architecture of the cell' and 'PLC-robot handshake'; run Example 1 | ISA-95 levels, kinds of link, safety functions as a separate loop, and exploring every state | Worksheet 5 steps 1 and 2: write the interface table for three seams, adapt the handshake model and run the state exploration | Interface table and state-exploration result with any counterexample |
| 14 M5 | OPC UA, OEE and safety | Read 'OPC UA', 'MES indicators' and 'Safety of the cell'; run Examples 2 to 4 | deadband and publishing interval, A, E, QR and OEE, the scope of ISO 10218 and ISO 3691-4, stopping distance and PFHd | Worksheet 5 steps 3 to 5: set up an OPC UA subscription, calculate the OEE of the simulated cell and measure the base's stopping time and distance | Deadband table, OEE result, and stopping time and distance with the constants that must come from the standard |
| 15 M5 | Proving the prototype and mini-project presentations | Read 'Prototype development and proving that it meets the requirements'; run Example 5; take the module 5 quiz; prepare the mini-project report | The requirements table and traceability, TRL, the Clopper-Pearson lower bound and the test-trial plan | Worksheet 5 step 6, and the mini-project presentation or practical exam of the MM-1 cell to a panel (role-play) | Mini-project report and presentation scored with the rubric; the practical exam concludes this week |
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 The MM-1 perception pipeline from image to pick point
Lab · About 12 h of class time · CLO1, CLO2
Objective: Measure the latency and error of the perception pipeline and make the error budget from camera to battery bay
Equipment
- Wrist camera and depth camera above a mock conveyor
- Square tags of known size and the camera intrinsics
- A test arm or a simulator that provides forward kinematics
- Computer with Python and the example code at /downloads/uat-463/
Safety
- Arm and mock conveyor work is in a guarded area with an emergency stop within reach
- Keep the arm slow during calibration and stay out of its reach
- Comparison and calculation work is desk work
Steps
- Set up the camera and tags; record the true tag size and the camera intrinsics
- Measure the latency of each stage with timestamps, enter it in Example 1, and find the share within tolerance before and after compensation
- Image the tag at 0.3, 0.6 and 1.2 m, 100 images each; find the RMS depth error with solvePnP and compare with the formula
- Collect a belt point cloud with one parcel; find the plane with RANSAC and compare with least squares; report the parcel height and centre
- Calibrate the camera to the arm base with 12 points and touch 5 unused test points; report FRE and TRE and conclude whether the error budget meets the limit
Deliverables
- Latency table before and after compensation
- Table of depth RMS error by range
- RANSAC versus least-squares result
- FRE, TRE and the error budget to the battery bay
Checklist
- Table 1 has all 5 stages with mean, standard deviation and a total row, every cell in ms
- Table 2 has all 3 ranges with 100 images each and a formula value on every row
- Table 3 reports FRE from the 12 calibration points and TRE from the 5 unused test points, clearly separated
- Any assumed or lesson-borrowed value (such as the FK error) is marked in the How it was obtained column
- Runnable code for Example 1 and the error-budget calculation is attached
Instructor guide
Class timing
- Objectives, guarded area, emergency stop and low arm speed30 min
- Mount cameras and tags, record tag size and intrinsics90 min
- Measure stage latency and run Example 1120 min
- Image the tag at 3 ranges and find RMS with solvePnP150 min
- Capture the point cloud and fit the plane with RANSAC and least squares120 min
- Calibrate camera to arm base, measure FRE and TRE, build the error budget150 min
- Wrap-up, questions and hand-in checklist60 min
Expected results
- Table 1: if the pipeline is close to Example 1 of the lesson (12, 6, 48, 9, 4 ms), the total mean is about 79 ms, the combined standard deviation about 6.4 ms and p99 about 94 ms, with detection the longest stage. Real lab values may be about 50 to 150 ms depending on the computer. At a belt speed of 0.20 m/s the uncompensated error is 0.20 × 79 = 15.8 mm.
- Table 2: the formula σz ≈ 0.5 z²/(f s) with f = 900 px and an 80 mm tag gives 0.62, 2.50 and 10.0 mm at 0.3, 0.6 and 1.2 m (Example 2 simulated 0.62, 2.44 and 10.34 mm). If the lab camera or tag differs, put the real f and s into the formula. Measured values are often 1 to 2 times the formula because of camera calibration and lighting. Lateral error should be several times smaller than depth error (about 0.14 to 0.6 mm).
- Table 3 (using the simulated data of Examples 3 and 4 as reference): RANSAC normal error 0.011 degrees, least squares 3.27 degrees, about 77% inliers, parcel height 100 mm (accept ±3 mm), centre error 1.5 mm by median and 3.5 mm by mean. FRE with 12 points about 2.4 mm and TRE about 1.3 mm when each point is measured to 1.5 mm per axis. Fine-stage budget √(0.15² + 1.3² + 0.3²) = 1.34 mm per axis; fused with the 13.3 mm coarse stage it stays 1.34 mm and meets 3 mm about 95% of the time.
- Without compensation almost 0% is within limit (mean error 15.8 mm); with it about 100% (mean 0.41 mm, p99 1.32 mm in the example). Detection at 48 ms takes the longest. A strong answer explains that knowing the data age lets you predict the present position with x + v(t_now - t_stamp), leaving only belt speed variation and clock offset, whereas halving detection time would still leave about 10 mm of error.
- About 4 times (2.50 to 10.0 mm by formula, or 2.44 to 10.34 mm in simulation), as z² predicts, because the tag looks smaller in the image with range. A strong answer concludes that getting closer is cheaper than a better camera and uses the tag for fine alignment below about 0.4 m (the team's choice in the lesson), judged by where the group's own depth RMS falls below about 1 mm.
- Least squares uses every point, so the parcel top and dust points pull the plane into a tilt. RANSAC keeps the plane with the most points within the threshold and refits it to those only. The median resists stray points that happen to sit in the height window, while the mean is dragged by them. A strong answer suggests clustering to remove stray points before computing the grasp point.
- FRE is measured at the calibration points and looks better than reality; TRE is measured at independent points and must be used to judge. In Example 4, going from 4 to 24 points raises FRE from 1.80 to 2.49 mm while TRE falls from 3.92 to 0.92 mm. With a TRE of about 1.3 mm per axis the fine budget is 1.34 mm and meets 3 mm about 95% of the time; with about 2.2 mm (only 6 points) the budget becomes about 2.25 mm and passes much less often. Invest first in the camera calibration (more points spread over the workspace), not the LiDAR, because the 5.7 mm sideways error from 0.5 degrees of heading at 650 mm is already removed by the fine stage.
Discussion questions
- If the belt often speeds up and slows down, is timestamp compensation still enough, and what else would you need to know?
- Why does reporting the uncertainty with every perception result matter for the robot's decisions in the next module?
- Which part of the error budget is cheaper to absorb mechanically than in software, for example with a lead-in chamfer at the battery bay?
Adapting to student background
- Upper secondary (M.6)
- Have them compute e = vτ and σz by hand before measuring and predict the 1.2 m result before imaging; pair them with a peer who is confident mounting cameras and arms.
- Vocational certificate
- Give fill-in tables for latency and the error budget, let them use the example code changing only measured numbers, and explain RANSAC by drawing three random points on paper first.
- Diploma
- Extension: repeat the calibration with 6 and 24 points, compare TRE with Example 4, and sketch a lead-in at the battery bay that absorbs the remaining error.
2Worksheet 2 MM-1 decision making and planning in the simulator
Lab · About 12 h of class time · CLO1, CLO2
Objective: Build the behavior tree, set the cost-based threshold, plan the arm in joint space and compute the motion time
Equipment
- Simulator of the MM-1 two-joint arm or a test arm
- A behavior-tree library or the classes of Example 1
- Detector scores for at least 200 images with true labels
- Computer with Python and the example code at /downloads/uat-463/
Safety
- The work is desk work in the simulator
- If testing on a real arm, use a guarded area and low speed first
- Never run a path that has not been collision-checked on a real arm
Steps
- Build the battery-swap behavior tree; measure p and t of each leaf from 30 real runs; compute the closed form against simulation
- Compare 1 to 4 retries using the measured recovery cost, then choose a count with a reason
- Collect detector scores; compute TPR and FPR at several thresholds; set the costs of a wrong pick and a skip; find the minimum-cost threshold
- Make a C-space map at 2 degree resolution, search with A*, and compare with a straight line in joint space
- Compute each segment time from the arm's limits, run it in the simulator, compare with measured time and report the cycle time of one battery swap
Deliverables
- Closed-form versus simulation table and the chosen retry count
- Cost-versus-threshold plot and the chosen threshold
- C-space map and the A* path
- Table of segment times and the cycle time
Checklist
- Table 1 has all 8 leaves, each from 30 real simulator runs, not the lesson values
- Closed form versus simulation is shown for 1 to 4 retries, with the measured recovery cost in s
- Table 2 has at least 6 thresholds and states the wrong-pick and skip costs used
- The C-space map checks collisions along the links with a margin, not only at the hand
- The C-space map, the A* path and runnable code are attached
Instructor guide
Class timing
- Objectives and the rule against running unchecked paths on a real arm30 min
- Build the behavior tree and run it 30 times to measure p and t150 min
- Closed form and the 1 to 4 retry comparison90 min
- Collect detector scores and find the minimum-cost threshold150 min
- Build the C-space map and search with A*150 min
- Compute and measure segment times120 min
- Wrap-up, questions and hand-in checklist30 min
Expected results
- Table 1: p depends on the simulator. Close to the assumed values of Example 1 you get detect tag 0.97 (0.4 s), relocalize by LiDAR 0.90 (2.0 s), move to pre-grasp 0.99 (3.0 s), grasp old pack 0.85 (2.5 s), extract 0.98 (1.5 s), place in rack 0.99 (3.0 s), take fresh pack 0.97 (2.5 s), insert 0.88 (3.0 s). From 30 runs each p is uncertain by about ±0.06 to 0.1, so the success count must be reported too.
- Table 2: with scores like Example 2 (real parcels N(0.80, 0.12), non-parcels N(0.50, 0.15), 80% real, wrong pick 40 s, skip 6 s): at 0.50 TPR 0.994, FPR 0.500, cost 4.03 s; at 0.65 0.894, 0.159, 1.78 s; at 0.68 0.841, 0.115, 1.68 s (the minimum); at 0.90 0.202, 0.004, 3.86 s. Real data from 200 images gives a stepped curve and the minimum may move by ±0.05.
- Table 3: with the limits of Example 4 (joint 1 100 deg/s and 200 deg/s², joint 2 150 deg/s and 300 deg/s²) and the waypoints of Example 3, segment 1 (-27, +45 deg) takes 0.775 s and segment 2 (-17, +19 deg) 0.583 s, both triangles, 1.358 s in total. The long swing (-120, +60 deg) takes 1.700 s as a trapezoid. Simulator times should exceed the computed ones by no more than about 10 to 20% because of the controller period and settling.
- With the values of Example 1 and a 120 s recovery: 1, 2, 3, 4 retries give success 0.6948, 0.8949, 0.9242, 0.9282, mean time 14.05, 15.96, 16.25, 16.29 s, and cost including recovery 50.67, 28.57, 25.35, 24.90 s. The fourth retry adds little because the ceiling is set by the steps that are not retried (their product is about 0.93). A strong answer chooses 3 and adds a reason beyond the numbers, such as the risk of repeatedly grasping something already damaged.
- In the example the minimum is about 0.68, about 0.18 above 0.5, and matches the posterior threshold 40/(40 + 6) = 0.870 (the sweep gives 0.684, equal to the Bayes threshold). If a wrong pick cost twice as much the threshold would rise, because the robot must be more certain before grasping. A strong answer stresses that the threshold is a business decision to recalculate whenever the costs or the share of real parcels change.
- In Example 3 the straight line collides at 62 of 201 checked points and the collision region covers 32.8% of C-space; the A* path after shortcutting is 78.0 degrees against 77.7 degrees for the straight line (only 0.3 degrees more). The group's result depends on its obstacle and on the 2 degree grid, which is coarser than the example. A strong answer sets a margin at least as large as the hand error from module 1 (about 3 mm) plus the gripper size and checks collisions along the links.
- The joint that must turn most relative to its limits sets the pace; in segment 1 of the example joint 2 reaches its 300 deg/s² limit first. Both short segments are triangles because they never reach full speed (v² > a). Measured times are longer because of the control period, the lag of the joint controller and the tolerance for arriving. A strong answer suggests blending segments without stopping and stresses that the blended trajectory must be collision-checked again.
Discussion questions
- When is retrying the wrong fix, and what kind of fallback should the behavior tree have instead?
- Who should set the costs of a wrong pick and a skip in a real factory, the engineer or the user?
- Would the C-space grid with A* still work for a six-joint arm, and why?
Adapting to student background
- Upper secondary (M.6)
- Have them compute the closed form of the tree by hand for one retry before coding and predict the shape of the cost curve before sweeping; give extra time with the simulator.
- Vocational certificate
- Start by running the simulator and counting real successes, then multiply probabilities step by step in a fill-in table; read the minimum from a ready-made cost plot instead of writing the formula themselves.
- Diploma
- Extension: add a fallback branch when grasping fails (for example relocalize before grasping), compute its effect on success and time, and try blending segments without stopping, re-checking for collision.
3Worksheet 3 Tune and test an MM-1 joint
Lab · About 12 h of class time · CLO2
Objective: Identify the joint model, tune the PI, choose the sampling period, test anti-windup and compare controllers on the two-joint arm
Equipment
- A test joint with motor, driver and encoder, or a simulator
- Power supply with current limiting
- A mechanical stop for the blocked-joint test
- Computer with Python and the example code at /downloads/uat-463/
Safety
- Limit the supply current and voltage before every test and keep a cut-off switch within reach
- Keep loose clothing and cables away from the rotating shaft and use a guard
- Test blocking at low voltage and low speed first; never block a turning shaft by hand
Steps
- Apply an open-loop voltage step of 30 to 50% of maximum, fit an FOPDT curve, and report K, tau and theta
- Compute theta_eff and tune the PI by SIMC at tau_c equal to 1 and 3 times theta_eff; command a speed and record rise time, overshoot and command ripple
- Try at least three sampling periods, make a table like Example 2, and choose a period citing the speed step Q/Ts
- Add the cascaded position loop, block the joint with the mechanical stop, compare with and without anti-windup, and report peak speed and overshoot
- Build the dynamic model of the two-joint arm, check it with a free swing, then compare PD, PD with gravity and computed torque when the parcel mass is known and unknown
Deliverables
- K, tau and theta compared with Example 1
- Sampling-period table and the reason for the choice
- Anti-windup comparison result
- Error table of the three controllers
Checklist
- Table 1 has K, τ, θ, θ_eff, Kc and τI for both τc values with units, and the data with the fitted curve is plotted
- Table 2 has at least 3 sampling periods, each with measured rise time, overshoot and ripple
- Table 3 compares with and without anti-windup under the same blocking and records the supply current limit used
- The dynamic model is checked with a free swing and the energy change is reported before using it in computed torque
- Runnable code and raw data are attached
Instructor guide
Class timing
- Objectives, current and voltage limits, shaft guard and cut-off switch45 min
- Open-loop step test and FOPDT fit120 min
- SIMC PI tuning and speed command tests150 min
- Sampling-period trials and Table 2120 min
- Cascaded position loop and blocked-joint test135 min
- Dynamic model and controller comparison on the two-joint arm120 min
- Wrap-up, questions and hand-in checklist30 min
Expected results
- Table 1: if the joint is close to the model of Example 1 (6 V step, 1 ms period) you get K = 19.91 (rad/s)/V, τ = 8.93 ms, θ = 1.11 ms, θ_eff = 1.61 ms; at τc = θ_eff, Kc = 0.139 V per rad/s and τI = 8.93 ms; at 3θ_eff, Kc = 0.070 and τI = 8.93 ms. A real loaded joint will have a much larger τ (the lesson estimates about 35 ms for the shoulder at G = 100). Accept any values whose curve matches the data (residual RMS below about 2% of the steady speed).
- Table 2: in Example 2 (encoder of 4,096 counts per turn) Q/Ts = 6.14, 3.07, 1.53, 0.77, 0.31, 0.15 rad/s at Ts = 0.25, 0.5, 1, 2, 5, 10 ms, command ripple 0.731, 0.300, 0.079, 0.029, 0.005, 0.001 V, rise times 5.5 to 7.5 ms for Ts up to 2 ms and 15 to 20 ms with 10 to 15% overshoot for Ts of 5 to 10 ms. The group's trend must be the same: short periods ripple, long periods are slow and overshoot.
- Table 3: Example 3 (3 rad move, Kp = 30 per second, 150 rad/s limit): free 75.2 rad/s, 0.02% overshoot, settled at 127 ms; blocked with anti-windup 94.8 rad/s, 0.02%, 341 ms; blocked without 237.5 rad/s, 298.6%, 531 ms. Example 5 max error joint 1/2: PD 1.53/1.31 deg, PD with gravity 0.23/0.20 deg, computed torque with the exact model 0.002/0.003 deg, without the parcel 0.45/3.37 deg. A real test joint at low voltage gives smaller numbers, but the surge without anti-windup must be clearly visible.
- In the example K matches physics closely (19.91 against 19.90), but τ is 8.93 ms against 9.55 ms, because the physics formula ignores the electrical lag L/R = 0.67 ms, which the FOPDT model folds into θ. Group values far from the example usually come from the load and friction of the real joint. A strong answer says the gains must come from your own measurement, never borrowed from another machine.
- For a 100 rad/s step: at τc = θ_eff the first command is 0.139 × 100 = 13.9 V, above the 12 V limit, so the driver saturates at once; at 3θ_eff it is 0.070 × 100 = 7.0 V, within the limit, at the cost of a slower rise from 7 to 11 ms. A strong answer chooses 3θ_eff or limits the step size and explains that closed-loop speed trades against control effort and robustness.
- The lesson chooses Ts = 1 ms because a speed step of 1.53 rad/s is 1.5% of the 100 rad/s working speed and the ripple is only 0.079 V, whereas 0.25 ms gives a 6.14 rad/s step and 0.73 V of ripple. A strong answer concludes that a faster loop needs a finer encoder, not just a shorter period.
- The integral keeps accumulating while the voltage is saturated (313 of 1,500 steps in the example). On release this stored value commands full voltage for a long time, so the inner PI ignores the limited speed command from the outer loop; speed reaches 237.5 rad/s, above 150 rad/s, and the shaft turns about 12 rad instead of 3. A strong answer concludes that anti-windup is needed wherever there is a limit and that actual speed must be monitored by a device separate from the working controller (module 5).
- The model without the parcel cancels the dynamics wrongly, so the missing torque must come from the stiffness of the error loop alone. Stiffness M̃22 ω² = 0.049 × 25² = 30.6 N m/rad; the gravity torque of a 0.5 kg parcel at the hand with the forearm horizontal is 0.5 × 9.81 × 0.35 = 1.72 N m; the error is about 1.72/30.6 = 0.056 rad = 3.2 degrees, close to the simulated 3.37 degrees and worse than PD (1.31 degrees). A strong answer proposes telling the controller the parcel mass, for example from a weighing station through the PLC.
Discussion questions
- Why does tuning from the inside out matter, and what happens if you tune the position loop before the speed loop?
- In real work, who should own a speed limit that serves as protection, the robot's controller or a safety device?
- When is PD with a gravity term enough, and when is computed torque worth the effort?
Adapting to student background
- Upper secondary (M.6)
- Have them substitute into the SIMC formula by hand and compute the first voltage command before testing; a peer who is confident with wiring and supplies helps set the current limit.
- Vocational certificate
- Focus on wiring, setting the current limit and reading K, τ and θ off the step plot with a ruler first, then confirm with the curve-fitting code; give a fill-in table for SIMC.
- Diploma
- Extension: repeat the step test on the loaded joint, compare τ with the estimate from inertia referred through the gear (J_r + J_L/G²), and retune the speed loop.
4Worksheet 4 Assemble the software chain and interfaces of MM-1
Lab · About 12 h of class time · CLO2
Objective: Write the node graph, check timing, tf2, QoS and the life cycle, decode the encoder and calculate the bus load
Equipment
- Computer or board with ROS 2 installed
- Camera and test wheel base, or a simulator
- Encoder, gyro and driver of the test joint
- CAN adapter and a bus analyser
Safety
- Lift the wheel base so the wheels are off the ground, or use a guarded area, when testing cmd_vel_timeout and pulling the network cable
- Switch off the driver power before connecting or removing the CAN adapter and encoder cable
- Calculation and node-graph work is desk work
Steps
- Write the node graph of the cell, set the QoS of each topic and check compatibility with ros2 topic info --verbose
- Measure the 100 Hz timer when it shares a group with the detection callback, then separate the group and thread
- Stamp images at exposure and look up the transform at that time with tf2, compared with the latest pose
- Set cmd_vel_timeout to at least three values, count needless stops and measure the stopping distance when the network cable is pulled
- Test the driver node's life cycle: unplug the CAN adapter, activate, and look at the state it returns to
- Decode the encoder in hardware, check the one-turn count and the counter wrap, measure gyro bias for 5 s and report the heading error after 60 s
- Calculate the CAN load of all joints with the code of Example 7 and compare it with the load measured by the analyser
Deliverables
- Node graph and QoS check
- Timer timing, tf2 error and needless-stop tables
- Encoder counting results and the heading error
- Calculated versus measured bus load table
Checklist
- Table 1 has both the shared-group and separate-group setups and both tf2 policies, latest pose and lookup at the stamp
- Table 2 has at least 3 timeouts, stopping distances measured in a guarded area or with wheels lifted, and a calculated value on every row
- Table 3 records one deliberately mismatched QoS pair and the state the driver node returns to when the CAN adapter is unplugged
- One-turn count, counter wrap and gyro bias all have units
- The node graph of the cell with the QoS of every topic is attached
Instructor guide
Class timing
- Objectives, lifted wheels or guarded area, power off before wiring30 min
- Write the node graph and check QoS90 min
- Measure timer timing with shared and separate groups120 min
- Test tf2 lookup at the stamp against the latest pose90 min
- Test cmd_vel_timeout and the driver node life cycle120 min
- Encoder decoding, counter wrap and gyro bias150 min
- Calculate and measure the CAN load90 min
- Wrap-up, questions and hand-in checklist30 min
Expected results
- Table 1: with a 100 Hz timer taking 0.5 ms and 48 ms image detection as in Example 1, a single group (one or two threads) gives about 20.5 Hz with a longest gap of about 48.5 ms; separate groups give 100 Hz with a 10 ms gap. On real hardware accept 95 to 100 Hz with gaps up to about 12 ms. For tf2 as in Example 2 (base on a curve at 0.30 m/s, image 79 ms late) the latest pose is off by 41.6 mm on average; lookup at the stamp gives 0.57, 0.19 and 0.13 mm at tf rates of 10, 20 and 50 Hz. A ruler measurement will not resolve below about 1 to 2 mm.
- Table 2: calculated stopping distance s = v T_o + v²/(2a) at 0.5 m/s and 1.0 m/s² braking is 0.155, 0.175, 0.225 and 0.375 m for timeouts of 60, 100, 200 and 500 ms. Needless stops in the simulated data of Example 3 are 20,749, 132, 9 and 0 per hour; real values depend on the lab network. Measured stopping distance should be within about ±0.05 m of the calculation; if much larger, check the base's real deceleration.
- Table 3: a sensor-data camera (best effort) with a default detector (reliable) does not connect; a driver that fails to activate returns to Unconfigured; a 1,024-line encoder decoded x4 counts 4,096 per turn (-4,096 backward); at 100 rad/s it counts 65,190 per second and the 16-bit counter wraps 4 to 5 times in 5 s; the circular difference from 65,500 to 120 is 156; gyro bias as in Example 6 is about 0.20 deg/s; CAN load at 1 Mbit/s, 2 ms, 8 bytes is about 81.7% (Example 7). The lab's gyro and encoder may differ, so take expected values from the formulas with the real parameters.
- The default group is mutually exclusive, so two callbacks may not run at once and the second thread has nothing to do; both setups therefore give the same numbers (about 20.5 Hz, 48.5 ms gap). Moving the camera into its own group restores 100 Hz. A strong answer concludes that heavy work must be separated from the control loop by group and thread, and that strict real time also needs thread priorities.
- In Example 2 the latest pose is off by 41.6 mm while lookup at the stamp at 10 Hz is off by 0.57 mm, about 70 times better. Raising tf from 10 to 50 Hz only reduces 0.57 to 0.13 mm, whereas the nearest sample before the stamp without interpolation is still 26.6 to 5.2 mm off. A strong answer says what matters is stamping at exposure and looking up at that time, with a deep enough buffer and a timeout for the newest transform to arrive.
- The lesson chooses 200 ms: fewer than 10 needless stops an hour and a 0.225 m stopping distance. Values close to the 50 ms period stop very often; long values lengthen the stopping distance after a real loss. This distance must be shorter than the detection range of the protective field calculated in module 5, plus a margin. A strong answer stresses recalculating with real network data from the cell.
- In Example 5 a direct subtraction makes the speed jump to about -100,431 rad/s at every wrap, so the PI would command full voltage at once. The circular difference ((new - old + 32,768) mod 65,536) - 32,768 gives 99.7 to 101.2 rad/s and works while the change per read stays below 32,768 counts. A 0.20 deg/s bias gives a heading error of 0.20 × 60 = 12.0 degrees after 60 s; subtracting the bias from the first 5 s leaves about 0.03 degrees (random walk 0.05 √(60/200) = 0.027 degrees).
- The calculation uses the worst case (55 + 10s bits per frame including bit stuffing), so the measured load is often lower because real stuffing is less, or higher if other messages share the bus; a difference of about 5 to 15% is reasonable. Six joints at 1 ms (12 command and feedback messages of 8 bytes) load the bus about 163%, which is impossible; stretch to 2 ms (81.7%, worst response 1.820 ms), send less data, or use EtherCAT (18.5 µs per cycle).
Discussion questions
- If some faults give no clear warning, such as incompatible QoS, what checks should the team set up from the start?
- Which work in the cell belongs on the microcontroller and which on the ROS 2 computer, and why?
- How does the node life cycle make start-up safer, and where is it still not enough?
Adapting to student background
- Upper secondary (M.6)
- Have them draw the callback timeline on paper to predict the shared-group result and compute stopping distance and the circular difference by hand; pair them with a peer confident wiring the encoder and CAN.
- Vocational certificate
- Start by wiring the encoder and turning it by hand to count one turn, then use prepared ROS 2 commands; give a fill-in table for the CAN load instead of writing the formula.
- Diploma
- Extension: measure the CAN load after adding diagnostic messages for every joint and propose a new identifier priority order so the emergency-stop message still responds in time.
5Worksheet 5 Integrate, check and verify the MM-1 cell
Lab · About 12 h of class time · CLO3, CLO2
Objective: Make the interface table, check the handshake, set up OPC UA, calculate OEE and stopping distance, and plan the verification of the prototype's requirements
Equipment
- A PLC or PLC simulator and a test OPC UA server
- The simulated cell or a test wheel base
- Production data records of the simulated cell for one shift
- Computer with Python and the example code at /downloads/uat-463/
Safety
- Safety functions of the cell must be separately wired devices checked by a specialist; never use this exercise's handshake signals in their place
- Measure the base's stopping distance in a guarded area, starting at low speed with nobody within stopping distance
- The interface table, OEE and test plan are desk work
Steps
- Write the interface table for three seams and mark the signals that are safety functions needing a separate loop
- Adapt the handshake model to the cell, run the state exploration, and fix the logic until no violation is found
- Set up an OPC UA subscription, try at least three deadbands, measure notifications per minute and the largest error, and choose with a reason
- Calculate A, E, QR and OEE from one shift's records and propose one improvement with an estimate of its effect
- Measure real stopping time and distance at three speeds, compare with Example 4, and name the constants that must come from the real edition of a standard
- Write a table of at least 5 requirements, state how each is verified, plan the number of trials of the success-rate requirement with the code of Example 5, and report the first-round result with its lower bound
Deliverables
- Interface table with the safety signals marked
- State-exploration result of the handshake
- Deadband table and OEE result with the proposed improvement
- Requirements table, test plan and first-round result with the lower bound
Checklist
- Table 1 covers all three seams, every row says whether it is a safety function, and safety signals are on a separate wired loop
- No statement claims compliance with a standard, and the constants that must come from the real edition are named
- Table 2 has at least 3 deadbands, A, E, QR and OEE with the definition stated, and stopping at 3 speeds, all with units
- Table 3 has at least 5 requirements, each with a verification method, and the success-rate requirement has planned trials and a lower bound
- Runnable state-exploration code and Example 5 code are attached
Instructor guide
Class timing
- Objectives, separating safety functions, guarded area and low speed for stopping tests30 min
- Write the interface table for three seams120 min
- Adapt the handshake model and run the state exploration120 min
- Set up the OPC UA subscription and try deadbands90 min
- Calculate OEE from one shift's records90 min
- Measure stopping time and distance at three speeds120 min
- Write the requirements table and plan the number of trials120 min
- Wrap-up, questions and hand-in checklist30 min
Expected results
- Table 1: at least 9 rows across all three seams: MM-1 with the PLC (entry request, grant, alive signal, over direct I/O or Modbus every 10 ms), the PLC with the MES (PQ and GQ counters and machine states over OPC UA, about every 1 s), MM-1 with the MES (battery-swap work orders and task state over OPC UA). The emergency stop and light curtain must be marked as safety functions on a separate wired loop to the safety relay, not through ROS 2 or the handshake. At most one row wrong, and no safety signal in the wrong group.
- Table 2: belt-speed deadbands as in Example 2 of 0, 0.001, 0.003 and 0.010 m/s give 600, 377, 93 and 0.9 notifications per minute, with the largest error exactly the deadband (real data varies with noise, but the error must not exceed the deadband). OEE, if the records resemble Example 3 (3 retries): A = 0.641, E = 0.796, QR = 0.985, OEE = 0.503. Stopping as in Example 4 (0.150 s total reaction, 1.0 m/s² braking): 0.069, 0.200 and 0.650 m at 0.25, 0.5 and 1.0 m/s, with detection ranges of 0.219, 0.350 and 0.800 m. Measured distances should be within about ±20% of the calculation once the real device response times are used.
- Table 3: at least R1 to R5 of the lesson (success rate at least 0.90 at 90% confidence by test, hand error 3 mm by TRE at independent points, protective field by measuring real stopping, handshake by state exploration and HIL, 1 kHz loop not blocked by timing measurement). A zero-failure test needs 22 trials (ln 0.1/ln 0.9 = 21.85). A first round of 56 of 60 gives 0.933 with a one-sided 90% lower bound of 0.871, so it is not proved yet.
- As in Example 1, the latched version violates in 8 states even with a healthy link (128 when the link can freeze); the level version passes with a healthy link but violates in 72 states when it can freeze; the watchdog version shows no violation (917 states). The level counterexample: the door opens in exactly the step the robot starts moving, then the link freezes, so the robot keeps seeing the old grant and moves for 3 steps with the door open. A strong answer fixes it with an alive-signal watchdog, notes that the result holds only for the model and must be tested on the real system, and says the handshake coordinates production and is not a safety function with a PL.
- A strong answer chooses a deadband of about twice the noise, such as 0.003 m/s in the example, giving 93 notifications per minute, about 7.6 kB per minute and a largest error of 0.003 m/s that the MES can accept; 0.010 m/s sends almost nothing but can be 10 mm/s off. This data must not be used for picking because a 1 s publishing interval makes it up to 1 s old, during which the belt moves 200 mm; picking uses the direct sensors of module 1.
- In Example 3 the largest loss is availability (A = 0.641) from recovery time after failures. A strong answer states the definition used (QR does not count reworked items) and fixes a cause, for example cutting recovery from 120 to 60 s, which gives A of about 0.78 and OEE of about 0.61 (from 0.50), or reducing failures at the source such as the perception error of module 1, rather than adding retries, since a fourth retry adds only 0.012 to OEE.
- Stopping distance grows with the square of speed because of the v²/(2a) term: 1.0 m/s needs a 0.800 m detection range and 1.5 m/s needs 1.500 m. A longer measured distance usually comes from longer real sensor or drive response times than assumed, or braking below 1.0 m/s². A strong answer names constants such as the human approach speed and the distance method as coming from the edition of ISO 13855 in force, and does not claim compliance from this calculation.
- Not yet. The measured 56/60 = 0.933 looks above 0.90, but the one-sided 90% lower bound is 0.871, below 0.90; 58/60 would give 0.914 and pass. Options from the lesson: test about 620 trials (52 failures allowed) for an 80% chance of passing, improve the design so the true rate is higher, or discuss with the user a requirement that is tighter than necessary. A strong answer notes that a 22-trial zero-failure test passes only 17.7% of the time when the true rate is 0.9242.
Discussion questions
- If management asks to replace the safety relay with ROS 2 signals to save cost, how should the engineer respond?
- What does an unnecessarily tight requirement cost the project, and how should it be negotiated with the user?
- If this cell moved to a space the public walks through, what would need to be reassessed?
Adapting to student background
- Upper secondary (M.6)
- Have them compute OEE and stopping distance by hand from given data before using real data, read the counterexample step by step on paper, and let a peer confident with PLCs set up the simulator.
- Vocational certificate
- Start by walking the real cell and pointing out each signal before writing the interface table, use a fill-in table for A, E and QR, and run the state-exploration code changing only its parameters.
- Diploma
- Extension: test the fixed handshake on a real PLC in HIL while simulating a frozen link, and measure within how many steps the robot stops, compared with the state-exploration result.
Scoring rubric
For worksheets and the mini-project. Each criterion scores level (1–4) ÷ 4 × weight.
| Criterion | Weight | Excellent (4) | Good (3) | Fair (2) | Needs work (1) |
|---|---|---|---|---|---|
| Accuracy of calculations and models | 30% | Every number correct and reproducible with code, assumptions stated and models checked (for example by energy or state exploration) | Nearly all correct, method shown, but the model checks are incomplete | Some errors or missing steps, or assumptions not stated | Many errors or no method |
| Testing and measurement on the prototype or simulator | 25% | Measures everything in the worksheets with repeats and spread, compares with calculation and explains differences | Measures everything but without repeats or with little explanation of differences | Measurements incomplete or not compared with calculation | No measurements of their own |
| Integration and safety | 25% | A complete interface table, safety functions separated from production, the standards' scope stated correctly, and no constants claimed without checking the real standard | Complete interface table and safety separated, but a small error about the standards' scope | Incomplete table, or safety signals mixed with production signals | No separation of safety, or a claim of meeting a standard without evidence |
| Communication and reproducible reporting | 20% | A clear report with readable tables and plots, runnable code, correct references, and good answers to panel questions | A clear report but code or references incomplete | The report lacks key parts or is hard to follow | No report, or unable to explain their own work |
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.
| CLO | Worksheets | Module quizzes |
|---|---|---|
| CLO1 Explain the architecture of an intelligent robot: perception, localization, planning and decision making, motion control and the robot operating framework | W 1W 2 | M1M2M3M4 |
| CLO2 Develop and test a robot prototype that perceives, decides and controls its motion through ROS 2 and sensor and actuator interfaces | W 1W 2W 3W 4W 5 | M1M2M3M4M5 |
| CLO3 Integrate a robot with factory automation (PLC, OPC UA, MES) safely, following a prototype development process and safety standards | W 5 | M5 |