# 17. Machine design¶

May 15

Assignment
• actuate and automate your machine
• document the group project and your individual contribution

Summary

The result was this machine shown in the next video, to be used as a scanner in a photogrametry software process (we didn’t complete that process; hope to do it in the next month).

We had a lot of problems mostly with the PCB production, but also with the machine programming and CNC cutting. In the end, we manage to overcamed all of this, and it was easy to assembly and test the machine.

For me, the main lesson from this week was the comparision between my soldering process and the “clean” Luis Carvão process that I had the previledge to follow.

Check the differences (one worked the other didn’t).

Mine:

Luis Carvão:
![](../images/week17/PCB_NiceBoard.jpg)


Along the way we found same possible improvements and ways to make the bootloader without soldering a six pin header. We add also same leds RX, TX to the original PCB and manage to define same lessons to used next time: the PCB process shoulb be done as clean as possible, using flat tools and isopropilic alchool.

It was a really hard and exausting week that took two days to recover, but still, not completely.

Mónica Pedro did the software work and documented at her page here) as well as André Rocha documented his work and was responsable for the CAD machine design.

All the files are here and at my personal google drive here.

Todo

• Board final testing
• Program testing
• Milling the parts
• Assembly everything
• Support structure for the Rasp pi camera
• Test the rasp pi pictures taken in a photogrametry software

# Work Done¶

We change the plan according to the team members schedule. We were more available on the second week of machine design

Info

ON FLATCAM, for the drillings, first change the units and them import the drill.xln file.

Compare the boards cutted with a “Conic tool” and a 0.3 mm flat tool. Look carefully at the areas inbetween the vias. For the conic tool I had a lot of work removing the copper. See the board milling diferences!!!

See the board outcames, one works fine, the other don’t: which one didn’t work? Guess it!!! Easy, no? If we use V tools and no enought overlay in between the cuts ther is same copper left:

In our case we use 0.35, but it works much better with the flat tool. The conic still as same copper left. tool: 0.38 mm; endill: 0.4 mm; We use also past and not flux;

From my PCB milling to the Luis Carvão process, this are the differences, I did contrary as he did:

Problems Solution Possible malfunction
Small wires of cooper or iron over the circuit Use the vacumm clean air machine
Extra copper inBetween vias Flat tool Shorts or connecting vias
Extra copper inBetween vias Increase milling percentage overRide ??? Shorts or connecting vias
Small wires of cooper or iron over the circuit Isopropilic alchool

# PCB production¶

Trying to program the first board with the atmell ICE:

Desoldering

Milling over night

Preparing the soldering parts:

Info

With the clock 16 MHZ we decided to use the minumum proposed on the datasheet for the capacitor: 27 pF

Soldering the atmel with a bad hot gun:

But now with a much more directional hot gun, where you can control the heat:

If we followed all the steps proposed by Luis Carvão we are more keen to sucess:

Debuging… and trying to clean all the paths that showed same probability of troubles.

For the atmega328 use the Arduino uno for the bootloader and them use FTDI to program it as normal.

Along the way to many errors, trying to debug them but the main error was on the PCB production.

ERROR SOLUTION
At the first schematics we choose the 3,3V, but, looking to the datasheet, we found that, the raspi 3 work at 5.5V change the regulator from 3.3 V to 5 V
the FTDI 5V didn’t powered the board for the bootloader procedure See pic where the misterious magic wire is soldered
the wires were connected wrongly because I was seeing the board from one perspective Reconnect
averdude: unexpected response (see bellow) Change the processor
Pin reset 5V? No Check soldering
FTDI voltage? check in the first place!
Fuses change the boards.txt file using the errors message
PCB milling In the next pictures its possible to compare and check the errors in the table below
avrdude: Short read, read only 0 out of 512 bytes
avrdude: jtag3_edbg_recv(): Unexpected response 0x00
avrdude: stk500v2_jtag3_recv(): error in jtagmkII_recv()
avrdude: jtag3_edbg_send(): Unexpected response 0x81, 0x11
avrdude: jtag3_edbg_recv(): Unexpected response 0x80
avrdude: stk500v2_jtag3_recv(): error in jtagmkII_recv()
avrdude: jtag3_edbg_send(): Unexpected response 0x35, 0x00
avrdude: jtag3_edbg_recv(): Inconsistent fragment number; expect 1, got 3
avrdude: stk500v2_jtag3_recv(): error in jtagmkII_recv()
avrdude: jtag3_edbg_send(): Unexpected response 0x78, 0xea
avrdude: jtag3_edbg_recv(): Inconsistent fragment number; expect 1, got 0
avrdude: stk500v2_jtag3_recv(): error in jtagmkII_recv()
avrdude: Expected signature for ATmega328P is 1E 95 0F
Double check chip, or use -F to override this check.
avrdude: jtag3_edbg_send(): Unexpected response 0x39, 0x00
avrdude: jtag3_edbg_recv(): Inconsistent fragment number; expect 1, got 3
avrdude: stk500v2_jtag3_recv(): error in jtagmkII_recv()
avrdude: jtag3_edbg_send(): Unexpected response 0x00, 0x02
avrdude: jtag3_edbg_recv(): Inconsistent fragment number; expect 1, got 0
avrdude: jtag3_edbg_send(): Unexpected response 0xda, 0x8d
avrdude: jtag3_edbg_recv(): Inconsistent fragment number; expect 1, got 0
avrdude: jtag3_edbg_signoff(): failed to read from serial port (0)


Improvement to the board: put PNP transistor to cut the FTDI 5V if the 24V is powered; else, the FTDI will power the board.

Info

During the bootloader don’t use the RESET, because ¼ of the time the clock is zero (DISCUSS this!?!?!?!)

Three types of fuses: HIGH, LOW and Extended

LOW fuse byte (DISCUSS THIS !?!?!!??): | 7 | 6 5 4 | 3 2 1 0 | |—|—|-----| | Start up time | Frequency operations modes | Clocking options |

# Programing¶

For this part, Mónica Pedro as it all very well documented at her site.

# Machine Production/design¶

Danger

For the X Carve, our options are DEWALT 611 for the spindle and ACME; for the first cut we test it on the air and it seems ok but… when it starts to cut the tool was so fast that enters the material and broke the bit; the z axis on each turn go further then we expected, so we need to change the settings.

We need also to pay atention to the offset: cuting outside, inside or just in the middle: important to decide wchch is better for the project.

Info

Before cutting verify the GCODE in the simulation: zoom it to control;

Press fit 0.1 mm discuss this!?!?!?!?!

Info

We decide to use conventional cutting on the fusion cam settings because the material react better to this type of cutting. (INCLUDE PICTURES!?!?!?!?)

we decided also to use the gcode from the fusion CAM because the cutting is much better; easel seems to show same errors.

## Assembly¶

wheel

3D printed parts to secure the bolt and to connect the bolt to the upper platform in order for it to be controlled by the stepper.

Electronics and machine structure:

Comparing the real thing with the design:

Rings to fix the board.

# References¶

https://humansthatmake.com/atmel-avr/

http://diyhacking.github.io/Week4/Day4/index.html

https://wwwhpag.staufer-gymnasium.de/de/grundlegende-schaltungen/arduino-nano-pinout/