This demonstration shows how to control the Geekbot using direct wireless control with the IR Gamepad.Contents:
Project Parts List:
RobotGeek Geekbot Kit
Everything you'll need to get started with this demo is included in the RobotGeek Geekbot Kit! We'll be using the IR Receiver and IR Gamepad on the standard Geekbot Base.
Assemble your Geekbot
Geekbot V3 Assembly Guide
Download the Sketch
A .zip file with all of the Geekbot Sketches can be found here.
If you haven't already done so, download and install the RobotGeek Libraries and Tools here.
Unzip the file and you will have a folder called
We recommend that you find the
RobotGeek Sketches folder in your Arduino user folder and put the
geekbot-master in there. The rest of this guide will assume you've placed your sketches in the following folder.
Arduino -> RobotGeek Sketches -> geekbot-master
This will be the same 'Arduino' folder you put your libraries and robotgeek tools in, and NOT the folder where the Arduino application is.
File -> Sketchbook -> RobotGeek Sketches -> geekbot-master -> Geekbot_V3 -> geekbotV3IRGamepadand upload the code to your Geekduino.
Wiring for IR control of the Geekbot is as follows:
|Device||Sensor Shield Port|
Right Turn Signal
Left Turn Signal
Switch on your Geekbot, make sure your controller is set to sender signal mode A, and wait for the Geekbot to make the startup sound. If everything is loaded correctly, you should be able to run your geekbot now!
- Pressing directional button(s) (Up, Down, Left, Right) will drive the Geekbot.
- Pressing Select will trim the robot's drive to the left, Start will trim the drive right.
- Pressing B and TA (Left and Right) buttons will decrease or increase the amount of turn while driving.
- Pressing A and TB (Bottom and Top) buttons will decrease or increase the drive speed.
The trim will help your Geekbot drive straight. You can adjust it from the Rotation Knob on your Geekbot, or with the Select and Start buttons on your controller. Drive forward to test it before going any further.
Tuning the Geekbot
The Geekbot has some configuration options you can change for a better experience! If you take a look at lines 44 and 45:
int modMaxSpeed = 100; //Change this variable to make the Geekbot go faster/slower when driving forward and backward when you first turn it on. int modRotateSpeed = 10; //Change this variable to make the Geekbot go faster/slower while turning when you first turn it on. Normal range between 0-300Changing these numbers will change the speed that your Geekbot goes on startup. All your normal trim and speed adjustments will still work as normal. If you look at lines 49-58:
const int CCWMaxSpeed = 1750 + modMaxSpeed; //Left wheel forward speed const int CCWMedSpeed = 1660; const int CCWMinSpeed = 1580; const int CWMaxSpeed = 1150 - modMaxSpeed; //Right wheel forward speed const int CWMedSpeed = 1300; const int CWMinSpeed = 1400; const int ServoStopSpeed = 1500; //Servo pulse in microseconds for stopped servo const int ServoRotateSpeedHigh = 50 + modRotateSpeed; //For in place rotation. Applied to CW and CCW_MIN_SPEEDs const int ServoRotateSpeedLow = 25 + modRotateSpeed; //For in place rotation. Applied to CW and CCW_MIN_SPEEDs const int MaxTrimAdjustment = 100; //Limit rotation knob trim effect in microsecondsYou will see the Advanced configuration. The first 6 lines handle the left and right wheel forward speeds. Notice that they are slightly different. This is due to the physical properties of the servo responding to the signal a bit differently depending on which direction the horn is turning. You can essentially trim the wheels by altering these values, but they have been set this way purposefully based on our findings. Servo Stop Speed will always be 1500. This is the microsecond signal that tells regular servos to turn to 90 degrees. Continuous turn servos will not rotate when set to 1500 microseconds or 90 degrees via the servo library. RotateSpeedHigh and Low are for in place rotation. You will not likely need to change these if you have changed modRotateSpeed. MaxTrimAdjustment should only be changed if you absolutely cannot get the trim to straighten out. Increasing this number allows for a wider range of trim adjustment, but decreased resolution. Decreasing this number allows for finer adjustment, but runs into the limitation of not trimming as far. Make your judgement wisely.
PC Control These demos and projects allow the robot to be controlled via a computer.
ArbotiX Commander Control - These demos and projects control the Robot using the ArbotiX Commander, the handheld Arduino based remote control.
Direct Control - These demos and projects control the Robot directly from sensors connected directly to the Robot's control board.
Pose Control - These demos and projects allow you to create and playback a sequence of poses.
Serial Control - These demos and projects control the robot using a serial packet protocol.
Standalone - These demos and projects are deisgned to let your robot function without a computer or additional microcontroller.
Wireless Control - These demos and projects allow you to control the robot wirelessly - usually by replacing the Serial Connection with XBee modules.
Reference - These articles have technical details regarding the control and operation of the robot.
More info here