Test Procedures¶
Whilst we can't test every item in the kit, the majority of items are tested using the procedures below. These tests are optimised for use with our SR v4 kit testing jigs.
The output CSVs of these test scripts can be used to update the inventory, both the location of the item and the condition
field.
Brain Board¶
Here we are testing that the KCH power circuit and that the Pi can boot and execute robot code.
For this test you will need:
- A 12 volt power supply with adapter to Camcon.
- A USB stick
- An SD card flashed with the current robot image.
import csv
from pathlib import Path
import RPi.GPIO as GPIO
asset_file = Path("/proc/device-tree/hat/custom_0")
serial_file = Path("/sys/firmware/devicetree/base/serial-number")
results = {}
fieldnames = ['asset', 'passed', 'serial', 'kch_asset']
logfile = Path('tested_kchs.csv')
new_log = not logfile.exists()
with open(logfile, 'a', newline='') as csvfile:
output_writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
if new_log:
output_writer.writeheader()
try:
results['passed'] = False # default to failure
results['serial'] = serial_file.read_text().strip().strip('\0')
results['kch_asset'] = asset_file.read_text().strip()
GPIO.setmode(GPIO.BCM)
GPIO.setup([24, 10, 25, 27, 23, 22, 4, 18, 17], GPIO.OUT, initial=GPIO.HIGH)
results['passed'] = True
finally:
output_writer.writerow(results)
Test steps:
- Copy the above block of code into a file called
robot.py
. This should be the only file on the USB stick. - Insert the test SD card.
- Plug the USB stick into the Pi.
- Connect the 12V power supply to the brain board's Camcon connector.
- 3 Green LEDs on the Camcon end of the board will light.
- If they don't light immediately this board has failed, go to step 9.
- The 5 boot LEDs will light in order.
- If the first LED has not lit within 20 seconds this board has failed, go to step 9.
- If all 5 LEDs have not lit within approximately a minute this board has failed, go to step 9.
- The OK LED should then light a few colours before stabilising on green.
- If the LED stabilises on red this board has failed, go to step 9.
- If the LED has not lit within 20 seconds try replugging the USB stick. If it continues to not light this board has failed, go to step 9.
- The A, B & C LEDs should now all be lit white. If they are not this board has failed.
- Disconnect the board and remove the USB stick and SD card, making a separate pile for boards that failed.
- Repeat steps 2-9 for the next board.
- Copy the
tested_KCHs.txt
file off the USB stick. This is the KCH asset codes of all the passing brain boards. - Boards that failed then need to be manually inventoried.
Power Board¶
Here we are testing all outputs can be enabled and current sense is functioning. Additionally, we test the buzzer, LEDs and start button are functioning and finally we test both the software and hardware undervoltage protection.
For this test you will need:
- The power board testing jig, pictured below
- High current power supply (Dell DPS-750TB)
- USB controllable power supply (Tenma 72-2545)
- Power supply switcher
Note
While testing undervoltage, errors will be printed about failing to connect to the board. This is expected behaviour.
Test steps:
- Connect up the high current PSU and USB controlled PSU to the switcher circuit.
- Connect the switcher circuit to the test jig.
- Set the USB controlled PSU to 12V and 3A.
- Set all switches on the jig to up position.
- Set the on/off switch to on.
- Check that the battery cable has no exposed copper.
- Connect a USB cable to the board to test.
- Slide board into the jig from the top.
- Insert both sets of side plugs, ensuring they are fully inserted.
- Connect the board's XT60 connecter to the rear of the jig.
- Run the script and follow its instructions:
kit_test power_v4 --fw-ver 4.4.2 --test-uvlo --log power_testing.csv
- Remove board making a separate pile for boards that failed.
- Repeat steps 5-10 and follow the script's instructions for the next board.
Motor Board¶
Here we are testing the both motor outputs function and that the current sensing is functional.
For this test you will need:
- The motor board testing jig, pictured below
- A power supply capable of 12 volts at 3 amps
- 2x 4.7 Ohm power resistor with banana plugs
Test steps:
- Unplug the motors from the jig.
- Connect the 4.7 Ohm resistors with banana plugs in place of the motors.
- Connect jig to PSU using banana leads.
- Set the PSU to 12V and 3A.
- Connect a USB cable to the board to test.
- Slide board into the jig from the bottom.
- Run the script and follow its instructions:
kit_test motor_v4 --fw-ver 4.4.1 --log motor_testing.csv
- Remove board making a separate pile for boards that failed.
- Repeat steps 5-6 and follow the script's instructions for the next board.
Servo Board¶
Here we are testing that all servo outputs are functional. Note however, that unless a separate 5 volt power supply is connected to the third jig input, only the first 8 servos will move.
For this test you will need:
- The servo board testing jig, pictured below
- A power supply capable of 12 volts at 0.5 amps
Test steps:
- Connect jig to PSU using banana leads to the leftmost connections.
- Set the PSU to 12V and 0.5A.
- Connect a USB cable to the board to test.
- Slide board into the jig from the bottom.
- Rotate the levers on both sides to connect the servos.
- Run the script and follow its instructions:
kit_test servo_v4 --fw-ver 4.3 --log servo_testing.csv
- Remove board making a separate pile for boards that failed.
- Repeat steps 3-5 and follow the script's instructions for the next board.
Arduino¶
Here we are testing that all the pins on the Arduino are functional.
For this test you will need:
- The Arduino test shield
Test steps:
- Attach the test shield to the Arduino.
- Connect a USB cable to the Arduino.
- Run the script and follow its instructions:
kit_test arduino --log arduino_testing.csv
- Disconnect the Arduino making a separate pile for Arduinos that failed.
- Repeat steps 1-2 and follow the script's instructions for the next Arduino.
Camera¶
Here we are testing that the camera is accessible and can capture undistorted images.
For this test you will need:
- A printed test marker
Note
For SR2025 we also need to include the --collect-asset
option since we have not recorded currently recorded all the serial numbers of the cameras.
Test steps:
- Connect the webcam to the computer
- Run the script and follow its instructions:
kit_test camera --log camera_testing.csv
- Disconnect the camera making a separate pile for cameras that failed.
- Repeat step 1 and follow the script's instructions for the next camera
Batteries and Chargers¶
There are no automated tests for the batteries or chargers. However, these items need both testing and collation.
Prior to any testing, the batteries and chargers need to have their asset codes manually scanned so that the inventory can be updated.
Next the IMAX B6 Chargers are used to storage charge the batteries.
This will be the test for both the battery and the charger.
To access storage charge follow the competitor documentation except when reaching the "LiPo BALANCE" screen continue pressing Inc.
until the screen reads "LiPo STORAGE".
USB Cable Testing¶
As of SR2024, the vast majority of kit issues reported throughout the year and to the helpdesks are due to faulty USB cables. For SR2025's Kit Testing we are using a Treedix USB cable tester to try and reduce the number of faulty cables we give out.
Additional Notes¶
In order to run all the tests in parallel you would need more power supplies than we have. The brain board test can be performed using a power board and battery instead of the power supply. If so, make sure to use a power board which has passed its own testing.