index

Principles Practices project management

Computer-aided design

Computer-controlled cutting

electronics production

3D scanning and printing

electronics design

molding and casting

programming

Computer-controlled machining

input devices

composites

interface and application programming

output devices

networking and communications

mechanical design, machine design

applications and implications

invention, intellectual property, and income

project development

final project presentations

 
           

20130330_145838

 

Input devices

In this assignment I chose to mill and program the Hello Mic board.

Milling the board:
The Fab Lab SP has one Modela MDX40A that has some difficulties with Fab Modules.
Helped by Luciano Betoldi (Fab Lab BCN) and Radamés Ajna (Fab Lab SP programmer), we succeeded running the Fab Modules described as follow:
First, we did some changes in this script from Detroit Infocus:

Link

Here are the Radamés Tutorial´s  changes:

Link

After that, we installed  the Modela MDX40A as “Generic Printer” and “Raw Queue”.
(When you connect the Modela via USB automatically these options will appear).
 We did the files with Fab Modules on the following way:

I´m using the GUARUX/Ubuntu 10.04 that is our OS that we use in our work with digital inclusion in Guarulhos city council named “Social Fab”. For more information go to my about link . Recently GUARUX was recognized by Department of Logistics and Information Technology of the Brazilian Ministry of Planning Federal Government as a “Brazilian Public Software”.
More information here.

Link

We can run the  Modela MDX40A + Fab Modules in GUARUX/Ubuntu 10.04 OS  this way:

  1. First we set the axis origin X, Y and Z coordinates with the Modela MDX40A software. (this was one limitation,  we couldn´t set the origin of the axis from Fab Modules)
  2. Disconnect USB cable from Modela MDX40A and connect to a laptop with Fab Modules. (The machine now has the axis origin  because it was recorded earlier)
  3. We send to the Modela the file via terminal:

Crtl + Alt + T (open the terminal)
Go to the file - in my case we did:
cd /home/professor/fablab/modules/
There are the files and the “rml_send”script.
Type: ./rml_send file name.rml
Enter.
The Modela will begin to work.

Soldering the board:


First important thing that I learnt in electronic production is about the importance of the components´ Datasheet. After several frustrations during soldering the components which was not functioning, I realized that the components need to be on a specific position to be soldered. So I remembered Neil´s class about Datasheet and began to work correctly. The MIC component in my board has the negative and positive terminals and checking the Datasheet´s  component:

Link

datasheet

 

datasheet2

I realized that the terminals of the component are different:

mic

image2993

So I compared the datasheet information with the real component and checked the terminal 1 +  and 2 -  positions to be soldered. So this was the resulting board:

 

20130330_145027

Programming the board:
The first board I did (MIC board) was not functioning with AVRmk2, I haven´t found the reason why this happened. I decided to program a second board that was a synchronous board.
After a struggle with Ubuntu 10.04 and the FDTI drivers, I checked that FTDI only works with UBUNTU 11.10:
About FTDI drivers and UBUNTU  Info here.

I worked with Cygwin/Win7 64bits and directed to Win7 64 –prompt.
I had success in both, but with Cygwin/Win7 64 with a specific command.

What is Cygwin?
Cygwin is a collection of tools which gives a Linux look under windows system.
I followed Providence Tutorial to install it in Win 7 64.

And checked Lining Yao tutorial from MIT Media Lab. I installed the following Cygwin packages:

So I needed Python, Pyserial and ActiveTcl (tkinter). You can follow the Providence tutorial.In general lines the packages:

Python is the program language that the code was written.

Pyserial is for the serial port.

Active TCL is a tool for programmers.

After installed Cygwin, I downloaded the board´s files  and extracted to the C:Cygwin/Home/. After this, I needed to install AVRISP MKII  drivers for Win 7 64.

A non programmer thinking: “Well I will install AVR Studio and a bunch of things will be installed, and so, the Win 7 64 drivers”.


After this I installed AVR Studio and the “Jungo” drivers appeared in my machine.
Googling it I knew that   "Jungo USB"  is not compatible with AVRdude, and we need the AVRdude.  So I googled one answer and I found this important  tutorial that showed me how to uninstall "Jungo USB"  and install the right AVRISP MKII drivers for Win7 64. I just followed the tutorial´s drivers and not the Arduino IDE configuration.
After this, I searched for the FTDI drivers for Win7 64, and here the tutorial.

If you have a doubt about FTDI drivers here are information in Portuguese.

Important thing:
I installed and uninstalled several times the FTDI drivers, and they ONLY worked when this numbers appeared: (TTL232R) that is the same related in FTDI Guide and in Providence tutorial.


Programming the AVRISPMKII

I opened the Cygwin terminal and  navigated to home folder, where all the class files were. In the terminal I placed the command:
make -f hello.light.45.make


and I got the success result!
I did another command to AVRISPMKII
make -f hello.reflect.45.make program-usbtiny

Returned an error:

Oops, Usbtiny is another programmer, the answer came after comparing with the classmate Jose Perez Lama´s  assignment page.

So I did another command:
make -f hello.reflect.45.make program-avrisp2
And it worked!

 

So I googled about serial ports in Cygwin and I found that the ports in Cygwin is opened this way:

/dev/com1 The serial ports, starting with COM1 which is the same as ttyS0. So COM2 the command is /dev/com1.

Well my port is 19 so I did:

python hello.light.45.py/dev/ttyS18

Assignment_10-python_3;

So, I suspect that was a Python problem, so I google the problem and I found a way to bring up any Windows program in Cygwin by this command: cygstart/cygdrive/c/my.docx ;

So, I tried this command to open hello.light.45 to test the Python: $cygstart/cygdrive/c/cygwin/home/Light/synchronous/ hello.reflect.45.py com19

To my surprise it worked!

 

Cygwin_Cygstart

For curiosity I changed the /dev/ttyS18 port as suggested in Cygwin documentation: $cygstart/cygdrive/c/cygwin/home/Light/synchronous/ hello.reflect.45.py/dev/ttyS18

Returned an error.

Another curiosity: I changed to Windows-prompt and voilà, it worked too!

Well, Cygwin or not Cygwin, the answer was that Cygwin only worked in this assignment with cygstart command.

Assignment_10_programming