Javier Vicente Sáez


FabAcademy 2018 [How to make (almost) anything]

Weekly assignment


About


Javier Vicente Sáez was born in Barakaldo (Bizkaia, Spain) in 1978. He finished his studies of Industrial technical engineering at University of Deusto in 1999. After that, he obtains the degree of telecommunication engineering in 2001. Since 2001, he is lecturer of the telecommunication department at University of Deusto.

At the same time, Begoña Garcia Zapirain and he form the Advanced Signal Processing group, in which he works as researcher. He obtains the Phd in computer science in 2016.

Contact Me



Principles and Practices


On Wednesday 17 we assist the First lesson with Neil Gershenfeld. It has been a pleasure to meet the MIT Team, other students and FabLabs. In that first day we had the opportunity to receive information about Principles and Practices, everything about FabLabs global network main idea. We find also the Fab Charter in the class schedule, FabLabs rights and responsibilities.

The assignment this week was to plan and sketch a potential final project, so I made some sketches around my idea. Basically, the main idea for my final project is: Modular Robot Curiosity.

In these times there is a lack of interest of the bachelor students in studying engineering. The students in bachiller have to choose between the human and the scientific branch. If they do not choose the scientific branch they can not study engineering. The few students who want to study engineering face another problem, they do not know how to differentiate each type of engineering. In Spain there are a lot of different engineering degrees and the student don´t know to choose between them.

To avoid this problem my faculty is planning action to achieve three goals.

  1. Encourage interest in engineering
  2. Explain the differences between each engineering
  3. Present Deusto as a possible university where study

My idea is to design a practical workshop based in a modular robot. In each workshop five groups will contest to see who sets the best robot. There will be tree different challenges: velocity, strength and agility. The students can change different items in the robot:

  • Wheels
  • propulsion
  • Sensor location
  • Software parameters
  • ...

The teams can choose between different types of wheels (Diameter,thickness, material..). So the will have to argue which is better for each of the challenge. The same for the propulsion system, they can choose between different types of gears. They will have to discover which one provides more velocity or more strength. These changes will have to be quick, so a plug-and-play system will be used, probably using magnets.

In the market exists a lot of educational robot kits, but all are focused in programing. None of the kits in the image allows a quick change of the components, without using a screwdriver or other tool. What I want to achieve in a modular system that allows to exchange the parts and modify your physical behavior, be quicker, be stronger... In this form in a two-hour session students can discuss aspects of engineering such as:

  • Mechanic
  • Design
  • Electronic
  • Software Development
  • Telecomunications
  • Management

You can find my final project scheme in the image below:

Close

Project Management


This week we have been taught how to use a version control system, GIT in particular. Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Personally I have used many times svn as a version control system, but git is not unknown to me.

The first thing I did was generate a certificate using puttygen, this certificate serves to identify you on the gitlab platform of the fabacademy.

Once the certificate was added to the gitlab platform, I installed git and Tortoisegit on my personal computer. TortoiseGit is a Git revision control client, implemented as a Windows shell extension. This tool shows context menu items for Git commands in Windows Explorer, making git very easy to use. I have chosen this tool because it´s the one that I use with svn, so it´s very familiar to me.

Once the setup of the git repository was finished, I started with my personal web development.

I searched a bootstrap-based template and I started to introduce my content.

First I try to use a web development editor as nvu, that is opensource.

But the although this tool have some useful characteristic this tool have been discarded, because the preview was not very good.

I´m using notepad++ to write the html code. This simple text editor is enough for me, because the template has all the styles and I only have to use four tags p for new text, img for include an image, a for include a link and video for include a video. This can be done using a simple text editor and view the result in a browser. The used template is a single file website, each week will be introduced in a div section and when you push it will popup that section.

For editing images gimp has been used. This tool permits me to cut the pictures and scale them to reduce the size of the pictures.

For video compression I have use avidemux. This tool permits open a video file and transcode it to x264 codec and MP4 container.

After I have finished the initial modifications I have sent all the content to gitlab doing a commit and a push, using the tortoisegit client.

.

Once you have select commit files you have to choose witch files you want to commit and also push to the server. You need to introduce a text to describe the commit.

In the previous picture there appear a lot of missing files, this is because in the first commit windows include a lot of unwanted files. To avoid this a rule was introduced in Gitlab in the file ".ignore".

	desktop.ini
	**/desktop.ini
				

After sending files to gitlab this message appears.

Close

Computer Aided Design


The work done this week was to learn how to use computer aided design tools. I have decided to practice with solidworks. The program allows you to model parts and assemblies and extract from them both technical drawings and other information necessary for production. It is a program that works based on the new modelling techniques with CAD systems.

It was important to use parametric design, so I have designed a parametric gear that I will used in the final project. I have added a design table to my gear model in which I can change the fundamental parameters, such as:




  1. Module
  2. Tooth number
  3. Pressure angle
  4. thickness

To design the parametric gear, first I create a sketch with a circle with the outer diameter and extrude it with the thickness. A name was given to the dimension of the diameter, to be able to vary it with the design table.

In another sketch the primitive and interior circumferences have been drawn. On these the profile of a gear tooth has been drawn. To finish, the cut has been extruded. The dimensions of this sketch have a name, so that they can be used with the design table.

Finally, a circular matrix has been used for the complete the gear.

Once the gear design has been completed, a design table has been added to automatically generate all gear variants.

In the row of this excel sheet there are the variants to create, the dimensions of the design in the columns on the left and design parameters in the columns on the right. I introduced as many rows as different gears I want to design and y the columns of the right the parameters of each gear.

Click here to download the solidworks file of the parametric gear.

Once the parametric gear was designed I decided to design a gear box, so I can advance with the final project design. Click here to download the design files.

To implement this gearbox 4 different gears have been used, using the parametric designed. The first gear is a 15 tooth's gear with a 2 module and 3mm of thickness. In the center there is a gap with cross form. The shaft will be introduced in his gap.

Click here to download the DXF file.

The second gear is a combination of two gears. One of this gears have 25 tooth's a 2 module and 3 mm of thickness. The gear has a gap to insert the next gear and press fit then.

Click here to download the DXF file.

The other gear has 15 teeth's and 8 mm of thickness. The gear has a circular gap this way the shaft can rotate free.

Click here to download the DXF file.

The two gear together are shown in the nest figure.

The last gear has 25 teeth's a 2 module and 3mm of thickness. The gear has a gap in the center with cross form.

Click here to download the DXF file.

For the box 3 pieces have been designed

Click here to download the top DXF file.

Click here to download the side DXF file.

Click here to download the front DXF file.

KeyShot

The assemble from SolidWorks has been extorted to KeyShot to make a render. Keyshot is a rendering and lighting program developed by Luxion.

But the software tested is an evaluation edition so the render has a watermark an is not usable.

Rhinoceros

Rhinoceros has been used to post-process the generated DXF from SolidWorks. The SolidWorks at the university is an educational edition and it introduce a water mark in the DXFs. This water mark can be deleted using rhinoceros.

Selecting the watermark in rhino and pressing delete is possible to delete de watermark.

Then you can select the rest of the file and pressing the join button you can convert all the individual lines to two closed polygons.

Download Files

Zip File with the design files and DXF files.

Close

Computer-Controlled Cutting


GROUP ASSIGNMENT

My FabAcademy mate is Leire Bereziartua in Deusto Fablab, and we have the pleasure to work with the EPILOG Laser FUSION CO2 75 Watts Machine.

This machine allows us to cut and engrave different material, always "soft" materials, which can be woods, PMMA, cardboard or leather, among others (but never PVC, be careful due to its toxicity). Its work maximum area is about 800x500 mm, and we can work in it with two CO2 laser lens, which are replaceable. We call them short and long lens, and normally used is the short one.

The works we can do are cut and partial cut in Vector operating mode, and engraves in Raster mode.

As we have several types of material in the laboratory, comes well to have samplers and one of the work to do is to try different settings, we have made the following DM engrave sampler (prepared first in Rhinoceros):

Rhinoceros File to create the sampler

DM different engrave settings sampler

We know that this setting is just for that material piece today (due to its humidity and hardness), but the idea is to create samplers to all materials we have, over time. We think is good to have an idea around what values we can begin to make tests when we are going to use the laser-cut machine in the future.

You can find the complete files (.3dm and .dxf) here.

First of all, we took the .dxf file we found and we prepared it by layers to be able to send the different works to the machine: Cut (red) and Partial Cut (blue). The other layer we had to create has been Material (black) one, with No Print setting, to help us centering the designs in the material we have. See the image below:

Parametric Kerf Templates prepared to send to Laser Cut Machine

We send the Partial Cuts first. For woods is better to do first this kind of works (like engrave) due to the machine Kerf. When we "cut" with the laser the material is volatilized, and remains a gap between the cut pieces, so that with the movement of the subsequent works they can be moved, and we are not interested on it.

The values we used to this work are: Vector, 60 Speed, 30 Power and 85 Frequency.

1st work to send to the machine: Vectors to Partial Cut

The values we used to cut, later, are: Vector, 8 Speed, 90 Power and 85 Frequency.

2nd work to send to the machine: Vectors to Cut

It's important to prepare the origin of the machine (0,0,0) in the place we have defined it in the digital file, so we have to make the focus (set the Z axis in 0, to tell the machine the thickness of the material we are going to use) and the Jog (X and Y axis in (0,0), up-left corner in our case). For all these settings we have the command screen with a Joystick in the Epilog Laser Machine.

Close the machine door, switch on the fans and GO with the works!

After finishing the Cut work is good to check if the pieces are well cut, but carefully not moving the different parts, because if we have to repeat the operation we need it just in the same-same place.

In our case the edges were well cut but maybe too much because they are so burned. :S

Parametric Kerf Templates being laser-cut

In the two images below you can see the 9 Parametric Kerf Templates made in 3mm thickness DM wood, and me testing them and having fun with it!

Parametric Kerf Templates finished

Testing different kerf elasticity

In these days we have found another Parametric Kerf Templates, Living Hinge Swatches (see my group parner Leire in the image below). We have prepared the Rhinoceros file with all layers to made them in the laser cut machine when we have more time. Work to the future!

Another templates we found

To see the complete files (.3dm and .dxf) click here:Parametric Kerf and Living Hinge Swatches.

INDIVIDUAL ASSIGNMENTS

First I started with the vinyl cutter. I designed a text label for my final project, with the text "DeustoRobot v1.1". This label was designed in Rhinoceros. Click here to download the file.

In Deusto Fablab the VinilCut Machine we have is Roland GS-24. Its maximum cut area is about 584x25000 mm, it can cut materials with thickness below 0.5 mm and it has an optical sensor which allows us to put the piece of material in the machine and to size its cut area automatically. The Power and the Speed are specified in the machine menu just to be able to cut all the vinyl materials we have in the laboratory, but we have to make tests and change them if its needed in the case we carry a new material. The parameters it has now, predetermined, are speed 20 m/s, power 20gf and offset 0.25 mm.

Once the design is completed this is sent to the vinyl cutter. In Deusto Fablab we have the Roland GS-24.

After cutting the vinyl I had to remove the unwanted material, this is done with a hook.

Once I have removed all the unwanted material I putted the transfer material, to be able to put the vinyl in the desired surface.

This is the result vinyl with the transfer before putting it in the final surface.

In the next picture can be shown how I began to put the vinyl in the furniture that will store the final project.

As can be shown in the next figure the final result is not as good as expected. Same letters are bad placed. This was my first experience with vinyl. The problem was that the letters were detached from the transfer and placed in the wrong place.

Laser Cutting

Before doing the pressfit with cardboard the pieces designed the previous week has been cut with the laser. First a simple gear have been cutted as a try.

In rhino the gear design has been added to a previous cut pattern to reuse the remaining material.

Before sending the design to the laser the properties of the power and speed have been introduced. I went to print menu and I set parameters to cut: Vector, speed 8, power 60, 90

In the next figure the cutting process can be shown.

In this picture all the cut pieces can be shown.

This is the final result, a functional gear box.

Press Fit

The designed file for the press fit task can be downloaded using this link. To design the model SolidWorks have been used and then exported to a dxf file.

In SolidWorks three equations have been defined: The Width, the height and the thickened.

Then tthese equations have been used to define dimension of the piece.

Also the cuts made to the piece have been defined using the 3 parameters. So if one of this parameters change all the piece will change.

