TwinTeeth - Installing the software
Installing the software
Warning: Do not connect the power supply yet.
In this chapter we are only going to upload the firmware on the Arduino and you can do that just connecting the USB cable to it.
The software used by TwinTeeth is composed by some code installed on the Arduino (firmware) and some software installed on your computer. Both are connected through a USB port and a cable.
If you didn't do it before, download now the zip files needed. Before that, we suggest you take a look to the Release Notes of the lastest version.
TwinTeeth side
Category | Component | Comments | Files |
---|---|---|---|
TwinTeeth Software | TwinTeeth Firmware V2.1 | Lastest version of TwinTeeth's firmware, compatible with TwinTeethMC V2.3 | Download |
TwinTeeth Software | TwinTeeth Firmware V2.0 | Previous version of TwinTeeth's firmware, compatible with TwinTeethMC V2.1 | Download |
TwinTeeth Software | TwinTeeth Firmware V1.0 | TwinTeeth's firmware based on Marlin (Old version) | Download |
Tools | Arduino IDE V1.6.1 | Arduino's development environment | Download |
Server side
Category | Component | Comments | Files |
---|---|---|---|
TwinTeeth Software | TwinTeeth Management Console V2.3 | The latest version of the PC software side which allows you to manage and control TwinTeeth Firmware V2.1 | Download |
TwinTeeth Software | TwinTeeth Management Console V2.2 | Previous version of the PC software side which allows you to manage and control TwinTeeth Firmware V2.0 | Download |
TwinTeeth Software | TwinTeeth Management Console V1.0 | The PC side software which allows you to manage and control TwinTeeth (Old version) | Download |
ULP | TwinTeeh Eagle's ULPs V2.0 | The lastest verson of Eagles's User Language Program to generate drilling and dispensing g-code files. | Download |
ULP | TwinTeeh Eagle's ULPs V1.0 | Previous version of Eagles's User Language Program to generate drilling and dispensing g-code files. | Download |
Tools & Libraries | Xloader 1.0 | Utility to load TwinTeeth Firmware into the Arduino Mega. | Download |
Eagle Cadsoft 6.1 or higher | Electronic CAD designing program. | Download | |
Processing 3.0 | Latest version of Processing: a programming language/development environment needed to run TwinTeeth Management Console V2.3 | Download | |
Processing 2.2.1 | Previous version of Processing needed to run TwinTeeth Management Console V2.2 and below. | Download | |
ControlIP5 V2.2.5 library for Processing | A GUI (graphical user interface) library for Processing. This version is compatible with Processing 3.0 and TwinTeethMC V 2.3 | Download | |
ControlIP5 V2.0.4 library for Processing | A GUI (graphical user interface) library for Processing. | Download | |
Ghostscript 9.15 | Postcript libraries needed by TwinTeeth Management Console. | Download | |
Ghost4J 0.5.1 | Postcript Java libraries needed by TwinTeeth Management Console. | Download | |
PCB-Gcode | If you want to generate etching g-code from Eagle's boards (optional) | Download |
We recommend you to create, wherever you want, a directory called TwinTeeth, for example in C: \Users\MyUser\TwinTeeth.
We will use it to centralize all the software installation. We will reference it in the rest of this tutorial as <TwinTeeth>
Arduino IDE
The Arduino IDE is the Integrated Development Environment used by Arduino.
We will use it to modify, compile and upload TwinTeeth firmware. By default it is installed in C:\Program Files\Arduino.
Follow the instructions on Arduino's web page to install it on your computer. It is better to use the Windows installer than the zip file because the installer registers automatically the software on your computer.
Xloader
Xloader is very a useful utility to upload the firmware on the Arduino.
To install it: just unzip the XloaderV1.0.zip file on <TwinTeeth>\XLoader directory.
You can also upload the firmware through the Arduino IDE, so it's optional.
Eagle CadSoft
Eagle is a popular Electronic CAD tool which has a free version with the following limitations:
- The useable board area is limited to 100 x 80 mm (4 x 3.2 inches).
- Only two signal layers can be used (Top and Bottom).
- The schematic editor can only create one sheet.
Download the last version from Eagle's site and follow the instructions to install it in your PC.
We developed several ULPs (User Language Program) for Eagle and we will install them later.
Processing
Processing is a user friendly programming environment based on Java. We used it to develop TwinTeeh Management Console. This is the software that runs on your PC which allows you to control and manage the robot.
Processing is multi-platform. It runs on Windows, Mac, Linux, etc. and in theory all the software developed with it is multi-platform too. But we did not test it, neither certified. So we only support Windows.
Install Processing V3.0 in <TwinTeeth>\Processing directory.
Create another directory in <TwinTeeth> called Sketchbook.
Now you have to run Processing to configure that directory.
Open the menu File->Preferences.
You will see a window like this one:
Set the field "Sketchbook Location" to <TwinTeeth>\Sketchbook. Remember that <TwinTeeth> is your TwinTeeth root directory path.
Press OK button and close Processing (Ctrl-Q). Then run it again because it will need to detect the new directory and create there several directories.
Quit again Processing with Ctrl-Q.
ControlIP5
ControlIP5 is a set of graphics libraries for Processing. It must be downloaded from their web page.
Install version 2.2.5 or higher that is compatible with Processing V3.0 or above.
You have to install it in <TwinTeeth>\Sketchbook \libraries.
Follow the instructions from ControlIP5 web page about how to install it there.
Ghostscript
Ghostscript is a program that provides an interpreter for the PostScript (TM) language with the ability to convert PostScript files to many other formats.
We use it to read the circuit board layout which Eagle generates in that format.
Download Ghostscript 9.15 for Windows (Affero licence) and run the .exe to install it on your computer. An installation wizard will help you in the installation process. It usually installs Ghostscript in C:\Program Files\gs\gs9.15
Important: You need to add the following directory C:\Program Files\gs\gs9.15\bin to the Windows Path environment variable. You can do it in Computer->System Properties->Environment Variables. Edit the Path variable and add this directory at the end, after a semicolon.
Ghost4J
Ghostscript was developed in C language and we used Java to develop TwinTeethMC so we needed a library to call the Ghostscript functions from Java. Ghost4J is this library. It basically binds the Ghostscript C API to Java language.
To install it, first create a new directory called ghost4j in <TwinTeeth>\sketchbook\libraries
Then, create another one called library in <TwinTeeth>\sketchbook\libraries\ghost4j
Unzip the file in that directory: <TwinTeeth>\sketchbook\libraries\ghost4j\library
It will create there a lib directory and a file called ghost4j-0.5.1.jar
Important: copy all the content of lib directory to <TwinTeeth>\sketchbook\libraries\ghost4j\library
Finally rename ghost4j-0.5.1.jar file to just ghost4j.jar
At the end you will have the following at <TwinTeeth>\sketchbook\libraries\ghost4j\library directory:
PCB-Gcode
It is an Eagle ULP which generates G-code from the circuit board design. It's usefull if you want to etch the copper with a v-bit instead of using the laser for photengraving UV film. TwinTeeh doesn't use G-code when printing with the Laser. Instead it uses Postcript files because it prints in rastering mode.
This software is optional. Follow the instructions to install it from the PCB-Gcode web page.
Installing TwinTeeth Software
Once you have downloaded and installed the tools and libraries then install the TwinTeeth software itself.
Unzip the TwinTeeth Management Console V2.3 file and install it in <TwinTeeth>\Sketchbook. There is where Processing will find it.
Finally create a directory to save the PCB postcripts files and G-code files, for example: <TwinTeeth>\Sketchbook\PCBFiles.
Now we are going to check if the installation was OK.
Run Processing.
Open the File menu. Select Sketchbook->TwinTeethMC
You will see a new window with the program code of TwinTeeth Management Console. Something similar to this:
Now click on the button. It runs the program.
Then you will see the TwinTeeth Management Console's main screen.
If you don't see it, then there is something wrong in the libraries installation. Go back and check that everything was installed OK.
If you see the TwinTeeth Management Console main window then close it (just clicking on the top right cross) because we don't need it at this time. We will use it later, when we finish uploading the firmware on the Arduino.
Compiling and uploading the firmware
Now we are going to compile the firmware and upload it into the Arduino.
First unzip the firmware file TwinTeethFirmwareV2.1.zip in <TwinTeeth>\TwinTeethFirmware directory.
Then connect your computer to the Arduino USB port.
Run the Arduino IDE. You will see the following window:
Now we are going to set up the Arduino IDE. You need to set up the board and the COM port you are using.
Go to the Tools menu tab and select Board->Arduino Mega or Mega 2560.
Then go to Tools->Processor and select Atmega2560 (Mega 2560) processor.
Finally go to Tools->Port and select the COM port where the Arduino Mega is connected.
Now the Arduino IDE is connected to the Arduino Board.
The next step is to open the firmware files and compile them.
Open the File menu and select Open (Ctrl-O). A File selector window will appear.
Go to the directory where you installed the firmware, <TwinTeeth>\TwinTeethFirmware, and open the TwinTeethFirmware.pde file.
You will see the following window.
At the top side you will see several tabs with the labels: TwinTeethFirmware, Base64.cpp, Base64.h, etc. They allow you to select the various code files which form the program. From the configuration point of view, the most important is the Configuration.h tab. We will come back to that later when we will calibrate the robot. But now we are only going to compile the code and upload it into the Arduino Mega.
Click on the Upload button. This button will start the compilation process and will upload the firmware into the Arduino.
After clicking upload, you'll see the Arduino's RX/TX lights going wild. The upload process generally takes a few seconds to finish.
Once completed, a message will appear at the bottom window telling you how many bytes were uploaded. Otherwise you will see an error message indicating what happended.
Connecting with TwinTeeth
Now we can try to run the TwinTeeth Management Console and connect with TwinTeeth.
Before connecting make sure that no other program is using the port. Then run Processing if it is not running.
You will see again the Processing window.
Open the File menu. Select Sketchbook->TwinTeethMC
You will see the program code again:
Now click on the run button.
And if everything goes well you will see the TwinTeeth Management Console's main screen.
To connect to TwinTeeth first you have to select the Arduino COM port (top left, below PenTool tab) and then click on the Connect button.
In the right window you will see the messages that the robot sends you. At the bottom the status message: "Connected to Printer on COMX @ 1115200"
It means that TWTMC is connected to the Arduino firmware.
You will see something like this:
In the following chapters we will explain in detail how to use this application. For the moment it is enough to check that you can connect with TwinTeeth.
Don't try to use the controls and move the robot; it won't move because the power supply is disconnected.
We will connect it later, when we will begin the calibration phase.
Installing Eagle's ULPs for TwinTeeth
The User Language Programs are small pieces of code written in a C like syntax which can be used to access the Eagle data structures and create a wide variety of output files. Language Programs use the extension .ulp. and they must be installed in a directory configured in the Eagle Control Panel.
Run Eagle and go to the Control Panel. Open the Options->Directories menu to see where Eagle searches for ULP files.
Then unzip there the TwinTeethULPV2.0.zip file.
This file will install a directory called twinteeth-resources and a twinteeth.ulp file.
Now, we are going to check that they work fine.
Run Eagle and Open any schematic and/or board. To run the ULP, first you have to switch to the board view.
User Language Programs are executed by the Run command. Click on the icon.
A file selector will appear. Go to the directory where you installed the zip file and open twinteeth.ulp file.
You will see the TwinTeeth ULP window:
This window has two tabs with the labels: Drill Tool and Paste Dispensing Tool. The fist one contains the Drilling ToolHead parameters and the second one the Paste Dispenser Parameters. Once configured you can generate the files pressing the "Save G-code button". Files usually are saved in the same project directory.
We will describe how to use it in the following chapters. For the moment it is enough to check that you can run them.
The software is ready! Next step will be to calibrate the robot.
Assembly Index Home Next chapter