back to index


Final project (1/3): hardware

As you can see in previous stages of research for the final project, there are a lot of possible solutions to make move my machine, so, I decided to start by 3D printing the structure that Niklas Roy proposes on his project Forbidden Fruit Machine, as an initial step on my design process.

Having these physical pieces on my hands, helped me alot. Then, start sketching on paper becomes easier.

From 2D sketches, 3D design on Rhino, 3D printing on a RepRapBcn using Cura, to a finishing by hand.

This is the design of the two axis of the machine, X and Y. You can see both axis in movement at the video in the end of the page (07).

The sctructure of the machine will be mainly 3D printed. The 3D printed pieces will be connected using 8mm diameter INOX rod. A GT2.5 timing belt and some bearings complete the list of principal materials for the structure.

Next image is a 3D model of the mechanism of the machine seen from the back, where we can see all the pieces. After that, details of the process, explained piece by piece.

#1

first iteration
— Just designed, not printed.
— Two different pieces.

second iteration
— Simpler piece to save print material.
— Same piece for both corners.

(future iterations)
— Adjust diameter of the hole for shafts.


#2

first iteration

(future iterations)
— Adjust diameter of the hole for shafts.
— Remove the "shelf" in between the piece, making the access to the pulley and the bearing easier.
— Add holes for the endstop.
— Reduce the length of the hole for the vertical shaft and change the position of the hole for the screw that blocks the shaft, for easier access.


#3

first iteration

(future iterations)
— Adjust diameter of the hole for shafts.
— Remove the wall at the back of the piece, making the access to the pulley easier.
— Reduce the length of the hole for the vertical shaft and change the position of the hole for the screw that blocks the shaft, for easier access.
— Increase the thickness of the base where the stepper is placed, from 0.2 to 0.4mm, to make uniform the thickness of the base.


#4

first iteration

second iteration
— Improvements on the clamps, more space in between and thinner walls.
— Bigger hole for the linear bearings.
— Re-design of the clamp that holds the belt, no separate pieces.

(future iterations)
— Adjust diameter of the hole for shafts.
— Reduce the length of the hole for the vertical shaft.
— Increase the thickness of the base where the stepper is placed, from 0.2 to 0.4mm, to make uniform the thickness of the base.


#5

first iteration

second iteration
— Bigger holes for linear bearings.
— Adjusting some measures.

third iteration
— Improvements on the clamps, more separation and thinner walls.

fourth iteration
— Big mistake here! Missing the place where put the pulley. Bigger base.
— Extra holes for the vertical shafts.

(future iterations)
— Add holes for the endstop.
— Adjust diameter of the holes for shafts.


#6

first iteration

second iteration
— Missing in the design how to fasten the belt!
— Adjusting some measures.

third iteration
— Improvements on the clamps, more separation and thinner walls.


#7 — timing pulley 40 tooth

first iteration
— GT2.
— Sum of two designs downloaded from thingiverse and thingiverse.

second iteration
— Smaller hole to fit the stepper.

third iteration
— The belt doesn't fit well with the pulley. Change to GT2,5.
— Sum of two designs downloaded from thingiverse and thingiverse.

fourth iteration
— Smaller hole to fit the stepper.

(future iterations)
— There is almost no space for the screw. Adding 1mm of separation to the design will solve that.


#8 — idler pulley 40 tooth for bearing 608

first iteration
— GT2.
— Design downloaded from thingiverse.

second iteration
— GT2,5.
— Design downloaded from thingiverse.

(future iterations)
— The hole for the bearing is too small, you have to sand it a lot to make it fit inside. Make the hole bigger in the design.


The diameter of the shaft used is 8mm, the same measure that I introduced into the design of the 3D pieces. Due the tolerances of the 3D printed material, I had to sand a lot the final pieces. This happened because I didn't tried the shaft with any of my pieces till the final assemblage. I should have to make a test on an early stage to check the dimension of the hole for a proper fit with the shaft.

The same happened with the rest of holes, but the others were easy to correct using a drill.

How to build a belt tensioner from a clothes peg.

So far, so good. The acrylic acts just as a base for screwing the structure. The sandwich with the acrylic helps me to protect the machine while moving it from home to fablab to home. The transparent acrylic is also very helpful during the construction and troubleshooting process, because you can see the mechanism from all the points of view.

I imagine the final form of the machine as an opaque box, with only a "finger" poking out, touching the smartphone which is outside the box. This configuration is because I want that people focus on the action that is happening on the smartphone, not on the moving mechanism of the machine itself.

About the "finger". Because the deadline was too close, I decided to make a shorter finger that touches the smartphone inside the machine, instead a long finger, which means a simpler mechanism. Also because we are at the last days and everybody is rushing with the final projects, I didn't have access to a 3D printer, so I made this part manually using wood, screws and a spring (to smooth the finger-touch simulated by the servo) (08). I didn't say yet that the finger is made using a cheap stylus. The curved part is 8mm aluminum rod (09).

For placing the endstops I had to drill some holes at the 3D printed pieces, because the design was done before having the switches for the measures.





Final project (2/3): electronics

To understand how to move an stepper motor I started using commercial boards such as the EasyDriver from Sparkfun (02) and the Pololu's stepper motor driver board (03).

Then, I was able to start my own design for a stepper driver board, and at the end, an Arduino shield to connect easily the drivers and also other sensors and actuators that I want to use in my project.

This is the schematic corresponding to the final configuration for the electronic part of the machine. Below the schematic, you will find detailed information about the process.




#1 stepper driver board
#2 arduino shield
#3 arduino UNO
#4 stepper motor
#5 servo motor
#6 external power supply
#7 endstop
#8 switch to control resolution stepper (05)

#1 stepper driver board

first iteration png traces mill front detail