In the next figure the cutting process can be shown.

In the next figure the cut cardboard can be shown.

In the next picture an assembled figure using the pressfit can be shown.

Download Files

Gear Box DXF files.

Press Fit Solidwork File.

Press Fit DXF File.

Vinyl cutter Design file

Close

Electronic Production


GROUP ASSIGNMENT

My FabAcademy mate, Leire Bereziartua, and me have to use the ROLAND MDX-40A machine to mill our PCB.

The MDX-40A High Precision CNC Milling Machine produces affordable and highly accurate prototypes from a wide variety of non-proprietary materials with greater precision and excellent surface finish.

Our ROLAND MDX-40A Machine

In this machine: X, Y, and Z operation strokes are 305 (X) x 305 (Y) x 105 (Z) mm.

And the software's we have used are: Dr.Engrave and V-Panel. They are Roland specific drivers, which allows us to control the files we are going to engrave and cut, and machines parameters. None the less, we want to make tries with FabModules to master the control of the machine using this platform.

Dr. Engrave is a user-friendly program to engrave plates. It supports variable data, so you can engrave the same design on a series of plates with variable text or numbers. You can also engrave the space on the inside of a selected vector or text. The software can also detect the outline of an image and convert it to lines.

VPanel is a program to operate the modelling machine on the computer screen. It has functions to output cutting data, perform maintenance, and make various corrections.

You can find the document we have followed to make our in-circuit programmers here. It is the ATtiny45 process Brian has used to build his FabTinyISP.

But, first of all, we needed to prepare the files from .png to .bmp, the file type Dr.Engrave uses to prepare the milling.

We opened Adobe Photoshop and we mesh Traces and Outline CutOut .png files maintaining the 1000dpi property. Then, the work was to obtain the perfect traces width and to optimize the engrave action of the machine, by using offsets, not to take time removing cupper “for nothing” in some sides.

>It is important too, having a 1000dpi file, to know the exact dimensions the PCB has to have:

Once we have the .bmp file, we Import it in Dr.Engraver. To see the .bmp file click here.

The work to do is:

_ Re-mesure included .bmp image size and re-sized it (47,12x15,88 mm) based on the 1000 dpi.

_ Separate all lines, and unify together the lines that compose traces. This action will simplify the selection of lines to each action: Engrave and Cut.

_ Select Traces line-group and Fill Setup with a Pitch of 0.1 (it depends always on the tool we are using, explained below), without “Contour”. The tool path is created on the inner side of the object.

Then we have to send them to mill.

For this action, we have to prepare the machine: Material and axis origins (V-Panel).

We can use two materials in the PCB milling process:

• FR4: epoxy glass. We won't use it as is dangerous for health and also because the tool will wear out fast

• FR1: not as good at high temperatures but it machines beautifully.

We chose FR1, and we attach it to the machine using the Sacrifice layer: what you put on top of the machine in order not to break the base metal. In our case it is a piece of DM with threaded holes to be able to join the material.

ENGRAVE ACTION

The tool we chose for engrave milling is 0.1mm Carbide Engraving Bits CNC Router Tool for PCB Board.

We put it in the machine head, carefully, due to its fragility and, using V-Panel, we set X, Y and Z origins. For setting Z origin we have a sensor you can see in the images below:

Back to Dr.Engrave we select “print” mode and in Properties we set up all the engrave parameters we need to make traces with the tool we are going to use. As we use Engraving Tool in V, good to engrave small and detailed items, we need to calculate how much the Z DOWN position had to be not to remove too much cupper, it would erase the Traces in that case and it is not good!

Parameters we used are:

_ Speed (X, Y, Z): 2 mm/s

_ Fill pitch: 0,1 mm

_ Spindle RPM: 10.500 rpm

_ Z UP Position: 1 mm

_ Z DOWN Position: -0,17 mm

_ Z engraving Pitch: 0,17 mm

And we send to “print” the selection:

CUT ACTION

For doing the Outline Cutout we had to change the tool. In that case the tool we used has been 1 mm Straight End Mill, suitable for cutting flat items.

We have set again the Z origin, and after selecting the outline, the parameters we used for make the cutting action were:

_ Speed (X, Y): 1 mm/s

_ Z Speed: 0,5 mm/s

_ Fill pitch: NO

_ Spindle RPM: 10.500 rpm

_ Z UP Position: 1 mm

_ Z DOWN Position: -1,6 mm

_ Z engraving Pitch: 1,6 mm

And we send to “print” the selection:

All has gone fine in the first try so we are so happy!

INDIVIDUAL ASSIGNMENT

Once the board was cutter I took the components from the inventory and solder them in the board. I forgot to take a photo of the components before solder them in the board. In the next picture the used BOM can be shown and the resulting board.

In the next picture soldering the board.

In the next picture the detailed board can be shown.

To program the TinyISP an Arduino Uno as ISP has been used, the connections can be shown in the next picture.

First I had to download the sketch for converting the arduino board to an ISP programmer.

The next step was program the firmware to the tinyISP using the arduino. I had to change the makefile to use the Arduino ISP.

# Generic AVR Makefile - Adapted for FabTinyStar
# Brian Mayton 
#
# 'make' builds the .hex file.
# 'make flash' uses the programmer to load it onto the target chip.
# 'make fuses' programs the fuse bits on the target chip.
# 'make rstdisbl' blows the reset fuse.
# 'make clean' removes all autogenerated files.

# OBJECTS should list all of the object files for the program (e.g. for each
# .c file, list a corresponding .o file here.)  APPLICATION just specifies the
# name of the hex/elf files, and can be whatever you want. 
OBJECTS = main.o usbdrv/usbdrv.o usbdrv/oddebug.o usbdrv/usbdrvasm.o
APPLICATION = fts_firmware

# Set up which MCU you're using, and what programmer, and the clock speed
# here.
MCU = attiny45
PROGRAMMER ?= avrisp 
F_CPU = 16500000UL

# Fuse bit settings
EFUSE=0xFF
HFUSE=0xDD
LFUSE=0xE1

# Fuse bit settings with reset pin disabled
HFUSE_RSTDISBL=0x5D

# Edit these if you want to use different compilers
CC = avr-gcc
OBJCOPY = avr-objcopy
SIZE = avr-size
AVRDUDE = avrdude

# Compiler and linker flags
CFLAGS=-mmcu=$(MCU) -Wall -DF_CPU=$(F_CPU) -I. -funsigned-char \
	-funsigned-bitfields -fpack-struct -fshort-enums -Os -Iusbdrv
LDFLAGS=-mmcu=$(MCU)

all: $(APPLICATION).hex

