Just buy G15 cube servo but do not know how to use it? Or you bought a cube servo a few weeks ago and just open it, programmed it and the cube servo does not response? Connect it to a new circuit board that you had soldered and cube servo does not response? Do not know the cube servo ID? We would like to guide you how to test your cube servo using just your cube servo, Arduino Uno, Cytron G15 shield, and LCD keypad shield.
Main Hardware list:
- G15 cube servo, only 1 at a time.
- Arduino Uno
- Cytron G15 Shield
- LCD keypad shield
- Power Supply or any battery range from 7V to 12V
- USB B type cable use to program the Arduino Uno
Main Software list:
PART 1: Hardware Setup
1. Prepare the hardware as figure below.
2. Make sure the G15 shield is using internal power and the control connectors are set to D3 and D2.
3. Stack all shields on Arduino Uno as shown figure below and connect the power supply and USB B type cable to Arduino Uno and to computer.
4. After load the example program, make sure to disconnect the USB B type cable and power supply to reset the G15. It seems that after loading program, sometimes the shield or the cube servo stop responding. Reconnect the power and it is ready to control your G15.
PART 2: Set up the Arduino IDE
1. Copy the G15 arduino library into Arduino IDE directory. G15 arduino library can be download here.
2. Download full code for testing your cube servo. Here is the file, G15_Test. This program has 7 selections to test G15 cube servo. Compile this program and burn it into your arduino Uno by pressing the upload button in the Arduino IDE.
PART 3: Test the Cube Servo
Button indicator: “UP” = Selection Up , “DOWN” = Selection Down
Selection 1, G15 Auto Test:
“SELECT” = Enter selection
This selection is to test whether G15 cube servo is response or not. When you press “SELECT” button in this selection, G15 cube servo will automatically enter servo mode by rotating to 0 degree and rotating back to 360 degree. It will further enter wheel mode by rotating the motor to full speed and back to low speed.
Selection 2, Torque VS Load:
“SELECT” = Enter selection/Exit selection , “UP” = Increase Torque , “DOWN” = Decrease Torque
This selection is to demonstrate cube servo torque and its load reading.
Selection 3, Servo Mode:
“SELECT” = Enter selection/Exit selection , “UP” = Increase CW limit , “DOWN” = Decrease CCW limit ,
“RIGHT” = Increase Servo Position , “DOWN” = Decrease Servo Position
This selection is to demonstrate cube servo in its Servo Mode. You can set up the servo motor angle limit and observe that G15 servo motor can only operate in its angle limit. If anything goes wrong, just press “RESET” button.
Selection 4, Wheel Mode:
“SELECT” = Enter selection/Exit selection , “UP” = Increase motor speed , “DOWN” = Decrease motor speed ,
This selection is to demonstrate cube servo in its wheel mode. You can play with the cube servo speed in this selection.
Selection 5, Encoder Mode:
“SELECT” = Enter selection/Exit selection , “UP” = Increase Full Rotation Movement, “DOWN” = Decrease Full Rotation Movement ,
“RIGHT” = Increase Small Rotation Movement , “DOWN” = Decrease Small Rotation movement
This selection is to demonstrate G15 cube servo act as wheel with encoder feedback. Set up the full rotation , how much times it will take to make 360 degree ± 10 degree turn and how it will make small rotation which is less than 360 degree represent by 1087 scale.
Selection 6, Factory Reset:
“SELECT” = Enter selection, “RESET” = Exit Selection
Once you push the “SELECT” button, the program will enter the factory reset and reset the cube servo to its factory condition. After push the “RESET” button, you will see the the ID of the cube servo reset to 1.
Selection 0, G15 ID Set:
“SELECT” = Enter selection/Set Up new ID , “UP” = Increase ID to be set, “DOWN” = Decrease ID to be set ,
“RIGHT” = Exit selection
This selection is to set up new ID and see the current ID of the cube servo connected. By pressing the “SELECT” button, you will set the new ID for the cube servo.
To download the completed sample source code, please click G15_Test.