(not working)
— Learning and understanding the datasheet of the A4982 driver.
— Sum of various stepper driver boards that I found on the internet, working with the A4982, looking for common components (microduino, jaredwolff, melzi and codlink).
— It doesn't work. I found a couple of short circuits that I fix but it still not working.
— I miss the border of the vias, making difficult the soldering (detail).


second iteration png traces mill detail

(not working)
— More space between traces and milling the leftover of copper to help troubleshooting.
— Bigger fixing holes.
— Vias border correction.
— Milling too deep, breaking traces near the driver, making it too difficult to repair (detail).
— New references for the re-design of the board: fabinabox and the Gestalt board (I didn't know in the first iteration that Gestalt board uses the same driver!).


third iteration png traces mill front back

(working)
holes detail1 detail2
— Because I have to repeat the milling of the PCB board, and also because I have to wait till next day to use the Roland, I decide to improve the design during that night.
— Adding MS1 and MS2 to the pinout.
— SMD solder jumper between RESET and SLEEP.
— Final tuning on the dimensions of the holes for fixing the board to a surface.
— Adding holes under the driver for better heat dissipation (but because the holes are too small in the design, fabmodules don't process them well).
— I brake two traces sanding/cleaning the board after the milling (detail1), that I repair using wire (detail2).
— You can see the driver working at the video in the end of the page (04).


fourth iteration png traces mill front back

(working)
— MS1 and MS2 controlled with a switch, to avoid using unnecessary pins. SMD solder jumper between them, removed.
— Layout changes, thinking on how the boards will be fixed on the machine and how the wires will be connected between them.
— All the connectors the same, for easier and safer connections.
— Diameter of the holes under the driver, changed to the same as vias.
— You can see the driver working at the video in the end of the page. There is also a demo for the switch that controls the resolution of the steppers (05).




— 1 x driver A4982
— 3 x header 2x3 (JP2, JP3, JP6)
— 1 x switch (JP4, JP5)
— 1 x led
— 1 x 499Ω (R1)
— 4 x 10kΩ (R2, R3, R4, R8)
— 2 x 0.1Ω (R5, R6)
— 2 x 0Ω (R9, R10)
— 1 x poti 5kΩ (R7)
— 1 x 100uF (C1)
— 2 x 0.22uF (C2, C6)
— 3 x 0.1uF (C3, C4, C5)
— 1 x 1000pF (C7)


future iterations — The SMD solder jumper between RESET and SLEEP, is it necessary?
— Find an smaller switch for MS1 and MS2 (SMD size).
— The notation on the switch is not corresponding with MS1 and MS2.
— Try to reduce the size of the board.



#2 arduino shield

first iteration png traces mill front detail

(working)
— Connections hub: 2 stepper drivers, 2 endstops, light sensor and 1 servo.
— The endstops have a little circuit with leds to see when they are activated or not.
— The female headers to access to the free pins in the Arduino are not soldered.
— The headers for the connections of the stepper drivers are too much close each other that I need to sand the connector to plug both at the same time (detail).
— See the fabrication of the shield on the video (06).




— 4 x header 2x3
— 2 x header 1x6
— 2 x header 1x8
— 2 x female header 1x6 (JP5, ANALOG)
— 1 x female header 1x4 (JP1)
— 2 x led
— 1 x 499Ω (R1, R3)
— 3 x 10kΩ (R2, R4, R5)
— 3 x 0Ω (R6, R7, R8)
— 2 x 0.1uF (C1, C2)


future iterations — Separate the headers for the connections of the stepper drivers.





Final project (3/3): software

This part explains the process behind the coding of the machine. I used Arduino IDE.

First lines of code to modify the Sweep example inside the servo library to simulate a touch on the screen of an iPhone attaching a stylus to the servo (01).

Following this tutorial page from the guy behind the EasyDriver, I replicated some examples, rotating an stepper, moving it back and forth, accelstepper, running multiple stepper motors and serial command input (02) (03).

At that point I had my board working, so I started adding to the code all the pins I need to control properly the stepper through the new custom driver (04) (05).

The steppers are already assembled to the machine (07). This is the moment when I realized that the motors do a jerky motion. Depending how you calibrate the values in the software, related to the time between steps and the resolution of the steppers, the behaviour of the motor varies.

Talking about that with the instructors, I tried to run GRBL to see if the motion become smooth, but I get stuck at the setup of the GRBL Controller, with the message "error: Undefined feed rate". It's possible that the application is waiting for a certain hardware setup that my machine doesn't have, so talking again with the instructors we concluded that the jerky motion is just due the resolution of the stepper. The ones that I am using have 200 steps per revolution. The other standard is 400 steps per revolution, I would like to try someday one of these to compare.

The servo is also assembled to the machine. To test it, a few lines of code to activate de touch event when pressing an endstop switch (09).

The machine repeats a predefined path of touch events. The machine is blind and stupid (10), it just moves the finger where I say using the X and Y axis, touches the screen of the iPhone using a recycled cheap stylus, and then, the machine waits a certain amount of time till next move. I need to define the coordinates and the delay between each touch. Using the app I made in Processing during an assignment, I can fill easily a table of values that later I can introduce into the code.

I made an interface to talk with the machine using serial communication. In the image you can see the options. You have options for the setup and actions. Just below that, you can see that I sent the finger to the position 1000 in the X axis, later, 2000 in the Y axis; I pressed the letter "p" to print the current position, which is (1000, 2000); I also pressed the letter "t" to activate the servo; at the end, pressing the letter "c" I moved the finger to the center of the iPhone and touch the screen.

In the video you can see the results of pressing the letter "u" in the serial port (11).

The number on the left corner on top of the video corresponds to the red numbers spread in the page (01 — 11), showing different stages of the process.

password: fab






download files


back to index