clean:
	rm -f usbdrv/*.o
	rm -f *.hex *.elf *.o 

%.hex: %.elf
	$(OBJCOPY) -j .text -j .data -O ihex $< $@

$(APPLICATION).elf: $(OBJECTS)
	$(CC) $(LDFLAGS) -o $@ $^
	$(SIZE) -C --mcu=$(MCU) $@

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

%.o: %.S
	$(CC) -x assembler-with-cpp $(CFLAGS) -c $< -o $@

flash: all
	$(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -P /dev/ttyACM0 -b 19200  -e \
		-U flash:w:$(APPLICATION).hex 

fuses:
	$(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -P /dev/ttyACM0 -b 19200 \
		-U lfuse:w:$(LFUSE):m -U hfuse:w:$(HFUSE):m \
		-U efuse:w:$(EFUSE):m 

rstdisbl:
	$(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -P /dev/ttyACM0 -b 19200 \
		-U lfuse:w:$(LFUSE):m -U hfuse:w:$(HFUSE_RSTDISBL):m \
		-U efuse:w:$(EFUSE):m 

.PHONY: all clean install fuses


			  

After that I burn the firmware in the tinyISP.

Next step was write the fuses.

Finally disable the reset Pin.

I checked the tinyISP with a dmesg command and see if the USB device appear.

Close

3D scanning and Printing


GROUP ASSIGNMENT

My FabAcademy mate, Leire Bereziartua, and me have been testing design rules for those two 3D printers.

We knew that in Thingiverse or Yeggi websites we could find some 3D printer testing files, so we download 3 of them, and made tests with them to know our printers limitations:

FDM/FFF

We have made two 3D printer tests. [You can find here 3D files: 1st test file and 2nd test file]

The first one is a smaller part (see the image below, named Test FDM A), 50x50 mm, but we thought to begin with this one, because was the first time we were using this machine.

We took the .stl file from the compressed file we downloaded using Thingiverse, and we opened it in Cura 3D Slicer.

Cura Slicer allows us to create our machine personal settings (if it is not one of commercial models Cura has in its database), and not only with the print area size, we can create a setting for each Prusa I3 we have in the lab. We created one with 2.85 mm Material Diameter, but we can have different one too for when we are using 1.75 mm.

We can also use recommended configuration (which is very easy and with almost no option) or Custom one. If you go to Custom configuration, you besides can customize parameters menu, depending on what we want to configure.

The setting list we have used for Test A is:

So, if we take Cura project for this first test, and activate Layers View, we can see how much layers and how is going to make our printer in an hour and 5 minutes.

Saved the file to a SD card (it save in .gcode), we went to the machine, Prusa I3. We insert the SD and then a list of projects appeared in its screen. We selected our printing project using the wheel-joystick it has.

The menu of the printer is very simple, tree-structured and with a back option in each screen or mode. The use of the menu is always with the wheel-joystick it has, and it has also a Stop button to stop machine immediately if it is needed.

The only thing we changed, while it was heating up, has been Speed mul to 50% of its speed. It is good to do this in the first layers to see if the printing process is beginning well.

It heat up the Bed Temperature first, then the Extrusion Temperature.

When the machine is heated up it goes to the origin, and then it goes directly to make the first layer. But is important to configure at least Skirt build plate adhesion, due to the exit-delay of the extruded material.

In this case, Deusto FabLab Prusa printers have vinil adhesive pieces in the hot platforms to ensure that the printed part is not going to Warp.

We have to be attentive in this first layer, if it is going well we have only wait until it is finished.

The result of our first Printing Test is next one:

It has, being a Low Quality printing, really good finish and we can check hole diameters for example, but we can’t see the numbers or small details. So we made next Test B in a better quality.

Test B is a larger part, 100x100 mm, and we are going to print it with the option of Profile: Fine 0.1 mm and all rest of settings same to Test A.

We took the .stl file from the compressed file we downloaded using Thingiverse, and we opened it in Cura 3D Slicer.

Whole process in the images below:

The result has been better than the first. More detailed, and even though we did not think it was going to come out that way, it has printed well up to the angles of 85º. :)

SLA

Test part we have chosen to print it in SLA is the next one:

It that case Form1+ printer has its software Preform, and the first thing to do is to select the material we are going to use and the quality of the printing. We choose Clear photopolymer and not the higher but a very good quality: 0.05 mm layer thickness.

We opened the .stl file in Preform, and it follows three steps: Situation (XY position), Orientation (angle) and Supports.

In bottom-up SLA printers overhangs and bridges need to be supported, but minimizing the cross-sectional area of each layer is the most crucial criterion: the forces applied to the part during the peeling step may cause it to detach from the build platform. These forces are proportional to the cross-sectional area of each layer. For this reason, parts are oriented in an angle and the reduction of support is not a primary concern.

It is such automatic process (it has buttons in each sections to it) but reading in FormLabs sites it is better to do the orientation thereby: 60º Y + 30ºZ.

The support, being very little parts, with the minimum (touching) point, and we have duplicated the file for doing one with internal supports and the other without.

We send them two to the printer, which name is ImpartialDuck ;)

We have to be sure that the platform is well mounted and the resin tank is full of material (between Min and Max marks), and GO!

This first SLA print has gone wrong:

They are not entire parts. What could be the problem? We analyze the platform and it was very dirty, we unstick material, and helped with Ethylic Alcohol we cleaned up it.

In this case, for the second test try, we thought that it was interesting to print a little sphere too: in those kind of parts we can see the continuity of the printing layers in an easier way.

So we prepared it in Preform, and we continue printing. And it was wrong! First layers weren’t attached to the platform.

Why? After reading some all-around world users experience we realize that due to the platform material (aluminum) after months of use of the machine (it has 3 years) has been erode. And the origin of the machine in its initial times has been changed, it was upper than when it has been acquired.

The solution has been to do Fine Tuning to the Form1+. After probing it with 0.1 mm and having a wrong attachment of first layers to the platform, we made a test with 0.2 mm fine tuning parameter, and woala! It went well and we print the sphere and the test file we have downloaded.

We took the resultant parts and we made the process of cleaning them. (Deusto FabLab has planned to acquire Wash and Cure system in next months)

After it, and with the illusion of testing the capacity of this machine, we scale test file x3, and we send it to print. But there is something wrong in the machine which is making the print only till a layer, and then fails. So we have work analyzing this error and finding which is the solution.

Individual Assignament

3D scanning

We have Sense 3D Scanner in Deusto FabLab, this is the scanner that I have use. For this task we have scanned ourselves. I scanned Leire and Leire scanned me. We have use the software of the scanner.

The first option of the scanner´s software is to scan a person or an object. We tried first scan using the person option. But it had a lot of errors and the software hangs. It was because the computer connected to the scanner have very low resources and it can´t handle the task of scanning with person profile. So we used the object profile.

Then we selected medium size object and began the scanning process. we sat on a chair and started spinning while we were scanned.

The final scanner had some error that were fixed using the correction tool of the software. For example, the ears.

Also I had to correct the button part of the eyes.

This is the final result of the scanning, the model can be downloaded using this link.

3D Printing test

Before designing a 3d model and printing it I decided to make a printing test with and old 3D scanner model.

First I used MeshLab to reduce the complexity of the model.

Then I used NetFabb software to cut the model.

With this software I remove the button part of the body leaving only the head.

Once I had the STL file I used Cura to generate the gcode for the 3D printer. I printed the model using PLA plastic, with a 25% of filling.

I change form recommended setup to custom setup to change same parameters. Change the infill from 20% to 25%, setting the temperature to 210º.

The result of cura was a gcode file that I introduce it in the printer and began the printing process. I had to stop the printing because it was not fine. The problem was that the base wasn´t well levelled. So I had to level the base plate and begin again the printing.

I notice that I use a raft base and may be it wasn´t necessary.

This is the final result of the printing where the supports can be shown.

This is the final result after the remove of the base and the support. After this test I was able to design a model and print it.

Design a 3D model and Printing it

I decided to design some pieces for my final project. A wheel and the wheel cover, printing the cover using flexible plastic. This cover it's very difficult produce it. But using 3D printing its very simple. First I modelled the cover, using this link the solidworks file can be downloaded.

Then I converted the solidworks design to a stl file, that can be downloaded using this link. I used this STL file with cura to generate the gcode for the 3D printer.

Before printing the model, I had to change the filament and put the filaflex filament. I had to use a special support to use this type of filament.

In the next figure the printing process can be shown. I forgot to change the base type.

In the next figure the printing almost finished can be shown.

Here the final result of the wheel cover.

After that I designed the wheel, the solidworks model can be downloaded using this link.

I converted the solidworks model to a STL file and I used cura to generate the gcode file. The STL file can be downloaded using this link.

In this picture the final wheel can be shown.

In this picture assemble of the cover and the wheel can be shown. I had to use a screwdriver to introduce the wheel inside the cover.

Close

Electronic Design


I redesigned the echo board using eagle adding a LED and a Button. The designed schematic can be downloaded in this link. The schematic can be shown in the next picture. As can be shown in the picture I made a mistake connecting a pull-down resistor in the reset pin instead of a pull-up. I discover this after soldering the board so I had to cut a path and solder it to VCC.

After making the schematic I began designing the PCB. The first step was to place the components in a good place to simplify the routes.

In the next picture the placed components can be shown.

The next step was route the board as simple has possible. I used the internal connection of the button has a jumper for the ground net, as can be shown in green colour in the next picture. In blue colour the mistake with the pull-down can be shown.

In the next picture the resulting PCB design can be shown, the board can be downloaded in this link.

To obtain the image for the milling a square in the milling layer was added.

This python code converts the board to an image that can be used in the milling machine.

This is the resulting outline file.

This is the png file but it had same little point that I remove with gimp.

The final image for the PCB.

I made a render of the board with https://3dbrdviewer.com/ website

I had to add some component not detected by the website.

This is the final render.

In the next picture the milling machine working can be shown.

This is the milled board. The traces are very fine because the Z engraving Pitch was bigger than needed. But it worked.

This is the list of the component used.

This is the finished board, before the correction of the reset pull-up.

To test the board, the echo program was modified to include the button and the led.


//
//
// hello.ftdi.44.echo.c
//
// 115200 baud FTDI character echo, with flash string
//
// set lfuse to 0x5E for 20 MHz xtal
//
// Neil Gershenfeld
// 12/8/10
//
// (c) Massachusetts Institute of Technology 2010
// This work may be reproduced, modified, distributed,
// performed, and displayed for any purpose. Copyright is
// retained and must be preserved. The work is provided
// as is; no warranty is provided, and users accept all 
// liability.
//

#include <avr/io.h>
#include <util/delay.h>
#include <avr/pgmspace.h>

#define input(directions,pin) (directions &= (~pin)) // set port direction for input
#define output(directions,pin) (directions |= pin) // set port direction for output
#define set(port,pin) (port |= pin) // set port pin
#define clear(port,pin) (port &= (~pin)) // clear port pin
#define pin_test(pins,pin) (pins & pin) // test for port pin
#define bit_test(byte,bit) (byte & (1 << bit)) // test for bit set
#define bit_delay_time 8.5 // bit delay for 115200 with overhead
#define bit_delay() _delay_us(bit_delay_time) // RS232 bit delay
#define half_bit_delay() _delay_us(bit_delay_time/2) // RS232 half bit delay
#define char_delay() _delay_ms(10) // char delay

#define serial_port PORTA
#define serial_direction DDRA
#define serial_pins PINA
#define serial_pin_in (1 << PA0)
#define serial_pin_out (1 << PA1)
#define button_pin_in (1<<PA3)
#define led_pin_out (1<<PA7)

#define max_buffer 25

void get_char(volatile unsigned char *pins, unsigned char pin, char *rxbyte) {
   //
   // read character into rxbyte on pins pin
   //    assumes line driver (inverts bits)
   //
   *rxbyte = 0;
   while (pin_test(*pins,pin))
      //
      // wait for start bit
      //
      ;
   //
   // delay to middle of first data bit
   //
   half_bit_delay();
   bit_delay();
   //
   // unrolled loop to read data bits
   //
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 0);
   else
      *rxbyte |= (0 << 0);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 1);
   else
      *rxbyte |= (0 << 1);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 2);
   else
      *rxbyte |= (0 << 2);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 3);
   else
      *rxbyte |= (0 << 3);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 4);
   else
      *rxbyte |= (0 << 4);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 5);
   else
      *rxbyte |= (0 << 5);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 6);
   else
      *rxbyte |= (0 << 6);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 7);
   else
      *rxbyte |= (0 << 7);
   //
   // wait for stop bit
   //
   bit_delay();
   half_bit_delay();
   }

void put_char(volatile unsigned char *port, unsigned char pin, char txchar) {
   //
   // send character in txchar on port pin
   //    assumes line driver (inverts bits)
   //
   // start bit
   //
   clear(*port,pin);
   bit_delay();
   //
   // unrolled loop to write data bits
   //
   if bit_test(txchar,0)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,1)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,2)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,3)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,4)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,5)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,6)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,7)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   //
   // stop bit
   //
   set(*port,pin);
   bit_delay();
   //
   // char delay
   //
   bit_delay();
   }

void put_string(volatile unsigned char *port, unsigned char pin, char *str) {
   //
   // print a null-terminated string
   //
   static int index;
   index = 0;
   do {
      put_char(port, pin, str[index]);
      ++index;
      } while (str[index] != 0);
   }

int main(void) {
   //
   // main
   //
   static char chr;
   static char buffer[max_buffer] = {0};
   static int index;
   //
   // set clock divider to /1
   //
   CLKPR = (1 << CLKPCE);
   CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0);
   //
   // initialize output pins
   //
   set(serial_port, serial_pin_out);
   output(DDRA, serial_pin_out);
   
   output(DDRA, led_pin_out); 
   input(DDRA, button_pin_in); 
   set(PORTA, button_pin_in); // turn on pull-up
   
   //
   // main loop
   //
   index = 0;
   while (1) {
      get_char(&serial_pins, serial_pin_in, &chr);
      put_string(&serial_port, serial_pin_out, "hello.ftdi.44.echo.c: you typed \"");
      buffer[index++] = chr;
      if (index == (max_buffer-1))
         index = 0;
      put_string(&serial_port, serial_pin_out, buffer);
      put_char(&serial_port, serial_pin_out, '\"');
      put_char(&serial_port, serial_pin_out, 10); // new line
      }
	  
	   if(pin_test(PORTA,button_pin_in))
	  {
		 set(PORTA,led_pin_out); 
	  }else{
		 clear(PORTA,led_pin_out);
	  }
   }

				

The download the program and the make file.

Also a simple program that turn on the led when the button is pressed have been try. The button is connected to the PA3 pin and the led in the PA7. So the DIRA PIN7 must be 1 to configure PA7 as an output. Then the status of the PINA3 is checked in the PINA register making a Bitwise AND. IF the result is 0 the PA3 pin is low if the result is different than 0 the PA3 is high.

				
// ------- Preamble -------- //
#include <avr/io.h>

int main(void) {
  // -------- Inits --------- //
  PORTA = 0b00001000;  						/* initialize pullup resistor on our input pin by setting bit 3 of register PORTA high. */
  DDRA = 0b10000000;                        /* set up pin 7 of port A for output by setting bit / of register DDRA high.*/

  // ------ Event loop ------ //
  while (1) {
   	 										/* look for button press */
     if ((PINA & 0b00001000) == 0 ) { 		/* test to see if bit 3 of PINA is low  */
	  PORTA = 0b10000000;                   /* turn on LED on pin 7 of port A if bit is low (button is pressed) */
    }
    else {                                  /* otherwise */
      PORTA = 0b00000000;					/* leave output low.*/
    }
   }										
											/* End event loop*/
  return (0);	
 }

				
			 

The download the program and the make file. The working board in the next video.

GROUP ASSIGNMENT

Once Leire Bereziartua and me have our PCB soldered, we test equipment in our lab to observe the operation of a micro-controller circuit board.

First of all we soldered the FTDI-SMD-HEADER (6-pin header), as I comment up in the individual assignment, and we connect 5V to it. With the digital multimeter we verified if each connector first of soldering the other components, to avoid burning them later, if it is not working well. Then, we use it to verify every connection pins and traces too, while we were soldering the other components. A digital multimeter (DMM) is a test tool used to measure two or more electrical values—principally voltage (volts), current (amps) and resistance (ohms). It is a standard diagnostic tool for technicians in the electrical/electronic industries.

Then, when we have PCB programmed and connected to the computer, we use the oscilloscope. An oscilloscope is a type of electronic test instrument that allows observation of varying signal voltages, usually as a two-dimensional plot of one or more signals as a function of time. Other signals (such as sound or vibration) can be converted to voltages and displayed too.

With this tool we could see the timescope of the serial port of the "saying Hello world", the protocol of the image is RS-232.:

Computer-Controlled Machining


My final project hasn't something Big, so I had to thing what to build. Finally, I decided to something that I wanted to build since a long time. A bartop Arcade machine. Something similar to the image above.

First I started with the design in SolidWorks. Starting with the side panels, giving them the desired shape.

Then I designed the panel of the buttons and the panel for the monitor. The preliminary design can be download in this link.

Once I had the basic design, I modified it to create the joints. So that the assembly could be done with pressfit, without using nails or tail.

The final design files can be downloaded in this link.

After finishing the design, I had to generate the dxf file with all the planes of the pieces to be cut. The dxf file can be downloaded in this link.

In this image the shape of the joins can be shown. This type of shape is necessary because the milling machine have a round tool, so square corners can't be done.

The Vcarver pro is the software that we have used to prepare the work for the milling machine.

First we have introduced the dimension of the working area of the milling machine, define The position of the 0,0 point at the left button and the units.

Then we have imported the design files form the dxf file.

The next step was to close the perimeter of the shapes.

After that, we reordered the parts in the board area, to optimize the material. Lifting the blank area on the right to be able of reuse the rest of the board to be used in another project.

The next step was defining the travels of the tool, if it is inside or outside of the limit.

