UAT 462 Edge Artificial Intelligence for UAS

Worksheet 4 A real-time pipeline and sensors

Lab 12 hAssesses CLO3, CLO1

Objective

Measure the camera bandwidth, build a capture-to-result pipeline that time-stamps every stage, compare queue policies, compute the bus time budget of the sensors and estimate the clock offset to the flight controller

Equipment and materials

  • A USB or CSI camera and a target board
  • Sensors on at least two of the I2C, SPI or UART buses, and a logic analyser if available
  • A flight controller with propellers removed, or a simulator, and Python with the example code at /downloads/uat-462/

Safety

  • Test on the bench only; remove the propellers and make connections with no battery power
  • Take anti-static precautions when handling boards and camera cables; never plug or unplug a CSI camera cable while the board is powered
  • Do not record identifiable people

Steps

  1. Fix the camera mode, compute the bandwidth B = W H b f, then capture continuously for 5 minutes and count dropped frames
  2. Build a pipeline of capture, pre-process, inference and post-process with a time stamp at every stage
  3. Compare an unbounded FIFO with a one-slot queue that drops the old frame; record p50, p95, p99 and dropped frames; start measuring after warm-up
  4. If the tools support it, compare copying with zero-copy at the camera's highest resolution
  5. Compute the bus time budget of the group's sensors following Example 5 and compare real read times with the calculation
  6. Estimate the clock offset to the flight controller with TIMESYNC, compare one exchange with short-RTT exchanges, and compute the position error

Record of results

Table 1 Camera bandwidth and dropped frames
Camera mode (W x H, format, fps)Calculated B (MB/s)Link and usable capacityFrames expected in 5 minFrames droppedShare dropped (%)
Table 2 Latency by queue policy
Queue policy or methodFrames processedFrames dropped (%)p50 (ms)p95 (ms)p99 (ms)
Table 3 Bus time budget and clock offset
Sensor or itemBus and speedCalculatedMeasuredUnitWithin the limit?

Questions

  1. Check Little's law with the group's one-slot queue data: how many frames does throughput times mean time in the system give, does it match the count, and what does the value tell you?

  2. Why does the unbounded FIFO's latency keep growing in the group's run? Explain with the load (mean processing time divided by the frame interval), and say whether dropping frames loses evidence.

  3. From Table 3, which sensor should move to SPI or which UART baud rate should rise, and why? Why is the measured time usually longer than the calculation?

  4. How many centimetres does the group's estimated clock offset move the image position at the real flight speed, compared with the GSD? How much more if EOF time is used instead of SOE?

  5. If you used batching for the live camera in evidence mode, what batch size still keeps p95 within 100 ms, and what kind of work suits batching better?

Check before you hand in

What to hand in

  • Table of bandwidth and dropped frames
  • Table of p50, p95 and p99 latency for each queue policy
  • Table of the share of bus used, calculated and measured
  • Clock-offset estimate and position error

CLO3 Measure and report time, energy and temperature on real hardware, interface sensors, and plan safe deployment. CLO1 Explain the memory, bandwidth, latency and energy limits of edge AI and select a platform to match the mission. (CLOs are a web-team draft; the course owner sets the final ones.)

Instructors: answers and teaching notes for this worksheet are in the teaching pack