[X4] 2. Barbarian

1. Robot Assembly
1) Assembling the Robot
2) Verifying Cable Connections
2. Code Upload & Robot Operation
Without Direct Coding, when using the Complete Robot Operation Program provided by XROBO
When Directly Coding individual robot operation programs
1) When using the Complete Robot Operation Program
① Preparing for Upload
② Download and Load the Operation Program
③ Uploading the Code
④ Operating the Robot
2) If You Are Coding the Program Yourself
① Preparing for Upload
② Coding the Program
③ Uploading the Code
④ Operating the Robot
3. Coding Examples
1) Controlling Axe & Shield Movements
Swinging the Axe
Let’s set the rotation speed of the axe to 10.
Since the DC motor with the axe is connected to the M3 port, set the speed of ‘M3’ to ‘10’.
Rotating the Shield
Let’s set the rotation speed of the shield to 10.
Since the DC motor with the shield is connected to the M4 port, set the speed of ‘M4’ to ‘10’.
Using Axe & Shield Simultaneously

Let’s set the rotation speed of both the axe and shield to 10.

Since the DC motor with the shield is connected to the M4 port, set the speed of ‘M4’ to ‘10’.
Using Remote Control
While holding the 5th button on the remote control, the axe and shield should rotate simultaneously at a speed of 10. When the button is released, the rotation should stop.
To ensure the weapons remain stationary when the button is released, place a stop code in the ‘else’ section of the ‘if-else’ block.
2) Changing Weapon Rotation Speed Using Variables
Creating a variable
Create a variable named ‘Speed’ and set its initial value to 10.
Set the initial value directly below the ‘Start’ block using the ‘Set Variable’ block.
Using a variable
Let’s make the weapon rotate according to the ‘Speed’ variable when the 5th button on the remote control is pressed.
Instead of entering a number directly, insert the ‘Speed’ variable block.
Using Remote Control
To change the variable value, use the ‘Set Variable’ block.
3) Controlling the Barbarian with the Remote Control
Using Remote Control
Use the ‘Set Variable’ block to change the variable value.
Remote Control
Wheels
Weapon
Speed Adjustment
4. Troubleshooting Robot Issues
1) When the Power Does Not Turn On
  • Ensure the batteries are inserted with the correct polarity, matching the ‘+’ and ‘-‘ signs.
  • Inspect the battery pack cable for any breaks or disconnections.
  • Ensure that the battery pack cables are securely connected to the 6V, 12V power connector on the CPU board.
2) When the Remote Control is Not Working
3) When the DC Motor Does Not Rotate / Rotates in the Wrong Direction
  • Ensure that the motor cables are correctly connected to the motor port.
  • Check the motor cables for any signs of disconnection or damage.
  • Confirm that the motor cables are inserted vertically into the motor ports on the CPU board. If connected horizontally, the motor may not rotate.
  • Ensure the black wire of the motor cable is aligned with the arrow on the CPU board case. If connected in reverse, the DC motor will rotate in the opposite direction.
  • If the DC motor driver board is not inserted according to the assembly diagram, do not turn on the power. Insert it correctly as per the assembly diagram to avoid overheating risks during operation.
  • If the DC motor driver board is not inserted, place it properly and then turn on the power to check the operation.
4) When the Servo Motor is Not Functioning Properly
  • Ensure that the 3-PIN cable is connected to the correct OUT port.
  • Verify that the black wire of the servo motor cable is plugged in the direction of the arrow on the CPU board case.
  • Connect the cable so that the black wire aligns with the arrow on the CPU board.
  • Ensure that the direction of the servo motor label in the assembled robot matches the assembly diagram. If the label is oriented incorrectly, the servo motor may operate in reverse, or the angle may be incorrect, posing a risk of gear damage.
5) When the LED is Not Functioning Properly
  • Ensure that the 3-PIN cable is connected to the correct OUT port.
  • Verify that the black wire of the 3-PIN cable is plugged into the side of the LED pin with the white line.
  • Confirm that the black wire of the 3-PIN cable is connected in the direction of the arrow on the CPU board case.
6) When the Robot Operates Abnormally
  • Ensure that the direction of the DC motor shaft in the assembled robot matches the assembly diagram. Incorrect assembly of the motor shaft may cause the robot wheels to get stuck on the frame and malfunction.
  • Check that the cables are not caught in the drivetrain. If the cables are entangled with the drivetrain, the robot may not function properly.
Scroll to Top