I had also to define the tool.

  • 6mm tool
  • Deep pass of 17mm
  • step of 2.1mm
  • 18000 rpm

If the entire periphery is cut, the piece can vibrate, so it is necessary to define some tabs to hold the piece.

Now I do the same but for the interior cuts.

In this figure a simulation of the travels can be shown.

In this picture the material has been put in the machine and the vacuum activate to hold the material.

I this picture I am controlling the machine to find the origin position.

In this picture I am setting the XY origin.

In this picture the resulting cuts can be shown.

As you can see there are some burrs that I have removed using a lime.

Here I am starting the assembling using a hammer to press the parts.

Here I am using a paste to fill the gaps to make the surface smooth.

Here I am painting the bartop.

Almost painted the bartop and starting the electrical part.

Placing the speaker in the top. I forgot to drill same holes for the speaker so I did them with a drill.

In this picture the buttons have been placed.

Testing a good place for the bartop in my living room.

The next step was to check the buttons using an external monitor.

When I find a monitor that I could use in the bartop I notice that it was not possible to use it. Because the monitor has some button in the frontal panel that will be pressed with my model. So I had to design a frame with a gap for the buttons.

I used the Laser cutter for make this frame.

Here can be shown the monitor placed in the bartop.

The first test of the machine with the Street Fighter 2 game.

Close

Embedded Programming


GROUP ASSIGNMENT

This week my FabAcademy mate, Leire Bereziartua and me have compared the performance and development workflows for other architectures. We have tried stm32 and ESP32.

STM32 architecture

The STM32 is a family of microcontroller of the ST Microelectronic company. This type of microcontrolles is based on Cortex-M architecture. In partitular we have probe the STM32F401RE. This microcontroller have and Cortex-M4 microcontroller. For the test we have used the Nucleo F401RE board. The program is very easy only configure and output pin and tongle it in a loop, so we can measure the change frequency with and oscilloscope.

We have test a basic program in this microntrollers using diferent methods:

  1. Register level configuration.
  2. Using manufacturer HAL library.
  3. Using a configuration wizard, STM32CubeMX
  4. Using Mbed
  5. Arduino in STM32

STM32: Register level configuration

Using register level configuration is the lower configuration method. It´s the most complicated one but is in witch you have more control of the microcontroller. The code we used is below this line, and all the project can be downloades using this link.

		
		#include "stm32f4xx.h"

		#define RCC_AHB1ENR 	(*(volatile uint32_t *) (0x40023830))

		#define GPIOA_MODER 	(*(volatile uint32_t *) (0x40020000))
		#define GPIOA_OTYPER 	(*(volatile uint32_t *) (0x40020004))	
		#define GPIOA_OSPEEDR 	(*(volatile uint32_t *) (0x40020008))	
		#define GPIOA_PUPDR 	(*(volatile uint32_t *) (0x4002000C))	
		#define GPIOA_IDR 		(*(volatile uint32_t *) (0x40020010))	
		#define GPIOA_ODR 		(*(volatile uint32_t *) (0x40020014))	
		#define GPIOA_BSRR 		(*(volatile uint32_t *) (0x40020018))		

		int main(){

			RCC_AHB1ENR|=0x11U;
			
			//Salida LED
			GPIOA_MODER&=~(3<<2*5);
			GPIOA_MODER|=1<<2*5;
			GPIOA_OTYPER&=~(1<<5);
			GPIOA_OSPEEDR&=~(3<<2*5);
			GPIOA_OSPEEDR|=1<<2*5;
			GPIOA_PUPDR&=~(3<<2*5);
				
			while(1){
					GPIOA_ODR^=1<<5;
			}
		}

		

The RCC_AHB1ENR registed enable the clock signal to the desired ports. Assigning 0x11 the gobal GPIO and the GPIOA are enabled.

The GPIOA_MODER registed define the tipe of the pin, configuring it as output.

The GPIOA_OSPEEDR registed define speed of the pin.

The GPIOA_PUPDR registed define port pull-up/pull-down.

The GPIOA_ODR registed define the output value of the pin.

As can be shown in the picture below a frequency of 800kHz have been reached.

STM32: Using manufacturer HAL library

The manufacturer provide us a library call HAL (Hardware Abstraction Layer). This library simplify the configuration of the peripherals of the microcontroller. link. You can chosee in keil uvision witch librarys include in your project.


The code using this library is more simple. You can use a data structure to define the configuration of the GPIO and then call a funtion to configure the GPIO.

			
			#include "stm32f4xx.h"
			#include "stm32f4xx_hal_gpio.h"
			#include "stm32f4xx_hal_rcc.h"
			#include "stm32f4xx_hal.h"

			GPIO_InitTypeDef GPIO_InitStructure; 

			int main(void) {

					
				__HAL_RCC_GPIOA_CLK_ENABLE();
				GPIO_InitStructure.Pin   = GPIO_PIN_5;
				GPIO_InitStructure.Mode  = GPIO_MODE_OUTPUT_PP;    
				GPIO_InitStructure.Pull  = GPIO_NOPULL ;
				GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;  
				HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);    


				while (1) {
						HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
			   }
			}

		

As can be shown in the picture below a frequency of 616kHz have been reached, a bit lower than the previus probe.

Using a configuration wizard, STM32CubeMX

The STM32CubeMX is a graphical tool that allows a very easy configuration of STM32 microcontrollers and the generation of the corresponding initialization C code through a step-by-step process. Using this tool is very easy to configure the correct clock rate.


The STM32CubeMX is a very good tool, it generate the initialization code and you have only to write the user code. The code we used is below this line, and all the project can be downloades using this link.

			
			
	/**
	  ******************************************************************************
	  * @file           : main.c
	  * @brief          : Main program body
	  ******************************************************************************
	  ** This notice applies to any and all portions of this file
	  * that are not between comment pairs USER CODE BEGIN and
	  * USER CODE END. Other portions of this file, whether 
	  * inserted by the user or by software development tools
	  * are owned by their respective copyright owners.
	  *
	  * COPYRIGHT(c) 2018 STMicroelectronics
	  *
	  * Redistribution and use in source and binary forms, with or without modification,
	  * are permitted provided that the following conditions are met:
	  *   1. Redistributions of source code must retain the above copyright notice,
	  *      this list of conditions and the following disclaimer.
	  *   2. Redistributions in binary form must reproduce the above copyright notice,
	  *      this list of conditions and the following disclaimer in the documentation
	  *      and/or other materials provided with the distribution.
	  *   3. Neither the name of STMicroelectronics nor the names of its contributors
	  *      may be used to endorse or promote products derived from this software
	  *      without specific prior written permission.
	  *
	  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
	  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
	  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
	  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
	  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
	  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
	  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
	  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
	  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
	  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	  *
	  ******************************************************************************
	  */
	/* Includes ------------------------------------------------------------------*/
	#include "main.h"
	#include "stm32f4xx_hal.h"

	/* USER CODE BEGIN Includes */
	#include "stm32f4xx_hal_gpio.h"
	#include "stm32f4xx.h"
	#include "stm32f4xx_hal_rcc.h"
	/* USER CODE END Includes */

	/* Private variables ---------------------------------------------------------*/
	UART_HandleTypeDef huart2;

	/* USER CODE BEGIN PV */
	/* Private variables ---------------------------------------------------------*/

	/* USER CODE END PV */

	/* Private function prototypes -----------------------------------------------*/
	void SystemClock_Config(void);
	static void MX_GPIO_Init(void);
	static void MX_USART2_UART_Init(void);

	/* USER CODE BEGIN PFP */
	/* Private function prototypes -----------------------------------------------*/

	/* USER CODE END PFP */

	/* USER CODE BEGIN 0 */

	/* USER CODE END 0 */

	/**
	  * @brief  The application entry point.
	  *
	  * @retval None
	  */
	int main(void)
	{
	  /* USER CODE BEGIN 1 */
	GPIO_InitTypeDef GPIO_InitStructure; 
	  /* USER CODE END 1 */

	  /* MCU Configuration----------------------------------------------------------*/

	  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
	  HAL_Init();

	  /* USER CODE BEGIN Init */

	  /* USER CODE END Init */

	  /* Configure the system clock */
	  SystemClock_Config();

	  /* USER CODE BEGIN SysInit */

	  /* USER CODE END SysInit */

	  /* Initialize all configured peripherals */
	  MX_GPIO_Init();
	  MX_USART2_UART_Init();
	  /* USER CODE BEGIN 2 */
		GPIO_InitStructure.Pin   = GPIO_PIN_5;
		GPIO_InitStructure.Mode  = GPIO_MODE_OUTPUT_PP;    
		GPIO_InitStructure.Pull  = GPIO_NOPULL ;
		GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;  
		HAL_GPIO_Init(GPIOA, &GPIO_InitStructure); 
	  /* USER CODE END 2 */

	  /* Infinite loop */
	  /* USER CODE BEGIN WHILE */
	  while (1)
	  {

	  /* USER CODE END WHILE */

	  /* USER CODE BEGIN 3 */
			   HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
	  }
	  /* USER CODE END 3 */

	}

	/**
	  * @brief System Clock Configuration
	  * @retval None
	  */
	void SystemClock_Config(void)
	{

	  RCC_OscInitTypeDef RCC_OscInitStruct;
	  RCC_ClkInitTypeDef RCC_ClkInitStruct;

		/**Configure the main internal regulator output voltage 
		*/
	  __HAL_RCC_PWR_CLK_ENABLE();

	  __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);

		/**Initializes the CPU, AHB and APB busses clocks 
		*/
	  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
	  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
	  RCC_OscInitStruct.HSICalibrationValue = 16;
	  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
	  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
	  RCC_OscInitStruct.PLL.PLLM = 16;
	  RCC_OscInitStruct.PLL.PLLN = 336;
	  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
	  RCC_OscInitStruct.PLL.PLLQ = 7;
	  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
	  {
		_Error_Handler(__FILE__, __LINE__);
	  }

		/**Initializes the CPU, AHB and APB busses clocks 
		*/
	  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
								  |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
	  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
	  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
	  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
	  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

	  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
	  {
		_Error_Handler(__FILE__, __LINE__);
	  }

		/**Configure the Systick interrupt time 
		*/
	  HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);

		/**Configure the Systick 
		*/
	  HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);

	  /* SysTick_IRQn interrupt configuration */
	  HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
	}

	/* USART2 init function */
	static void MX_USART2_UART_Init(void)
	{

	  huart2.Instance = USART2;
	  huart2.Init.BaudRate = 115200;
	  huart2.Init.WordLength = UART_WORDLENGTH_8B;
	  huart2.Init.StopBits = UART_STOPBITS_1;
	  huart2.Init.Parity = UART_PARITY_NONE;
	  huart2.Init.Mode = UART_MODE_TX_RX;
	  huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
	  huart2.Init.OverSampling = UART_OVERSAMPLING_16;
	  if (HAL_UART_Init(&huart2) != HAL_OK)
	  {
		_Error_Handler(__FILE__, __LINE__);
	  }

	}

	/** Configure pins as 
			* Analog 
			* Input 
			* Output
			* EVENT_OUT
			* EXTI
	*/
	static void MX_GPIO_Init(void)
	{

	  GPIO_InitTypeDef GPIO_InitStruct;

	  /* GPIO Ports Clock Enable */
	  __HAL_RCC_GPIOC_CLK_ENABLE();
	  __HAL_RCC_GPIOH_CLK_ENABLE();
	  __HAL_RCC_GPIOA_CLK_ENABLE();
	  __HAL_RCC_GPIOB_CLK_ENABLE();

	  /*Configure GPIO pin Output Level */
	  HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);

	  /*Configure GPIO pin : B1_Pin */
	  GPIO_InitStruct.Pin = B1_Pin;
	  GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
	  GPIO_InitStruct.Pull = GPIO_NOPULL;
	  HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);

	  /*Configure GPIO pin : LD2_Pin */
	  GPIO_InitStruct.Pin = LD2_Pin;
	  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
	  GPIO_InitStruct.Pull = GPIO_NOPULL;
	  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
	  HAL_GPIO_Init(LD2_GPIO_Port, &GPIO_InitStruct);

	}

	/* USER CODE BEGIN 4 */

	/* USER CODE END 4 */

	/**
	  * @brief  This function is executed in case of error occurrence.
	  * @param  file: The file name as string.
	  * @param  line: The line in file as a number.
	  * @retval None
	  */
	void _Error_Handler(char *file, int line)
	{
	  /* USER CODE BEGIN Error_Handler_Debug */
	  /* User can add his own implementation to report the HAL error return state */
	  while(1)
	  {
	  }
	  /* USER CODE END Error_Handler_Debug */
	}

	#ifdef  USE_FULL_ASSERT
	/**
	  * @brief  Reports the name of the source file and the source line number
	  *         where the assert_param error has occurred.
	  * @param  file: pointer to the source file name
	  * @param  line: assert_param error line source number
	  * @retval None
	  */
	void assert_failed(uint8_t* file, uint32_t line)
	{ 
	  /* USER CODE BEGIN 6 */
	  /* User can add his own implementation to report the file name and line number,
		 tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
	  /* USER CODE END 6 */
	}
	#endif /* USE_FULL_ASSERT */

	/**
	  * @}
	  */

	/**
	  * @}
	  */

	/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

