A BLE central interface for the Dashboard Peripheral, for programmable telemetry and telecommand of small, lightweight robots
Note: Mac OS X is currently the only supported OS. Linux is possible, but compatibility will be enabled later.
- Mac (tested with 2009 macbook and newer)
- OSX (tested with 10.9.2 and newer)
- System OR Dongle Bluetooth 4.0
- DashBoard
- Install Node.js: click "INSTALL"
- Download root of this Dashboard Teleoperation repository
- Learn how to customize DashBoard firmware
- Replace the folder "/libraries/DashBot" from the link above with the "/libraries" folder, found inside "custom_ardunio_files" in this repository
- This is to ensure that the VarSpeedServo and custom DashBot library are both loaded into the DashBoard firmware
- If you have system bluetooth 4.0, skip to next section
- Else, select your bluetooth 4.0 dongle by selecting host controller in the "Bluetooth Explorer" application
Run
In root directory:
node main.js
Set Parameters (PARAMS.js)
Set Keypress Definitions
define( 'Start_Automation1_KEY', 'p' );
define( 'Start_Automation2_KEY', 'o' );
...
define( 'Run_Forward_KEY', 'a' );
define( 'Turn_R_KEY, 'd' );
define( 'Turn_L_KEY, 'a' );
...
define( 'Set_Servo1_Init_Position_KEY', 'z' );
define( 'Set_Servo1_Final_Position_KEY', 'x' );
...
Set Telemetry Parameters
define( 'Save_Sensor_Data', true );
define( 'Rate_of_Sensor_Data_Arrival', 100 ); //in Hz
Set Telecommand Parameters
//DC Motor Control
define( 'Forward_Speed', 80 ); //unitless 1-100
define( 'R_Turn_Angular_Velocity', 70 ); //unitless 1-100
define( 'L_Turn_Angular_Velocity', 70 );
define( 'Turn_Duration', 300 ); //(ms)
...
//Servo Control
define( 'Servo1_Port', MOSI );
define( 'Servo1_Initial_Position', 0 ); //0-180 degrees
define( 'Servo1_Final_Position', 180 ); //0-180 degrees
define( 'Servo1_Speed', 40 ); //0=no speed, 1-255 slower to faster
...
Functions (main.js)
Control DC Motor
motorDrive(left speed, right speed, run duration); //speed 0-100, run duration 0-16777215ms
Control Servos 1, 2, and 3
servo1_control(position, speed); //position 0-180 deg, speed 0-255 (50 recommended)
servo2_control(position, speed); //position 0-180 deg, speed 0-255 "
servo3_control(position, speed); //position 0-180 deg, speed 0-255 "
Read Yaw Rate
readGyroDeg(function(yaw_rate){
//YOUR CODE HERE that depends on yaw_rate
});
Read Ambient Light Intensity
readAmbLight(function(amb_light){
//YOUR CODE HERE that depends on amb_light
});
Read L and R Proximity
readLeftProximity(function(l_IR)){
//YOUR CODE HERE that depends on l_IR
});
readRightProximity(function(r_IR)){
//YOUR CODE HERE that depends on r_IR
});
Examples (main.js)
Automated Behvaior: in automode_sketch1, automode_sketch2, or automode_sketch3
function automode_sketch1() {
servo1_control(180, 50); //t_0
setTimeout(function(){
motorDrive(100,100,800);
servo2_control(0, 50);
}, 100 //t_1 (ms)
);
setTimeout(function(){
motorDrive(100,50,300);
}, 1000 //t_2
);
setTimeout(function(){
servo1_control(0, 50);
servo2_control(0, 50);
}, 4000 //t_3
);
}
function automode_sketch2() {
//YOUR CODE HERE
}
function automode_sketch3() {
//YOUR CODE HERE
}
Cascade Sensor Reads
function automode_sketch1() {
readAmbLight(function(amb_light){
readGyroDeg(function(yaw_rate){
//YOUR CODE HERE that depends on yaw_rate and amb_light
});
});
}
Telemetric sensor data is automatically saved and appended in sensorlog.csv Use spreadsheet program to open filetype csv
- Mac OS X:
Keypress Flash LightsPrint Live Sensor Data and save to Log fileKeypress Motor ControlAutomated BehaviorVarSpeedServo extension for Servo ControlControl PWM at ports (currently MISO, MOSI, and SDA work)- Fix timer conflicts for backwards right or left motor speed
Program Interactivity, AutomationKeypress Turn Right, Turn Left, Go ForwardDelayed EventsControl Servo SpeedTimed AutomationGyro-Assisted SteeringParse external file with parameters
- Automated Motor Control for Self-Righting Project
- Send Live IMU Sensor Data to Computer
- Autonomous Behavior: Apply Control Theory/Machine Learning/Formal Methods Algorithms
- Linux
- TBD
- Dashboard
- Dash Robotics Open Source Code (Firmware, PCB Schematic, iOS Controller)
- node.js BLE central module
- SoftPWM for Customizing Output of Dashboard Pins
Michael Tsang themichaeltsang@gmail.com (2014)
Special Thanks to Dr Chen Li, Kaushik Jarayam, Dwight Swingthorpe, Mari Batilando, and Sandeep Mistry