Skip to content

Debug Tests

Elisson Araújo edited this page Nov 22, 2024 · 2 revisions

Debug Tests

When defining one of the expressions below in main file code, a loop test routine will be executed and wireless communication with the robot will be suspended, being necessary to pass the standard code after the tests.

TEST_BASICS

The robot will initially have the engines stopped at coast, when pressing the PBT1 button on the main board the 4 steering motors move with speed of 30%, the next times pressing this button reverses the direction of rotation. when pressing PBT2 the motor stops and returns to coast.

  • In serial monitor the following data will be printed:

    • the battery level;
    • reading of binary switches that define the robot id;
    • button reading;
    • wireless connection status;
    • reading the encoders with the current speeds of the 4 steering motors;
    • the reading of the kick barrier sensor (IR) and the current load of the capacitors;
  • Notes:

    • for easy analysis of the data comment on some of the print calls;
    • this test is often used to analyze the conditions of the gearing of the wheels with the steering motors the reference is with 30% of the speed is that each engine has a speed of around 40 rad / s

TEST_PWM

Initially the robot will have the engines stopped at coast, when pressing the button PBT1 on the main board a loop with the steering motors started to receive the 1% pwm initially and every 300 ms this percentage increases by 1% up to the limit of 30% of the pwm, when when they stop and pass to receive a -1% pwm reducing every 300 ms 1% to -30% where the movement loop stops and restarts press PBT2, To interrupt the test loop at any time press PBT2 and PBT1 to resume the test.

  • The encoder reading for the speed of the steering motors will be printed on the serial monitor.

TEST_PID

Initially the robot will have the engines stopped at coast, when pressing the PBT1 button on the main board a loop with the steering motors start to move with 30 rad / s with PID, after 300 ms the motors stop and when pressing the PBT1 button it the steering motors moved with -30 rad / s with the PID, after 300 ms the motors stop, to restart the loop press PBT1, to interrupt the test loop at any time press PBT2 and PBT1 to resume the test.

  • The encoder reading for the speed of the steering motors will be printed on the serial monitor.
  • Note: This test is generally used to tuning the PID of steering motor.

TEST_KICK

Initially the robot will be in a waiting loop, when pressing PBT2 the robot discharges the capacitors and when pressing PBT1 the test loop starts, when pressing PBT1 the robot will kick front, when pressing again it kicks with the chip both with a discharge of 1 ms, when the robot is pressed again it stops charging the capacitors and returns to the first test point.

  • the reading of the kick barrier sensor (IR) and the current load of the capacitors will be printed in serial monitor.

TEST_DRIBBLER_PID

In this test, the dribbler's motor is initially stopped, when pressing PBT1 the test loop starts where the motor starts to move the dribler always in the same direction but alternating between a high speed and a low speed every 5000 ms, to pause the test press the PBT2 button on the robot's main board, to resume press PBT1.

  • The encoder reading for the speed of the dribbler motor will be printed on the serial monitor.
  • Note: This test is generally used to tuning the PID motor dribbler.

TEST_DRIBBLER_PWM

In this test, the dribbler's motor is initially stopped, when opening the PBT1, it moves at 20% of its speed, pressing PBT1 again increases 1% in speed up to the limit of 60%, to pause the test press the PBT2 button on the robot's main board, to resume press PBT1.

  • The current speed percentage and the speed encoder reading of the dribbler motor will be printed on the serial monitor.
  • Note: This test is generally used to test mechanical modifications to the dribbler.