In this case a speed of 3.5 MHz have been reached. This speed is higher than the two previus examples, this increase of speed is cause because a correct configuration of the clock system.

STM32: Using mBed

mbed is a prototyping development platform that specially designed for ARM, it provides almost everything you need such as free SDK, HDK and web based IDE to develop IoT application. The code we used is below this line, and all the project can be downloades using this link.

		
	#include "mbed.h"

	DigitalOut myled(PA_5);

	int main()
	{
		while(1) {
			myled=!myled;
		}
	}
	

As can be shown in the picture below using mbed is very easy. Its a similar concept to arduino. It´s very easy to develop code using mbed but you looseose same control of the microcontroller.


The speed reached using this method can be shown in the picture below. In this case the change frequency have been 1.37 MHz. It´s more or less the half of the example developed using the configuration wizard but faster than the two first examples. This demostrate that the firts examples have probably a bad configuration of the clock.

Arduino in STM32

It´s not very commun but Nucleo board alson can be programed using Arduino. It can be done including nucleo board to the arduino IDE using this URL https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/master/STM32/package_stm_index.json , in the preferences.


Then you have to go to the board manager menu han search the STM32 boards and include them.


Finaly, you have to configure the correct board and the connection.


The tested program in the board using arduino can be downloaded in this link. The result in the oscilloscope can be shown in the picture below.


STM32: Final Results

After changing the clock configuration in the first two examples the results can be shown in the table below.

Test Chage Frequency Perfomance
Register Level 8.525MHz x1
HAL Library 3.551MHz x0.41
STM32CubeMX wizard 3.551MHz x0.41
Mbed 1.378MHz x0.16
Arduino in STM32 532kHz x0.0624

The conclusion is that if you use low level register control you can get the faster results from the microcontroller, but it´s is the hardest way to program the microcontroller. If you chosee a high level abstraction library as mbed you can develop very quick but you lose prerfomance.

BBC Micro Bit

BBC Micro Bit is an small board designed to teach programming skills to childs. It´s very easy to use, it can be programed using a graphical interface. The serial echo example using this board can be shown in the picture below.


ESP32 with Espressif framework

The ESP32 is a microcontroller that have integrated bluetooth and wifi. It can be programed using the Espressif framework, but to do this more easy the PlatformIO can be used. To use platformIO first you have to install vsCode from this link. Then you have to install the platformio-ide plugin.


Then you can create a new project.


In the configuration wizard you have to choose your board and the desired framework, in this case ESP-IDF.


The code used can be shown below and can be downloaded in this link

		#include 
		#include 
		#include 
		#include "esp_wifi.h"
		#include "esp_system.h"

		void app_main(void)
		{
			gpio_set_direction(GPIO_NUM_5, GPIO_MODE_OUTPUT);
			int level = 0;

			uint32_t* GPIO_w1ts = (uint32_t*)0x3ff44008;
			uint32_t* GPIO_w1tc = (uint32_t*)0x3ff4400c;

			while (true) {
				if (level) {
					*GPIO_w1ts = 1 << 5;
				} else {
					*GPIO_w1tc = 1 << 5;
				}
				level = !level;
			}
		}

		

The change frequency is 4.21MHz.



ESP32 with Arduino

The ESP32 also can be programed using the arduino IDE. The code used in this case is below.

	
	int toggle = 0;
	 
	void setup() {
	pinMode(5,OUTPUT);
	   
	}

	void loop() {
			toggle = !toggle;
			digitalWrite(5,toggle);
	}
	
	

Using this code only 384 kHz has been reached. Again the use of Arduino framework result in a preformance drop.



Individual Assignament

First I have try programing atmel microcontrollers using PlatformIO Environment. I had to download the environment from https://platformio.org/get-started/ide?install=vscode. . I used Visual Studio Code as editor. Once you have Visual Studio code installed you have to install the platformIO plugin.

Once you have installed the platformIO you can create you first project.

The next step is defining the board. I have selected generic ATTiny44 and as framework Arduino. But later is possible to change the framework to atmel and program without the arduino framework.

To be able to program the microcontroller you have to change the platformio.ini file and add the upload protocol and python script for the fuses.

Programing the board from platformIO.

This is the python script.


Import('env')
env.Replace(FUSESCMD="avrdude -p t44 -P usb -c usbtiny -U lfuse:w:0x5E:m")

The code tested is the same of the echo but if you press the button the led is switched on.


//
//
// hello.ftdi.44.echo.c
//
// 115200 baud FTDI character echo, with flash string
//
// set lfuse to 0x5E for 20 MHz xtal
//
// Neil Gershenfeld
// 12/8/10
//
// (c) Massachusetts Institute of Technology 2010
// This work may be reproduced, modified, distributed,
// performed, and displayed for any purpose. Copyright is
// retained and must be preserved. The work is provided
// as is; no warranty is provided, and users accept all 
// liability.
//

#include <avr/io.h>
#include <util/delay.h>
#include <avr/pgmspace.h>

#define output(directions,pin) (directions |= pin) // set port direction for output
#define set(port,pin) (port |= pin) // set port pin
#define clear(port,pin) (port &= (~pin)) // clear port pin
#define pin_test(pins,pin) (pins & pin) // test for port pin
#define bit_test(byte,bit) (byte & (1 << bit)) // test for bit set
#define bit_delay_time 8.5 // bit delay for 115200 with overhead
#define bit_delay() _delay_us(bit_delay_time) // RS232 bit delay
#define half_bit_delay() _delay_us(bit_delay_time/2) // RS232 half bit delay
#define char_delay() _delay_ms(10) // char delay

#define serial_port PORTA
#define serial_direction DDRA
#define serial_pins PINA
#define serial_pin_in (1 << PA0)
#define serial_pin_out (1 << PA1)
#define button_pin_in (1<<PA3)
#define led_pin_out (1<<PA7)

#define max_buffer 25

void get_char(volatile unsigned char *pins, unsigned char pin, char *rxbyte) {
   //
   // read character into rxbyte on pins pin
   //    assumes line driver (inverts bits)
   //
   *rxbyte = 0;
   while (pin_test(*pins,pin))
      //
      // wait for start bit
      //
      ;
   //
   // delay to middle of first data bit
   //
   half_bit_delay();
   bit_delay();
   //
   // unrolled loop to read data bits
   //
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 0);
   else
      *rxbyte |= (0 << 0);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 1);
   else
      *rxbyte |= (0 << 1);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 2);
   else
      *rxbyte |= (0 << 2);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 3);
   else
      *rxbyte |= (0 << 3);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 4);
   else
      *rxbyte |= (0 << 4);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 5);
   else
      *rxbyte |= (0 << 5);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 6);
   else
      *rxbyte |= (0 << 6);
   bit_delay();
   if pin_test(*pins,pin)
      *rxbyte |= (1 << 7);
   else
      *rxbyte |= (0 << 7);
   //
   // wait for stop bit
   //
   bit_delay();
   half_bit_delay();
   }

void put_char(volatile unsigned char *port, unsigned char pin, char txchar) {
   //
   // send character in txchar on port pin
   //    assumes line driver (inverts bits)
   //
   // start bit
   //
   clear(*port,pin);
   bit_delay();
   //
   // unrolled loop to write data bits
   //
   if bit_test(txchar,0)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,1)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,2)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,3)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,4)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,5)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,6)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   if bit_test(txchar,7)
      set(*port,pin);
   else
      clear(*port,pin);
   bit_delay();
   //
   // stop bit
   //
   set(*port,pin);
   bit_delay();
   //
   // char delay
   //
   bit_delay();
   }

void put_string(volatile unsigned char *port, unsigned char pin, char *str) {
   //
   // print a null-terminated string
   //
   static int index;
   index = 0;
   do {
      put_char(port, pin, str[index]);
      ++index;
      } while (str[index] != 0);
   }

int main(void) {
   //
   // main
   //
   static char chr;
   static char buffer[max_buffer] = {0};
   static int index;
   //
   // set clock divider to /1
   //
   CLKPR = (1 << CLKPCE);
   CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0);
   //
   // initialize output pins
   //
   set(serial_port, serial_pin_out);
   output(serial_direction, serial_pin_out);
   //
   // main loop
   //
   index = 0;
   while (1) {
      get_char(&serial_pins, serial_pin_in, &chr);
      put_string(&serial_port, serial_pin_out, "hello.ftdi.44.echo.c: you typed \"");
      buffer[index++] = chr;
      if (index == (max_buffer-1))
         index = 0;
      put_string(&serial_port, serial_pin_out, buffer);
      put_char(&serial_port, serial_pin_out, '\"');
      put_char(&serial_port, serial_pin_out, 10); // new line
      }
	  
	   if(pin_test(PORTA,button_pin_in))
	  {
		 set(PORTA,led_pin_out); 
	  }else{
		 clear(PORTA,led_pin_out);
	  }
   }
 

Another alternative to program atmel in windows 10 is to use the linux subsystem. You can install ubuntu in windows 10 form the app shop.

Then install arduino inside the ubuntu for be able to program Atmel microcontrollers.

After that you only have to call make to compile you program and make flash to program it.

Download Files

Modified platformio.ini for attiny44

python script for platformIO attiny44

ATtiny C program

ATtiny C program for Ubuntu

ATtiny makefile file for ubuntu

Check the datasheet

I normally use 3.3V power supply but I have seen in the datasheet that if the power supply is 3.3V the maximum clock frequency is 10MHz. So It's not possible in this board because it has a 20MHz resonator.

I have use also the datasheet to see which pin corrections to each GPIO port.


Close

Molding and Casting


GROUP ASSIGNMENT

Once we knew basic material for our work this week, Leire Bereziartua and me have analyzed all casting materials we could use to cast our molds.

We have available:

			_ Smooth-Sil 940 and its catalyzer
			_ Form-Sil 25 and its catalyzer
			_ Form-Cast Rhino and its catalyzer
			_ Cogelsa Ultragrease TF spray 

Although, at the end, we have used only Smooth-Sil silicone in combination with Cogelsa release agent, we have read all materials datasheets, which can be downloaded here.

SMOOTH-SIL 940

Also known as addition-cure silicone, platinums exhibit the lowest long-term shrinkage and have the longest library life of all mold rubbers. While good for making molds for casting a variety of materials, platinums also have application and physical properties that other rubbers do not. As a result, they are used for other applications. For example, some are certified “skin safe” and can be applied directly to human skin. They are also used for making prosthetic and orthotic devices, skin safe appliances and effects, etc. Some are certified “food safe” for culinary applications.

And it is for this reason Javi and me have selected it, we need “food save” silicone to do chocolate sweets. Smooth-Sil 940 is suitable for food related applications.

Smooth-Sil Platinum Silicones cure at room temperature with negligible shrinkage. With 40A Shore hardness in our case, as you can see below:

These silicones exhibit good chemical, abrasion and heat resistance. Materials such as plasters, concrete, wax, low-melt metal alloys or resins (urethane, epoxy or polyester) can then be cast into these silicone rubbers without a release agent.

Smooth-Sil Platinum Silicones are used for rapid prototyping, wax casting (foundries and candle makers), architectural restoration and for casting concrete.

For more info: link.

It is important to understand safety considerations too: It is necessary to use in a properly ventilated area, wear safety glasses, long sleeves and vinyl gloves to minimize contamination risk.

