The new cube servo, G15 from Cytron Technologies is amazing actuator. Beside the angle/position control feature (like a standard RC servo), it also offer continuous rotation 🙂
We are going to show a simple mobile robot construction using G15 as the motor drive the wheel and further the mobile robot. It might not like the mobile robot you imagine because we are using CD disc as the wheel and the scrap PCB as the mobile robot wheel. Bear in mind, I am just showing the possibilities to use G15 as motor to drive mobile robot, you are free to modify as you want. If you have questions or comments, please and welcome to discuss in ourtechnical forum as we seldom check the comments section in tutorial page.
Let’s start! I plan to use the existing wheel that Cytron carry and make some modification to fit the G15 bracket, but it seem the size does not fit well. So I decided to use some scrap DVD as the wheel.
Here is material I am using:
- Arduino Duemilanove (UNO is compatible)
- G15, Cube Servo, 2 units
- G15 shield
- 18650 rechargeable Li-ion battery x 3 units
- 18650 battery holder, 3 cells
- SKPS + PS2 controller
1st, measure the holes of G15 bracket and mark it on CD/DVD, we need to drill holes on the disc. There are only 3 holes available. BTW, you need to make 2 discs as we need 2 wheels, right? And make sure you do not want the disc anymore, drilling hole will damage the disc data and you cannot read the disc anymore.
Good! The wheels are ready, let’s prepare the base. I am using a scrap PCB, you can use any material as base, and make sure is strong enough to support the weight of G15, battery and Arduino. Again, measure the G15 bracket and drill 3 holes for each G15. Not to forget to use the proper M3 screws and nuts to mount it.
Lock the G15 onto the bracket using the inter-connect for G15, something like this:
Please make sure the turning shaft of G15 is facing away left and right of base, as we need to mount the wheel.
I use a screw type castor to support the base. Mount it at the front of mobile robot. We will need only 1 castor as the weight of battery will be at front and the back castor is not needed.
Please drill another 2 holes for battery hole, mount the battery holder at the front of mobile robot.
You can use the DC Jack Converter to connect the wires from battery holder to Arduino.
Anyway I am using modified DC jack as I have one 🙂 Take the Arduino UNO or Duemilanove, mark the holes on the robot base and drill it. Use PCB stand to mount the Arduino main board as shown.
Now, stack the G15 shield on to the Arduino main board, it will become like:
Connect only the left G15 to the G15 shield (not both, only 1), we need to make sure the ID is 1. Download the examples and library from G15 product pagehere. Extract it and copy the folder and place in C:\Users\XXXX\Documents\Arduino\libraries\
Open Arduino IDE and load the example from File->Examples->G15->SetID:
Modify the DesiredID to 0x01 as shown.
#define DesiredID 0x01
Compile and load into Arduino UNO, if update ID is successful, the LED on G15 will blink 1 second rate (slow), else (blink with fast rate) it is failed and check the connection and power.
Disconnect the left G15 from the shield, connect the right G15 only to the shield (not both, only 1). Modify the Sketch, change the ID to 0x02 and load into the Arduino.
Good, now the ID is set correctly with left is 1 and right is 2.
Horey! Is getting near J. Connect both the G15 motors together.
You can test the mobile robot by loading this sketch, it is a very basic code where it will move forward for 500ms, backward for 500ms, turn right for 500ms, turn left for 500ms, and repeat it continuously. This is to verify the G15 direction and ID. If the mobile robot does not move as wanted, please check the ID and left right orientation.
Of course you can continue with this setup and write you program. But in order to show more interesting result I decided use SONY PS2 to manually control it for navigation J. Initially I plan to use SKPS, but since Cytron is launching the wireless SKPS, I will use it for this tutorial.
SKPSW comes with a transmitter and receiver. Transmitter is where we connect it to SONY PS2 controller; while the receiver we connect to Arduino on mobile robot. Again, we need to mount receiver. I drill 2 holes to mount the receiver.
We need to connect the SKPSW-RX(receiver) to Arduino. This receiver is compatible with SKPS, but it is not an Arduino shield. Yet, it is compatible with any microcontroller with UART, of course, Arduino too. Just simply connect 4 pins from Arduino to the SKPSW-RX and is ready to operate. You can use female to male jumper wires to do that.
Pin 10 TX
Pin 11 RX
Hey, wait! Didn’t I say SKPS is using UART? But why uses pin 10 and 11 on Arduino. It should be pin 0 and 1, isn’t it? Yup, you are right, and I am right too. We cannot use the original UART pin on Arduino because it is being used by the G15 shield for communication to G15 Cube servo. So I have choose pin 10 and 11 and will use software instead of hardware UART.
You will get a mobile robot like this:
Load this example sketch into Arduino, it is ready for SKPS control. If you are using SKPS, makesure the baudrate on it is 9600 and plug in PS2 Controller and you can start controlling the mobile robot.
If you are using SKPSW, you need to bind both the receiver and transmitter before using it for the 1st time. Press and hold the “BIND” button on the transmitter for 2 seconds. Both the “LINK” and “PS2” LEDs will blink to indicate it is in binding mode. Now, at the mobile robot, power up the Arduino and further the SKPSW-RX (Receiver) will be powered too. Press and hold the “BIND” button for 2 seconds, and if the binding process is successful, the “LINK” LED will stay ON. OK, the binding is only needed for 1st time. It will remember its pair for the rest of time even after re-power, or until you re-binds with another set.
The sketch for SKPS and SKPSW is same because the communication protocol is same. However, it is just a basic navigation, you are welcome to modify it and show the result to us.
So have fun with your new mobile robot. Our design team is designing accessories for G15, so you might be able to get new wheels which is nicer and easier to mount.