Skip to content
On this page

Test Harness

Navigate to opensource-autonomous-vehicle-controller -> lib lib

  • AS5047D.X contains the test harness of the encoder

    • Encoder can be found here
  • Garmin_LIDAR_V3HP.X

  • ICM-20948 contains the test harness of the IMU

  • NEO_M8N.X contains the test harness of the GPS

  • Radio_serial.X contains the test harness of the radio telemetry (for Mavlink)

    • Radio telemetry kit found here
  • RC_ESC.X contains the test harness of the DC brushless unidirectional and bidirectional motors

    • DC brushless motor found here
  • RC_RX.X contains the test harness of the radio controller

    • Radio receiver found here
    • Radio transmitter found here
  • RC_servo.X contains the test harness of the servo motors

    • Servo motor found here

Running the Test Harness

  • Note: Before running the test harnesses, make sure that you have properly connected your peripherals
  • File -> Open Project -> open-source-autonomous-vehicle-controller -> lib
  • Open the folder that contains the desired test harness in MPLAB
  • Open the folder’s Project Properties (File -> Project Properties)

Test_harness Project Properties

  • Choose Connected Hardware Tool to PICkit3
  • Navigate to xc32-ld -> choose General as the option category -> set the Heap Size (bytes) to be 0 bytes

xc32-id

General option category

Heap Size

  • Click Clean and Build Clean And Build

  • Click Make and Program Device Make and Program

  • Open a serial port terminal app (CoolTerm for Mac, PuTTY for Windows) and set the baud rate to 115200

IMU Test Harness

Hardware Setup for IMU

IMU Connections

IMU Connections

for reference to the IMU documentation refer here

Follow the steps given in Running the Teat Harness.

The terminal output should continuously report and update the IMU’s accelerometer, gyroscope, magnetometer readings in the x, y, and z axes, temperature, and magnetometer status. If the magnetometer status is always 0xff08, there might be an issue with your IMU:

Output for IMU

Motor Test Harness

Hardware Setup for Motor

Motor Connections

Motor Connections

Motor Connections

  • Note : The J5 jumper must be placed to supply 5V to the power lane.

RC Servo Output

  • The terminal output for the RC servo motor should be the current pulse in microseconds and the raw timer ticks.

RC Receiver test output

DC Brushless Output

  • To calibrate a ESC unidirectional motor:
    • Power it up by connecting it to a battery, and you should hear continuous beeping
    • Wait for at least three beeps
    • Connect to the PWM output channels in the OSAVC
    • Open the RC_ESC.X folder and click Make and Program Device
    • Set the minimum ticks of the motor for five seconds. This is automatically taken care of by the RC_ESC test harness.
  • The terminal output for the DC brushless motor should be the current pulse in microseconds and the raw timer ticks. PWM output channels 1 and 2 are for unidirectional brushless motors while PWM3 and PWM4 are for bidirectional brushless motors.

DC Brushless test output

GPS Test Harness

Hardware Setup for GPS

GPS Test Harness

Output

  • The terminal output should continuously report and update the time, latitude, longitude, speed, and heading acquired from the GPS module. Please note that the GPS module needs some time to acquire a satellite fix.

GPS Test Output

RC Receiver Test Harness

Hardware Setup for RC Receiver

RC Connections

RC Connections

Output for RC Receiver Test Harness

  • The terminal output should continuously report and update the user input to the nine channels of the radio transmitter.

RC Receiver Test Harness

Radio Telemetry Test Harness

Hardware Setup for Radio Telemetry

Radio Telemetry

Radio Telemetry

Radio Telemetry

Output for Radio Telemetry

  • The terminal output should show a message like this.

Radio Telemetry

  • Then, click File -> New to open a new terminal.

terminal output

  • Set the new terminal’s port to be the other usbserial (of the radio module, not the OSAVC serial port).

new terminal

  • Set the baud rate to be 57600

Baud Rate

  • Click Connect at the top of the application
  • Now, type a message like “Hello world” in the new terminal, and the message should be echoed in your original terminal. Hello World

Encoder Test Harder

Hardware Setup for Encoder

Encoder

Encoder

Note : If you only have one encoder, set NUM_ENCODERS to be 1 in the AS5047D.h file and connect your encoder to the J16 port.

  • The terminal output should continuously report and update the angle and velocity measured by the encoder in native units (16384 pulses per revolution).

Encoder

LIDAR Test Harder

Hardware Setup for LIDAR

LIDAR

LIDAR

Output for LIDAR Test Harness

  • The terminal output should continuously report and update the range measured by the LIDAR sensor.

Output