The mixture that should be done is: 100 silicone (part A) + 10 catalyst (part B), and be careful with its pot life: this mixture working time is 30 minutes only.

Although not usually necessary, a release agent will make demolding easier when pouring into or over most surfaces.

The only inconvenient would be that we have not degassing systems and vacuum degassing is recommended to eliminate any entrapped air. We will see.

FORM-SIL 25

It is a flexible silicone for pouring molds. If it is needed can be thickened with THi-Vex thickening agent. Its hardness is Shore A25 and its colour is white. FormSil 25 has a low viscosity and pours easily without degassing.

The mixture that should be done is: 100 silicone (A component) + 5 catalyst (B component).

We have not found any data-sheet for these two components, so for more info go to: link.

FORM-CAST RHINO

FormCast Rhino is an easily pourable, thin-flow polyurethane cast resin that is suitable for many applications such as: decorative objects, prototypes, vacuum drawers, support caps, etc. Can be obtained a pasteous resin by adding fillers.

For this material, the working method is: Stir the individual components well before use. Weigh or measure both parts accurately and assemble in a clean and dry container and mix for 30 to 60 seconds (for the mixing cup, best use PP or PE plastic cup). Avoid contact with moisture as this will cause foam formation of the resin.

It is important to understand safety considerations too: Avoid contact with skin and eyes. It is recommended to wear protective clothing such as: a long sleeve shirt, laboratory gloves, safety goggles and carbon foot mask.

For more info: link.

COGELSA ULTRAGREASE TF SPRAY

Teflon and non-toxic spray grease. Great resistance to water, steam and high temperatures (tips up to 200ºC). NSF H1 certification for accidental contact with food (this certification PDF is also into data-sheets RAR file).

We have used it as release agent when we casted Smooth-sil into Wax machined mold.

As said before, documents and data-sheets of these materials can be found here.

INDIVIDUAL ASSIGNMENT

This week I have tried to make gears using molding and casting. I have use the parametric design of a gear implemented in the week 3. Using this model I have design the countermold using solidworks.

The design file can be downloaded using this link and the STL file in this link.

And after that, I exported it in STL format to go to Vcarve software. As in the exercise 08 I used this software for machining, but in this case I used it with Roland MX40 machine.

Place the piece in the working Area.

In the next picture the tool selection, choosing 7500 rmp and 900mm/min velocity.

In the next figure the parameters of the roland milling machine can be shown.

The I prepare the Roland MX40 machine, setting the x,y and z 0 coordinates. The Z 0 was introduced using a probe.

Once the milling process was finished, the result can be shown in the next figure. I can't use this mold for my final project because the used milling tool have a 3mm diameter. So I had to do the gear very big to be able of cutting well the tooths of the gear. I decided to make the gear in chocolate, because of that I used the SMOOTH-SIL 940 silicone.

In the next pictures the process of mixing the components of the silicone can be shown, using ten parts of the A part and one of the part B.

The result mold can be shown in the next picture. It has a fault in the center, the silicone didn't enter well in the axis.

The next step was fill the mold with chocolate and wait.

Once the chocolate was cold I could take it from the mold.

The final chocolate can be shown in the next picture.

Download Files

Gear SolidWorks Design File

Countermould in SolidWorks

Countermould STL

Close

Input Devices


This week a board with two input devices have been designed. One of the input devices is a photo-transistor to detect the light and the other a thermistor to detected temperature changes. as can be shown in the next figure the ATTINY44 have 8 ADC capable pins. I have use the PA2 and the PA4.

The photo-transistor used is the VEMT3700.

In the next picture the first schematic of the designed board can be shown. It have the microcontroller, the two input sensor and a connection for the FTDI cable. Then board also have a motor driver that it will be used as output device the next week.

In the next picture the first PCB can be shown. The ground plane has been connected to the copper pour.

In the next picture the final schematic of the designed board can be shown, with some testpoint. It has the microcontroller, the two input sensor and a connection for the FTDI cable. Then board also have a motor driver that it will be used as output device the next week. Eagle schematic

In the next picture the final PCB can be shown. The ground plane has been connected to the copper pour. Eagle PCB

In the next picture the BMP exported from eagle for the PCB milling.

In the next figure the milled board. It has 2 problems. In red a little part bad milled, fixed with a cutter. And in green a discontinuity in the ground plane. It can make interferences. It was solved soldering a cable to shorten the path between gnd and the motor driver.

In the next picture the soldered board before putting the wire. In green the thermistor and in blue the photo-transistor.

This time Arduino have been used to program the board. Arduino by default can't program ATTiny chips because of that an external board plugging has been used. This is the link for the board definitions. This link must be added in arduino preferences.

Once the board definitions are added you can choose then from the board menu.

Board connected to tinyISP

Programing the board from arduino.

This is the output of the serial terminal. The data is without post-processing, just the output of the ADC.

The test program can be downloaded in this link.


#include <SoftwareSerial.h>

SoftwareSerial mySerial(0,1);


void setup() {
  mySerial.begin(9600);
}

void loop() {
  mySerial.print("Temperature value: ");
  int temp = analogRead(A2);
  mySerial.println(temp);
  mySerial.print("Light value: ");
  int light = analogRead(A3);
  mySerial.println(light);
  delay(10000);
}

Download Files

Eagle schematic

Eagle PCB

Arduino program

Close

Principles and Practices


INDIVIDUAL ASSIGNMENT

As output device I have choose a motor. The ATtiny output can´t handle the motor current so a driver must be used. I have use the A4950 driver. This driver is designed for pulse width modulated (PWM) control of DC motors, the A4950 is capable of peak output currents to ±3.5 A and operating voltages to 40 V.

The A4950 is a H bridge driver that enables a voltage to be applied across a load in opposite direction.

The schematic of the designed board can be shown in the image below and the design file can be downloaded using this link. The control signal of the driver is conected to the pins PB2 an PA7 of the ATtiny. Because this two pins enable the generation of PWM signal to control the DC motor. The R7 resistor permits the measure of the DC motor current.

The designed PCB can be downloaded using this link.

A copper pour connected to ground plane have been added, this area below the driver IC allow the dissipation of the temperature.

The result PCB can be shown in the image below.

Then I took the component to solder then in the PCB.

The soldered PCB can be shown in the image below.

To test the motor a little program has been develop. This program configure the PWM pin PB2 and then in a loop the duty cycle is change.

#include 
#include 

int main(void)
{
    DDRB   |= (1 << PB2);                   // PWM output on PB2
    TCCR0A = (1 << COM0A1) | (1 << WGM00);  // phase correct PWM mode
    OCR0A  = 0x10;                          // initial PWM pulse width
    
    TCCR0B = (1 << CS01);   // clock source = CLK/8, start PWM
    
    while(1)
    {
        // change PWM pulse width every 2 seconds
        _delay_ms(2000);
        OCR0A  = 0x10;
        _delay_ms(2000);
        OCR0A  = 0x30;
        _delay_ms(2000);
        OCR0A  = 0x40;
        _delay_ms(2000);
        OCR0A  = 0x50;
    }
}

To program the board, I have use platformIO. To be able to program Atmel without arduino I had to modify the platformio.ini file with this code

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:attiny44]
platform = atmelavr
board = attiny44
board_f_cpu = 20000000L
upload_protocol = usbtiny
l_fuse = 0x5E
FUSES=  -U lfuse:w:0x5E:m

With this modified file I was able to write the correct fuses value and also the correct clock frequency.

In This picture the Output board programed with the tinyISP can be shown.

In this picture the width change of the pwm signal can be Shown.

I had some noise problem so I decided to put a cable from the shunt resistor to the input GND terminal, as can be shown in the video.


GROUP ASSIGNMENT

For measurement of the power consumption of an output device we have used Javi's new PCB, and specifically the connection to a DC Motor.

The motor is controlled by an A4950 driver. A PWM signal is applied to this driver and in function of Duty cycle more or less power is directed to the motor.

Javi has programmed it with this sequence: 2 seconds switched off, 2 seconds in 20% Duty cycle and 2 seconds in 40% Duty cycle. In this mode we can measure motor power consumption in each of this sequences.

  • 1- Connect 9V to the board using the Power supply.
  • 2- Connect the motor to the output of the driver (in PCB)
  • 3- we can read the measurement of the current and power in the Power supply screen.
  • This measurement is about ALL in the PCB, not only motor’s consumption.

		4- With the Oscilloscope we have measured SHUNT resistor signal: 
		A voltage signal proportional to the current of the motor. 
		The SHUNT resistor is 0’25 Ohm, so we have to divide the voltage with this number. 
										[V=RI]

Data we have obtained doing this tests is:

Duty Cycle I P
0% 0,016 A 0,144 W
20% 0,176 A 1,605 W
40% 0,351 A 3,216 W

The consumption of the PCB with motor switched off is about 0,144W, and when motor is running its consumption is added to it.

In the first sequence; Motor is consuming (1,605-0,144)=1,461 Watts, and in the second sequence (3,216-0,144)=3,072 Watts.

Close

Interface and Application Programming


GROUP ASSIGNMENT

This week group assignment is compare as many tool options as possible. Different languages and tool can be used to interface an application with an input or output device. We have try:
  • Java
  • Matlab
  • nodejs
  • node-red
  • python

Java

Java is a general-purpose, concurrent, object-oriented programming language. The main characteristic are:

  • It is a language that is compiled, generating compiled class files, but these compiled classes are actually interpreted by the java virtual machine.
  • It is a multiplatform language: The same java code that works in an operating system will work in any other operating system that has the java virtual machine installed.
  • It is a safe language: The virtual machine when executing the java code performs security checks, and the language itself lacks insecure features, such as pointers.
  • Thanks to the java API we can extend the language to be able to, for example, communicate with computers through network, access databases, create dynamic HTML pages, create visual applications in the style window.
The have develop a simple application that take data from a device through the serial port and make a plot with the data. The App have two files, the first one PlotData.java make the plot of the data and the second one, is a thread that take the data from the serial port SensorReader.java.

To make this application two Libraries were used.

  • The jfreechart for plot the data. Click here to download the library.
  • jSerialComm for the serial communication. Click here to download the library.

Matlab

MATLAB is a high performance technical calculation environment for numerical calculation and visualization. The main characteristic are:

  • Numerical analysis
  • Matrix calculation
  • Signals processing Graphics

We have develop a simple program that take data from the serial port and make a plot of the data.

data=zeros(1,25);
timer = 200;
s = serial('COM8','Baudrate',115200, 'DataBits', 8, 'Terminator','CR/LF','Parity','none');
s.Baudrate = 115200;
fopen(s);
tic;
while toc <= timer
    if s.BytesAvailable >= 0
    line=fgetl(s)
    data=[data(2:end) str2double(line)];
    plot(data);
    end
     pause(1);
end
fclose(s);
delete(s)
clear s

nodejs

Node.js is an execution environment for JavaScript built with the Chrome V8 JavaScript engine. Node.js uses a non-blocking, event-oriented I / O operations model that makes it lightweight and efficient. We have develop a simple application that take data from the serial port and and send the data to a cloud service to store the information. To be able of do this we have to install two libraries using the npm tool.

sudo npm install  serialport

The developed code is:

var request = require('request');
var API_KEY = '74DNWV8QOLN8CST6'; // ThingSpeak 'write' API key
var SerialPort = require('serialport');
const Readline = SerialPort.parsers.Readline;
var port = new SerialPort('/dev/ttyUSB0', {
  baudRate: 115200
});
var dato=0;

const parser = port.pipe(new Readline({ delimiter: '\r\n' }));

port.open(function (err) {
  if (err) {
    return console.log('Error opening port: ', err.message);
  }
});
 
// The open event is always emitted
port.on('open', function() {
  // open logic
});

parser.on('data', function(data){dato=data;});

setInterval(intervalFunc, 20000);

function intervalFunc() {
 var url='https://api.thingspeak.com/update?api_key='+API_KEY+'&field1='+dato;
  request.get(url,
	function (error, response, body) {
		    if (!error && response.statusCode == 200) {
		        console.log(body);
		    }else{
		        console.log('error');
		    }
	});
}

The app take the data form the serial port and every 20s send the last received data to the ThingSpeak cloud service.

node-red

Node-RED is a flow engine for the IoT, which allows graphically defining service flows. It is a very light visual tool, programmed in NodeJS and that can be executed from devices as limited as a Raspberry. We have developed a simple app that takes the data from the serial port and plot it.

