Newer
Older
1. Idea
2. Inputs and Outputs
3. Electronics Design and Production
4. CAD
5. Lasercutting
6. 3D printing
7. Assembly
8. Programming
9. Hero Shots
10. Design Files
11. References and Important Links
---
I tried to make a game for machine design - an electronic version of a marble
2. Inputs and Outputs
---
It basically would need motors to rotate axes in two directions, and an input to help move the motors.
Two versions of servo are available - FS90 vs FS90R. FS90 offers closed-loop position control over a limited range. Alternatively, the FS90R is specifically designed to be a continuous-rotation micro servo that offers open-loop speed control. They have identical dimensions and use the same motor, but for my design I don't need continuous rotation, so I select the FS90 motor - [datasheet](https://www.pololu.com/file/0J1435/FS90-specs.pdf)

TO move the plate on X and Y axis - I basically need a potentiometer for each direction. So I choose to use a joystick because it offers X,Y control in a single module.

**Bill of Materials:**
2x FS90 servo motors
1x HW504 joystick module
---
The servo motor pinout suggests it needs a VCC, GND and one PWM pin.
The joystick module uses a VCC, GND, an ADC Pin for X axis potentiometer and one for Y axis. It also has a switch in Z, but I will not use it for now.
Plus tx-rx, miso mosi to connect to ISP programmer. Needs 3 connections to VCC 5V and GND.
I added a capacitor between to vcc and gnd and an LED to indicate power.
So I chose a ATtiny microcontroller with enough pins and flash memory to play around with the code and configuration.

Next I make the pcb in Eagle. I follow the design process described in [electronic design week](./Electronics Design.md) to make it. Here are the schematic and and the pcbnew of the board.


Here are the traces and outline of the board:


I followed the workflow described in [Electronics Production week](./Electronics Production.md) to fabricate the board, solder components.

Cutting:

After soldering components, I plugged it in using a FabISP to test it. The power LED came on and I ran an avrdude to confirm that it is detected on my computer.

4. CAD
Next, I made a quick sketch to understand the movement required for the 2 axes.

And then started modelling it in 3D in Rhino.
I make this model according to the 3mm acrylic available in the lab.
5. Lasercutting
---
The Universal laser in Fablab SP (makerspace) had a kerf of 0.1mm on testing. So I offset this and prep a cutting dxf that
I open in the laser computer to cut.
I checked if the servo motor fixes properly in it's slot to check dimensions.
I follow the workflow described in Computer controlled cutting week, and the process is very smooth.
The joints between the acrylic and the motors, and the opposing pivot joints I decide to 3D print. This offers me quick and customisable option to afix these.

<div class="sketchfab-embed-wrapper"> <iframe title="Joint1" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" allow="autoplay; fullscreen; xr-spatial-tracking" xr-spatial-tracking execution-while-out-of-viewport execution-while-not-rendered web-share src="https://sketchfab.com/models/dad8be6cf0254fa485700e7337a80d37/embed"> </iframe> <p style="font-size: 13px; font-weight: normal; margin: 5px; color: #4A4A4A;">
</div>
<div class="sketchfab-embed-wrapper"> <iframe title="Joint2" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" allow="autoplay; fullscreen; xr-spatial-tracking" xr-spatial-tracking execution-while-out-of-viewport execution-while-not-rendered web-share src="https://sketchfab.com/models/2c9472bf6901407c93f77aa6aa44317d/embed"> </iframe> <p style="font-size: 13px; font-weight: normal; margin: 5px; color: #4A4A4A;">
</div>
<div class="sketchfab-embed-wrapper"> <iframe title="Joint3" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" allow="autoplay; fullscreen; xr-spatial-tracking" xr-spatial-tracking execution-while-out-of-viewport execution-while-not-rendered web-share src="https://sketchfab.com/models/5f80eaf9de6b4602b8b88cdaeaf91e72/embed"> </iframe> <p style="font-size: 13px; font-weight: normal; margin: 5px; color: #4A4A4A;">
</div>
<div class="sketchfab-embed-wrapper"> <iframe title="Joint4" frameborder="0" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" allow="autoplay; fullscreen; xr-spatial-tracking" xr-spatial-tracking execution-while-out-of-viewport execution-while-not-rendered web-share src="https://sketchfab.com/models/d33ca471020f4ed2bd0d458fb0ce2878/embed"> </iframe> <p style="font-size: 13px; font-weight: normal; margin: 5px; color: #4A4A4A;">
</div>
I used the tolerances of the 3D printer in FabLab SP for this. These settings are represented on the [3D printing and scanning documentation page](./3D Scanning and Printing.md). I followed the design rules and settings indicated there.
I have attached the 3D cad files and the gcode for these at the bottom of the page.

After getting all parts ready - acrylic body, 3D printed joints and the fabricated PCB it is time to assemble everything together. This is how it is now.

I realize that because of the horizontal position of the servo motors, the axis is not symmetrical. This will cause problems in the movement of the game. To solve this I redesign the 3D printed joints to be assymetrical as well, but in the opposite direction. This makes it even again.
8. Programming
---
Next I start to program the PCB. I do this in steps.
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
servos not working
Led + servos?? CHECK THIS

test all pins on board - led test

test joystick serial - working

check all connection \
check schematic
check programming - blink - servo
multimeter
Steven - change board manager
!! working
but dancing
run the joystick woth arduino uno try to map neutral position
figure out x doesnt match y
change it

reprogram to match new netral
all working.
put it all together.
9. Hero Shots
---

If I had to redo the assignment I would use motors that can be controlled with better precision and smoother movement.
I would use the motors vertically instead to make it symmetrical. I would also make a fixed space for the joystick instead of keeping it hanging on the wires.
[Joystick with serial monitor](https://create.arduino.cc/projecthub/MisterBotBreak/how-to-use-a-joystick-with-serial-monitor-1f04f0)
[Machine code]()
[PCB traces nc code](./images/md/traces.0.4.nc)
[PCB outline nc code](./images/md/outline.0.8.nc)
[All 3D printed joints - stl + gcode](docs/images/md/joints.zip)