6 Testing Guide
6.1 RobotZero - Arduino Nano - 2024
This document describes five independent test programs designed to verify the proper functioning of different components in your line following robot. Each test is a separate project that must be uploaded individually to your Arduino Nano. This modular approach allows for focused testing of each component without interference from other systems.
IMPORTANT: Do not attempt to combine these tests into a single program. Each test should be uploaded separately to ensure accurate results.
6.1.1 Test Programs
6.1.1.1 Line Sensors Test
Purpose: Verify the proper functioning of the line sensors array.
Setup: 1. Upload the line-sensor-test
program to your Arduino Nano; 2. Open Serial Monitor (9600 baud); 3. Place your robot on a test surface with your line.
Test Procedure: 1. Move the robot slowly across the line; 2. The LED will blink briefly each time a sensor transitions from low to high; 3. The Serial Monitor will display which sensor detected the transition and its reading; 4. Test each sensor by ensuring the line crosses all sensors.
Expected Results: - LED should blink when sensors cross the line; - Serial Monitor should show sensor readings; - All sensors should detect the line when crossed; - Readings should change significantly between line and surface.
Troubleshooting: - If a sensor never triggers, check its connections; - If readings are inconsistent, check sensor height from surface; - If LED doesn’t blink, verify LED pin connection; - If no serial output, check baud rate settings.
6.1.1.2 Marker Sensors Test
Purpose: Verify the proper functioning of the course marker sensors.
Setup: 1. Upload the marker-sensor-test
program; 2. Open Serial Monitor (9600 baud); 3. Prepare test markers (either actual course markers or test material).
Test Procedure: 1. Move the robot over each marker; 2. Observe LED behaviour and Serial Monitor output; 3. Test both left and right marker sensors; 4. Try different marker positions and angles.
Expected Results: - LED should blink when marker is detected; - Serial Monitor should show which sensor detected the marker; - Both left and right sensors should work independently; - Readings should be consistent for similar marker positions.
Troubleshooting:- If markers aren't detected, adjust
MARKER_THRESHOLD value; - Check sensor height if detection is inconsistent; - Verify sensor connections if one side isn’t working; - Test with different marker materials if detection is poor.
6.1.1.3 Motors Test
Purpose: Verify proper motor function and movement patterns.
Setup: 1. Upload the motor-test
program; 2. Place robot on elevated surface or testing stand; 3. Ensure adequate space for movement; 4. Keep USB cable clear of wheels.
Test Procedure: The robot will automatically perform this sequence: 1. Move forward. 2. Stop. 3. Turn right. 4. Stop. 5. Turn left. 6. Stop. 7. Complete full turn. 8. Stop. 9. Move backward. 10. Stop. 11. Led blinking for 5 seconds. 12. Maximum speed running in straight line for 3s. 13. Stop.
Expected Results: - Motors should run smoothly in all directions; - Robot should stop completely between movements; - Turns should be consistent; - Motor speed should be steady.
Troubleshooting: - If motors don’t turn, check connections; - For uneven movement, verify wheel attachment; - If speed seems wrong, adjust MOTOR_SPEED constant; - For erratic behaviour, check battery voltage.
6.1.1.5 Line Sensor Calibration Test
Purpose: Calibrate line sensors and establish proper thresholds.
Setup: 1. Upload the line-calibration-test
program. 2. Open Serial Monitor (9600 baud). 3. Prepare test surface with line.
Test Procedure: 1. Place robot on testing surface. 2. Press button to start calibration. 3. During the 3-second calibration period: - Move robot over the line multiple times; - Cover all sensors; - Move at different angles. 4. Observe final calibration values.
Expected Results: - LED blinks rapidly during calibration. - Serial Monitor shows min/max values for each sensor. - Clear difference between line and surface readings. - Consistent readings across all sensors.
Troubleshooting: - If ranges are too narrow, check sensor height. - For inconsistent readings, clean sensors. - If calibration fails, adjust CALIBRATION_TIME
. - Verify surface and line contrast if readings are close.
6.2 General Tips
- Always check battery voltage before testing.
- Clean sensors before beginning tests.
- Use a well-lit testing area.
- Keep test surface clean and free of debris.
- Document unusual readings for future reference.
- Test one component at a time.
- Verify USB connection if Serial Monitor shows no data.
These tests should be performed in sequence when building a new robot or after any major modifications. Keep a log of typical values and behaviors for your specific robot - this will help identify issues in the future.
Regular testing using these programs can help identify problems before they affect robot performance in competition. If any test fails, resolve the issue before moving to the next test.