python

The main characteristic of python are:

  • Python is a very simple language, so it is very easy to start in this language. Python's natural pseudo-code is one of its great strengths.
  • Using the Python language you can create all kinds of programs; General purpose programs and Web pages can also be developed.
  • Depends on the Python nature of being Open Source; has been modified so that it can work on various platforms.
  • When programming in Python we should not worry about low level details, (how to handle the memory used by the program).
  • Python contains a large number of libraries, data types and functions incorporated in the language itself, which help to perform many common tasks without having to program them from scratch.

We have develop a simple application that take the data from the serial port and then plots the data. To be able of implement this application we have to install some libraries.

python -mpip install -U matplotlib
python -mpip install -U pyserial

Once we have install the libraries we can try the application. The developed code is below.

import os
import matplotlib.pyplot as plt
import serial
import io


tempC = []
plt.ion()
cnt=0

def plotNow():
    plt.clf()
    plt.ylim(0,50)
    plt.title('Temperature sensor')
    plt.grid(True)
    plt.ylabel('Temp C')
    plt.plot(tempC, 'rx-', label='Degrees C')
    plt.legend(loc='upper right')
    plt.plot(tempC)
    plt.show()

#pre-load dummy data
for i in range(0,26):
    tempC.append(0)
ser = serial.Serial()
ser.baudrate = 115200
ser.port = '/dev/ttyUSB0'
ser.open()
while True:
    temp = ser.readline()
    print(temp)
    tempC.append(int(temp))
    tempC.pop(0)
    plotNow()
    plt.pause(.5)

INDIVIDUAL ASSIGNMENT

For the individual assignment I have developed a mobile application. This application has been made using appinventor and allow a user to control a motor thought the mobile. I designed the APP using APP inventor. This website permits design mobile application very easy using block diagrams. I have choose this option because is very easy to teach to young people and my final project is oriented to teaching engineering so this tool is the most appropriated. The App can be downloaded using this link. The user interface can be shown in the next picture.

The right side of the application is a touch pad were the Y axis is the power of the motor. If you push the touch pad and drag the ball up the motor will go faster and if you leave the ball the motor will stop. The board of the week 12 have a bluetooth module connected in the FTDI connector. I have used a HC-06 module that is very easy to use. It is like a wireless serial connection. I had only connected the corresponding pins of the module to the pins were I connected the FTDI cable. I choose this module because I wanted to use the board from week12. I didn´t make a new board for the bluetooth device because I haven´t time to make a new board.

To use this module, the ground pin of the board is connected to the module, the vcc pin of the board is connected to the Vcc of the module, the Rx Signal of the board is connected to the Tx signal of the module and finally the TX signal of the board is connected to the Rx signal of the module

The logic of the application first scans all the bluetooth devices and introduce them in a list and when you select a device from the list you make a bluetooth connection to that device.

Once a bluetooth connection is active the coordinates of the ball are take every 100ms and sent to the device thought the bluetooth connection. The X and Y axis information are converted to a percent information and a six-character string is generated, the three first characters are a number from 0 to 100 to indicate the direction and the next three character are a number from 0 to 100 to indicate the power of the motor

When the touch pad is touched the position of the ball is updated and when the pad is touch-up the ball goes to the center.

The arduino code used in the device is the following, it can be downloaded in this link:

#include 

#define dirA 7
#define dirB 8

SoftwareSerial mySerial(0, 1); // RX, TX
String line;
  int dato;

void setup() {
   // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  pinMode(dirA,OUTPUT);
  pinMode(dirB,OUTPUT);
  digitalWrite(dirB,LOW);

}

void loop() { // run over and over
  if (mySerial.available()) {
    line=mySerial.readString();
    dato=(line.charAt(0)-48)*100+(line.charAt(1)-48)*10+(line.charAt(2)-48);
    //mySerial.println(dato);
    analogWrite(dirA,dato);
  }
 
}
This program is waiting to receive data through the serial port and its receive a String it takes the characters of the power of the motor and generate an integer. Then this integer is used to control the PWM signal of the motor.

Close

Networking and Communications


INDIVIDUAL ASSIGNMENT

For this assignment I2C communications have been used. I2C is a synchronous, multi-master, multi-slave, packet switched, single-ended, serial computer bus invented in 1982 by Philips Semiconductor.

For this assignment a board has been designed, but it was produced 3 times. The schematic can be downloaded clicking here. The first board is the I2C master, the second board a I2C input device slave and the Third a I2C output device slave. The master board check if the input device is switched on and if it is sends to the output device a message to be activated. The I2C bus need two pull-up resistor because the board is the same for the master and slaves two jumper have been placed to active or remove the pull-ups. Only the master board need to setup this pullups. Also is important to remove this jumper to program the master board, because the I2C bus pins are the same for the ISP.

The designed PCB can be downloaded clicking here. It has 3 grove standard connector to interconnect the I2C boards and one to place the sensor or the actuator that you want.

Here the 3 boards and the components needed.

The master code can be downloaded clicking here


#include <Wire.h>

void setup() {
  Wire.begin();        // join i2c bus (address optional for master)
 }

void loop() {
  Wire.requestFrom(8, 1);    // request 1 bytes from slave device #8

  if (Wire.available()) { // slave may send less than requested
	char c = Wire.read(); // receive a byte as character
	Wire.beginTransmission(9); // transmit to device #9
	Wire.write(c);              // sends one byte
	Wire.endTransmission();    // stop transmitting
  }
  
  delay(10);
}

				

The slave button code can be downloaded clicking here


#include <Wire.h>
#define pushPin 1

void setup() {
  Wire.begin(8);                // join i2c bus with address #8
  Wire.onRequest(requestEvent); // register event
}

void loop() {
  delay(10);
}

// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
void requestEvent() {
  Wire.write(digitalRead(pushPin)); 
  // as expected by master
}
				

The slave led code can be downloaded clicking here


#include <Wire.h>
#define ledPin 1

void setup() {
  Wire.begin(9);                // join i2c bus with address #9
  Wire.onReceive(receiveEvent); // register event
}

void loop() {
  delay(10);
}

// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany) {
  while (1 < Wire.available()) { // loop through all but the last
	char c = Wire.read(); // receive byte as a character
	digitalWrite(ledPin,c);
  }
  int x = Wire.read();    // receive byte as an integer
  digitalWrite(ledPin,x);
}

				

All the boards connected.

In the next video the working system can be shown. An also can be shown the I2C transmissions in the logic analyser.

GROUP ASSIGNMENT

For the group assignment we decided to connect Leire´s w13-PCB to my w14 PCB system.

Communication between my PCB system and Leire´s w13-PCB would be, simulating a real plant humidity state and user's watering action, next one:

		1. w13-PCB takes from Soil-moisture sensor humidity data.
		2. w13-PCB sends this information to  my PCB system by serial-port: "0" if it is good (H>70%), 
		"1" if it is regular (70%>H>40%), "2" if it is bad (H<40%) 
		3. If my-PCB system reads "2", its BUZZER switches ON to notify the user that the plant is dry.
		4. If the user decides to water the plant, press the SWITCH button ON in my-PCB system.
		5. Button on my-PCB system sends a signal, a "1", to w13-PCB.
		6. If Leire´s w13-PCB receives a "1" by serial-port, it switches ON its Led.

W13-PCB was programmed since exercise 13, so we took my PCB system and we wrote a simple program, using Arduino, to make the communication we wanted:

In this programming action we had A PROBLEM WITH TINY44 CAPACITY, I did not have space for the program, so:

		1_ We changed myserial.print for myserial.write:
		"print" manages string data and we were sending only a carachter ("1"),
		"write" sends only a byte, so it is lighter and enough for it.
		2_ We change "delay" of the "loop":
		we were testing different actions to reduce memory, 
		and it seemed to be a right option.

With this code it was to 94% of capacity:

	const byte rxpin = 0; //not variable, reception on pin 0
const byte txpin = 1; //not variable, transmision on pin 1. Sends message.

#include  //include library which implements software serial port, for comunication
SoftwareSerial mySerial (rxpin, txpin); //set up a new serial object, and say which pin is for reception and which for trasmision

#include 

char c=0;
char ca=0;
int dato;
void setup() {
  Wire.begin();        // join i2c bus (address optional for master)
   mySerial.begin(9600); //bits per second, 9600 is standard speed
 }

void loop() {


dato=mySerial.read(); //It is reading everytime 
  
  if (dato==50){ //49=Character "1" in Dec, if user send signal, it will be 1, if not 0.
    Wire.beginTransmission(9); // transmit to device #9
    Wire.write(1);              // sends one byte
    Wire.endTransmission();    // stop transmitting
    }
 if (dato==49){ //49=Character "1" in Dec, if user send signal, it will be 1, if not 0.
    Wire.beginTransmission(9); // transmit to device #9
    Wire.write(0);              // sends one byte
    Wire.endTransmission();    // stop transmitting
    }
     if (dato==48){ //49=Character "1" in Dec, if user send signal, it will be 1, if not 0.
    Wire.beginTransmission(9); // transmit to device #9
    Wire.write(0);              // sends one byte
    Wire.endTransmission();    // stop transmitting
    }
  
  Wire.requestFrom(8, 1);    // request 6 bytes from slave device #8

  if (Wire.available()) { // slave may send less than requested
    c = Wire.read(); // receive a byte as character
    if((c==1)&&(ca==0)){
       mySerial.write (49); //Sends a "1" signal to NODE.JS program
    }
    ca=c;
  }
  
  delayMicroseconds(10000);
}

I have two jumpers which has to be desoldered to program PCB and when it is programmed to be soldered again:

And we programmed it:

YEAH!It worked! See video linked below:

DOWNLOADS

_ 1st ESP-PCB wrong board files: Eagle, BMP and Arduino

_ IND: w7-PCB Arduino program

_ GROUP: Javi's PCB system Arduino Program

Close

MTM


The main explain of this assigment is the Deusto FabLab site MTM assignment and there can be shown the mechanical/fabrication part of the machine we have built.

We divided the process in 3 parts:

 
			1.Electronics and programming >> JAVI
			2.Design, make and mount it >> LEIRE
			3.Test it >> BOTH

Even so, I have to say, we've worked as a team all the time, and we have been toghether in all process parts.

I copy here my documentation part, but you can see the whole process in Deusto FabLab site MTM assignment.

1_ Undestand electronics and connections > Connect everything > Test and program it

For the control of the machine we have decided to use the tinyG board. The TinyG project is a multi-axis motion control system. It is designed for CNC applications and other applications that require highly precise motion control. This board can control 4 stepper motor up to 2.5 amps per winding. We can see its connections diagram in image below:

Next we see some notes taken from its DataSheet:

Driver: http://www.ftdichip.com/Drivers/VCP.htm

CoolTerm: http://freeware.the-meiers.org/CoolTermWin.zip

		•	115,200 baud
		•	8 data bits
		•	no parity
		•	1 stop bit
		•	XON flow control (or use CTS, but make sure the $ex setting agrees)
		•	It's also useful to set the following - but not strictly necessary
		•	Options/Terminal - Line Mode
		•	Options/Enter Key Emulation - CR
		•	Hit OK to leave the Options menu 

Verify Flow Control Once you are connected it's a good idea to verify you have the correct flow control settings.

	•	The default flow control for TinyG is CTS, which uses the following settings:
	•	Coolterm: CTS checked
	•	TinyG $ex=2
	•	XON/XOFF flow control is also available. Both Coolterm and TinyG must be configured the with these settings:
	•	Coolterm: XON checked
	•	TinyG: $ex=1 

CONNECT MOTORS

We have used Nema 23 Bipolar 0.9deg motors to control 3 axis: X, Y and Z. This motors are High-torque stepper motor, ideal for applications in which a higher resolution is to be achieved in open-loop mode without encoder.

SPECIFICATIONS: Nema 23 Bipolar 0.9deg 1.26Nm (178.4oz.in) 2.8A 2.5V 57x57x56mm 4 Wires

Bipolar motors have 4 wires (2 pairs). This wire color code is typical for many bipolar motors:

The next step was to wire the limit switches. The tinyG have in each input a pull up resistor, so we only have to wire the common pin of the switch to ground and the NC NO to the board.

We decided to use the Normal Close option. So the NC pins of the switches to the board. We only use 3 switches:

  • X min
  • Y min
  • Z max

