Workshop 2021
Workshop Dates: July 15th- 22nd, 2021
Fourth Smart Manufacturing Workshop - July 15-22, 2021
Proceeding of the Fourth Smart Manufacturing Workshop- 2021
Table of Contents (Click to go to content):
Workshop Agenda:
Session Speakers:
Abstracts of the Third Smart Manufacturing Workshop
Lab: Coding using Arduino and a Drone Application
Software Installation and Setup:
To download a program to the device:
Downloading the Default Flight Controller Program on to the Drone:
Exercise 1: Emergency Vehicle Sirens
Exercise 2: Simple Drone Flight Path
Exercise 3: Drone Flight Path Program
Coding using Arduino and the CoDrone Programmable Drone
Software Installation and Setup:
Step 1: Download and Install the Arduino programming environment:
https://www.arduino.cc/en/Main/Software
Step 2: Install the CoDrone Library through the Arduino Library Manager:
Sketch -> Include Library -> Manage Libraries
A dialog box pops up, in the search box type CoDrone
CoDrone by Robolink appears, select library and click on install.
Step 3: Installing the Hardware Files:
File -> Preferences (for Windows) Arduino -> Preferences (for Mac)
Under Additional Boards Manager URLs, Paste the following URL:
https://raw.githubusercontent.com/RobolinkInc/Robolink/master/package_rokit_index.json
Press OK to close the Preferences window
Go to: Tools-> Boards-> Boards Manager
Change the type from All to Cobtributed, then find the package ‘rokit by ROBOLINK’ and install it.
Step 4: Installing the USB drive:
Go to Silabs (https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers ) and download the driver software for your operating system.
Extract and run the file: ‘CP210xVCPInstaller_x…exe’
Note: click on Computer then Properties to know if you have a 64-bit or 84-bit system
Note for MAC computers: If you are using a MAC computer, you need to open the DMG file, then open the Legacy MacVCP Driver folder, then open the file Silicon Labs VCP Driver.pkg which is inside the Legacy MacVCP Driver folder.
To download a program to the device:
Turn dip swith 1 to the ON position.
Press the reset button (located right below the dipswitches). After that, only the far right blue LED light starts blinking.
On the bluetooth module, the LED light on the bluetooth module should be blinking green, if it blinks red, press the reset button once (located right below the LED light).
Go to Tools -> Boards and select Rokit-Smartinventor-mega32_v2
Go to Tools -> Port and select the port to which the remote device is connected. (If you are using a MAC, the port may be SLAB_USBtoUART )
To upload the default flight control program: go to File -> Examples -> CoDrone -> Controller -> FlightController
To start the upload, click on the upload button (arrow pointing to the right), when the upload is successfull, you will see "Done Uploading" displayed at the bottom left corner of the screen.
Move the dipswitch back to the off position
Downloading the Default Flight Controller Program on to the Drone:
By default the Flight Controller Program is installed on your drone, but if you erase it, you can download it to the drone as follows:
Make sure the remote control power button is in the OFF position, then connect remote to your computer via the USB connection.
Turn the DIP switch # 1 to the ON position (in the upwards direction)
Press the black reset button on the controller board. A single blue LED starts flashing and all other LEDs turn off
Make sure that the Bluetooth module has one LED flashing red color, if the green LED flashes, press the reset button on the Bluetooth module.
Open Arduino on your computer.
Go to: File > Examples> CoDrone> Controller>Flight Controller
Go to: Tools > Board>”Rockit SmartInventor-mega32_V2”
Select proper communication Port: Tools >Port> Com5 (for instance)
Return the DIP switch to the OFF position and turn on remote
Exercise 1: Emergency Vehicle Sirens
#include <CoDrone.h>
//This program, flashes LED lights on the controller with a buzz at the frequencies: 1,500 Hz for 400 ms and 500 Hz for 400 ms
void setup() {
pinMode(12, OUTPUT);
pinMode(15, OUTPUT);
}
void loop() {
digitalWrite(12, HIGH);
digitalWrite(15, LOW);
CoDrone.Buzz(1500,1);
delay(400);
digitalWrite(12, LOW);
digitalWrite(15, HIGH);
CoDrone.Buzz(500,1);
delay(400);
}
Exercise 2: Simple Drone Flight Path
#include <CoDrone.h>
void setup() {
CoDrone.begin(115200);
CoDrone.pair();
CoDrone.takeoff();
CoDrone.hover(1);
//---------------------- Turn the Drone to the right
CoDrone.setYaw(50);
CoDrone.move(1);
CoDrone.setYaw(0);
//--------------------------Increase Altitude
CoDrone.setThrottle(50);
CoDrone.move(2);
CoDrone.setThrottle(0);
//------------------------Move drone forward
CoDrone.setPitch(50);
CoDrone.move(1);
CoDrone.setPitch(0);
//----------------- Land drone
CoDrone.land();
}
//---------For Emergency stop, cover the IR sensors 11 and 18 with your fingers
void loop() {
byte sensor18 = digitalRead(18);
byte sensor11 = digitalRead(11);
if(sensor11 && sensor18){
CoDrone.emergencyStop();
}
}
Exercise 3: Drone Flight Path Program
#include <CoDrone.h>
void setup() {
CoDrone.begin(115200);
CoDrone.pair();
CoDrone.takeoff();
CoDrone.hover(3);
//move upwards at 50% increased speed for 1 second
CoDrone.setThrottle(50);
CoDrone.move(1);
//Return to normal upward speed, and move forward at 30% increased speed for 1 sec
CoDrone.setThrottle(0);
CoDrone.setPitch(30);
CoDrone.move(1);
//return to normal forward speed, and turn right at 50% speed for 1 sec
CoDrone.setPitch(0);
CoDrone.setYaw(50);
CoDrone.move(1);
//Move forward at 30% of full speed for 1 sec
CoDrone.setYaw(0);
CoDrone.setPitch(30);
CoDrone.move(1);
//move to the right at 30% of full speed
CoDrone.setRoll(30);
CoDrone.setPitch(0);
CoDrone.move(1);
//Reduce altidude at 40% speed for 3 sec then land
CoDrone.setRoll(0);
CoDrone.setThrottle(-40);
CoDrone.move(1);
CoDrone.land();
CoDrone.takeoff();
CoDrone.hover(1);
//Move backwards at 40% of full speed for 1 sec
CoDrone.setPitch(-40);
CoDrone.move(1);
//Reduce altidude at 40% speed for 3 sec then land
CoDrone.setPitch(0);
CoDrone.setThrottle(-40);
CoDrone.move(1);
CoDrone.land();
}
void loop() {
byte sensor18 = digitalRead(18);
byte sensor14 = digitalRead(14);
byte sensor11 = digitalRead(11);
if(sensor11 && !sensor14 && !sensor18){
CoDrone.emergencyStop();
}
}
Copyright: NSF SMARTT Project, 2021