Once the board was wired we began with the configuration of the board. For that we first used the coolTerm to introduce configuration commands.

The configuration of the coolterm was:

  • 115,200 baud
  • 8 data bits
  • no parity
  • 1 stop bit
  • XON flow control

And in the terminal configuration Line Mode and Enter Key Emulation - CR

In this moment we switched on the tinyG and using the CoolTerm we began to configure the board using this commands:

	$ex=1		-- XON/XOFF flow control 
	
	$1sa=0.9	-- Motor1 a 400 step per revolution motor
	$1tr=60 	-- 3mm GT2 timing belt with a 20 tooth pulley
	$1mi=8		-- 8 microsteps

	$2sa=0.9	-- Motor2 a 400 step per revolution motor
	$2tr=60 	-- 3mm GT2 timing belt with a 20 tooth pulley
	$2mi=8		-- 8 microsteps

	$3sa=0.9	-- Motor3 a 400 step per revolution motor
	$3tr=1.25 	-- a 1.25mm pitch screw for the z axis
	$3mi=8		-- 8 microsteps

	$4sa=0.9	-- Motor4 a 400 step per revolution motor
	$4tr=60 	-- 3mm GT2 timing belt with a 20 tooth pulley
	$4mi=8		-- 8 microsteps

	$1ma=0		-- Motor 1 for X axis
	$2ma=1		-- Motor 2 for Y axis
	$3ma=2		-- Motor 3 for Z axis
	$4ma=1		-- Motor 4 for Y axis

	$4PO=1		-- Motor 4 inverse polarity

	$ST=1		-- ALL Switch Type Normaly Close

	$XSN=3		-- Xmin switch limit-and-homing 
	$XSX=0		-- Xmax switch disabled 
	$YSN=3		-- Ymin switch limit-and-homing 
	$YSX=0		-- Ymax switch disabled 
	$ZSN=0		-- zmin switch disabled
	$ZSX=3		-- Zmax switch limit-and-homing 
	$ASN=0		-- Amin switch disabled 
	$ASX=0		-- Amin switch disabled 
	

This was the first configuration. To test if all was correct the $test=1 was introduced. All the motors were working well unless the fourth motor that was getting hot. We switch off all and check the connections and the configuration. Finally the problem was the power configuration, the fourth motor was always on. We change the configuration to only power the motors in operation.

Once the basic configuration was tested we began to use chilipeppr. This a web based cnc control software that can be used with the tinyG board. We needed to install a serial port server. After run the serial port server the chilippr web is able to communicate with the tinyG board.

Using the top right panel int clilipeppr we can move the machine in each axis, pushing the arrows.

The final board configuration was done using chilippr interface, pushing the gear icon. We can configure each motor. In the next picture the configuration of the first Motor can be shown.

In the next picture can be shown configuration of the second Motor.

In the next picture can be shown configuration of the third Motor.

In the next picture can be shown configuration of the X axis.

In the next picture can be shown configuration of the Y axis.

In the next picture can be shown configuration of the Z axis.

In the next picture can be shown configuration of the A axis.

To generate the gcode for our machine we have used inkscape.

First we introduce the working area of our machine.

Next, we draw a spiral to test our machine.

Inkscape has an extension to convert drawing to GCODE, so using it:

The next step was to define the orientation points for the machine.

We defined a deep of 1mm in the Z axis.

The reference points appear in the next figure.

The next step is to define the tool of the machine.

We decided to use a cylinder of 1mm of diameter.

The final step is to convert the object to gcode and send it to a file.

We can see the defined path in the next figure.

Finally, we imported the generated gcode to chilippr, push play and pray.

Close

WildCard Week


INDIVIDUAL ASSIGNMENT

I have decided to try a dome for a drone. As fibre layer, for the composite, I used Burlap-Fabric (we had it in Deusto FabLab)

And as resin, for the composite, I used Epoxy. Specifically, SUPER SAP two-part epoxy resin kits comprised of SuperSap CLR Epoxy and CLF (FAST)Hardener.

First was to design the dome, and convert it in slices for laser-cutting and mounting then. This was done using Fusion and SlicerforFusion360, from Autodesk. Click here to download the design file.

Here the result of the slicer process. The DXF can be downloaded here

In the next picture the laser cutting process.

The catted cardboard in the next picture.

The assembling process of the cardboard pieces.

We applied it as in the scheme (in my case 2 times Epoxy+fiber) and we introduced it in the Nylon Vacuum Bag we have prepared with Release film and Breather.

This is the result after vacuuming the bag system:

The result is not as good has expected.

For a better finish I catted the excess material with a dremel.

Close

Applications and Implications


What will it do?

In my university we detect that the vocation to study engineering has descended alarmingly.

The students in the institute have to make an important decision, choosing between the letters itinerary or the science itinerary.

If they choose the itinerary of letters they cannot study an engineering.

So we want to promote an initiative that increases the interest in engineering in young people.

We will do this through a series of workshop that cross transversally as many engineering options as possible.

This workshop will be based on a modular robot. It will have:

  • Interchangeable gears through magnets.
  • Interchangeable wheels with magnets, with different dimension and materials.
  • Programmable thought Arduino.
  • Choose between different batteries, with different capacity and discharge rate.
  • Controlled remotely by and mobile.

tudents will have to select the best configuration for each of the tests. Having to discuss in a group about the pros and cons of each of the options. They will have a time in which they can do tests with the decisions made, to see how the robot behaves. Finally, the groups will contest among themselves to see which one has chosen the best configuration.

Who's done what beforehand?

In the market there are multiple kits to learn robotics.

PrintBot by BQ

The PrintBot Evolution Kit includes all chassis parts designed by bq and the electrical components required to assemble a PrintBot Evolution.

Kids can assemble it, take it apart, and even print new or additional parts if they have a 3D printer. Additionally, thanks to the tutorials, videos and practical examples, creating their first printbot will be very easy.

mbot

The mbot is an educational robot kit aimed at users aged 8+. mBot includes 3 pre-set control modes and Makeblock’s signature, block-based programming

Sumary

But these products don´t suite completely to our goal. All this product are focused to teaching programing skills. But we want the students experiment with different areas of engineering. We want that they discuss the effects of the diameter of the wheel in the velocity, the influence of the wheel material in the subjection, the effects of the teeth number in the gear ratio....

None of this products allow us to make what we want, so I have decided to design one that suite our goals.

What will you design?

2D and 3D DESIGN

The Main chasis will be catted using the laser cutter. The rest of the parts of the robot will be printed in 3D. To design the robot solidworks has been used.

ELECTRONICS, INPUTS AND OUTPUTS

The robot will be controlled by an electronic board with:

  • ESP32 microcontroller, this microcontroller has been choosed because it have BLE and Wifi.
  • An optocoupler to measure the rpm of the output axis
  • A light sensor to detect if a Lantern is lighting the robot
  • A DC motor for the traction of the robot, controlled by a motor driver.
  • A servomotor to control the steering angle.

PROGRAMMING

The robot is controlled with a mobile app developed with appinventor. This app sends orders to the robot though Bluetooth. Then the program in the microcontroller will control the robot.

What materials and components will be used?

MATERIALS/COMPONENTS FROM DEUSTO FABLAB

MAIN STRUCTURE

The main structure is mad of wood, catted with the laser cutter. Other pieces are printed in 3D.

PCB

The pcb has been milled at the fablab

SOLDERING COMPONENTS

Almost all the electronic component are from the fablab inventory.

MATERIALS/COMPONENTS BOUGHT

Motor Driver

The motor driver of the fablab isn´t suitable to operate with a 3.7V lipo battery, other driver has been selected.

3.3 regulator

The 3.3 regulator of the fablab have more than 1V of voltage drop, it can´t be used with a 3.7V lipo. A 400mV voltage drop has been used.

ESP-WROOM-32

A microcontroller with BLE and WiFi.

Lipo battery

A 3.7V battery has been bought with 900mAh and 1C discharger.

Bearings

Bearing for the front wheels.

Magnets

Neodymium magnet for the connection of the components.

Where will come from?

The ESP32 from ebay

The magnets from amazon

The extra electronic components from farnell.

How much will they cost?

The magnet kit 14,99€, only a few are used.

The magnet kit 14,99€, only a few are used.

The 3x10x4mm bearing 0.95€

ESP32 7,95€

What parts and systems will be made?

  • Main Structure
  • Control PCB
  • Mobile APP
  • packaging/box

What processes will be used?

  • Main Structure --> Laser Cutter and 3D printer
  • Main PCB >> COMPUTER CONTROLLED MACHINING.

What tasks need to be completed?

  • Finish the main Structure, adjust the tolerances
  • Solder the PCB and test the board
  • Check the developed software in the PCB board
  • Check the APP software with the finished system
  • Document it: BOM, pictures, prepare and share all necessary files, main slide, video, etc.
  • Present my final project

What questions need to be answered?

  • Have I got an open design?
  • Have I prepared and shared all the necessary files for it?
  • Have I got a low cost product?
  • Is it easy to assemble and use?

What is the schedule?

  • Finish Main PCB scheme, design and mill it. >> JUNE 1TH
  • Solder all electronic components needed for make it functional. >> JUNE 2TH
  • Finish program code and program Main PCB. >> JUNE 4TH
  • Finish the assemble >> JUNE 6TH
  • Mount and test everything together. >> JUNE 11TH
  • Document it: BOM, pictures, prepare and share all necessary files, main slide, video, etc. >> JUNE 14TH
  • Present my final project. >> JUNE 15TH

How will it be evaluated?

  • Test the electronic
  • Test the tolerances of the component, check if is easy to change the components
  • Test the robot with the electronic
  • Test the robot with the phone
Close

Invention, Intellectual Property, and Income


Definitions

License: Contract between a software developer subject to intellectual property and copyright and the user, which are accurately defined the rights and duties of both parties. It is the developer, or that to who this has assigned exploitation rights, who choose the license according to which the software is distributed.

Patent: A set of exclusive rights guaranteed by a Government or authority to the inventor of a new product (material or immaterial) susceptible of being exploited industrially for the good of the applicant for a limited period of time.

Copyright: Type of protection provided by the laws in force in the majority of countries to the authors of original works including literary, dramatic, musical, artistic and intellectual works, both published as earrings of publish.

ECL VS AFL

The Educational Community License (ECL) is a free and open source license based on the Apache license (version 2.0) and created with the specific needs of the academic community in mind.

The Academic Free License (AFL) is substantially similar to the Apache License, in forbidding claims of endorsement by the work’s creator, in requiring attribution to the creator, in disclaiming warranties, and in permitting distribution of the original work and derivative works subject only to certain limitations. The Academic Free License adds four more provisions that are not in the Apache or BSD Licenses, two of them pertaining to patent law, and two of them governing choice of law and shifting of attorneys fees.

This two licenses are very similar but Academic Free License adjusts better to the goal of this project.

DISSEMINATION

My goal is to go to schools with more or less 5 of this kit and make a 2h workshop. This workshop will cover different engineering skills as: Computer science, mechanical engineering, electrical engineering, communications... In this workshop each team will contest configuring the more efficient robot for each task. After the workshop the schools can download all the design files to produce their own robot, and modify then if they want. If some schools decide to replicate the robots maybe, we could organize and intra-schools contest.

DRAFT OF SUMMARY SLIDE

In the next Image the summary slide can be shown.

Close

Project Development


DEADLINE:

I have dated my final project on 15th JUNE.

REMAINING DAYS SCHEDULE:

  • Finish Main PCB scheme, design and mill it. >> DONE
  • Solder all electronic components needed for make it functional. >> DONE
  • Finish weekly assignments. >> JUNE 10TH
  • Finish program code and program Main PCB. >> JUNE 107TH
  • Make the mobile APP >> done
  • Document it: BOM, pictures, prepare and share all necessary files, main slide, video, etc. >> JUNE 14TH
  • Present my final project. >> JUNE 15TH

DETAILED PLANNING:

The process I have follow has been: IDEA > CONCEPT DEVELOPMENT > DEFINE > IDEATE > PROTOTYPE > TEST > IMPLEMENT > MEMORIES AND FUTURE PLANS.

LEARNINGS:

From all modules we have combine, particular techniques on each one, and each one in a week, week by week, I have developed a lot my technical skills in digital manufacturing, but also on a personal level. [...to finish]

Close