This shows you the differences between two versions of the page.
|
pm:prj2026:jan.vaduva:stefan.nemeti [2026/05/21 23:24] stefan.nemeti |
pm:prj2026:jan.vaduva:stefan.nemeti [2026/05/22 00:38] (current) stefan.nemeti |
||
|---|---|---|---|
| Line 93: | Line 93: | ||
| * Resistance 12 ohm | * Resistance 12 ohm | ||
| - | Because of this it tends to get REALLY hot after continued use. During the testing of the software, because of intense use, the nail that pushes the paper gets hot. This heat transfers to the inside of the shaft, that melts, making the solenoid unusable. So for the testing, it had to be done over multiple days.\\ | + | Because of this it tends to get REALLY hot after continued use. During the testing of the software, because of intense use, the nail that pushes the paper gets hot. This heat transfers to the inside of the shaft, that melts, making the solenoid unusable. So for the testing, it had to be done over multiple days.\\ \\ |
| - | The spring bring another challenge. It had to be soft enough to get compressed by the magnetic field, and springy enough to push back the nail. The height from which the nail drops is important as well. The higher it is, the harder the punch.\\ | + | The springs bring another challenge. It had to be soft enough to get compressed by the magnetic field, and springy enough to push back the nail. The height from which the nail drops is important as well. The higher it is, the harder the punch.\\ \\ |
| All the springs i had were too hard, so I had to make my own. The first iteration was made out of 0.2 mm copper wire. the second out of 0.3mm copper wire. the 0.2 one was perfect in strength, but it could not hold it's shape. It got compressed after a couple of prints. | All the springs i had were too hard, so I had to make my own. The first iteration was made out of 0.2 mm copper wire. the second out of 0.3mm copper wire. the 0.2 one was perfect in strength, but it could not hold it's shape. It got compressed after a couple of prints. | ||
| - | So i had to get 0.2 mm made from another material. Fortunately, 0.09 gauge guitar strings are almost 0.2mm, and the material is harder. These are perfect for this project. So i made my own springs using a drill. | + | So i had to get 0.2 mm made from another material. Fortunately, 0.09 gauge guitar strings are almost 0.2mm, and the material is harder. These are perfect for this project. So i made my own springs using a drill. \\ |
| + | |||
| + | There was a lot of iteration when building this design, a lot was not mentioned. | ||
| ===== Software Design ===== | ===== Software Design ===== | ||
| + | The project was done in PlatformIO, using AVR as much as possible. It is as bare metal as it gets. \\ \\ | ||
| + | The code is separated in two main parts : arduino 1 (the brain) and arduino 2 (the muscle).\\ | ||
| + | |||
| + | == Arduino 1 == | ||
| + | |||
| + | This arduino holds most of the computational load. It has the purpose of interfacing with the user using a touchscreen lcd, and reading the files from the sd card. The communication with the second arduino is made using a custom usart protocol (we'll com back to this later).\\ \\ | ||
| + | |||
| + | == Arduino 2 == | ||
| + | |||
| + | This arduino holds the code that moves stuff around. It communicates with the first arduino. After processing a single character, it waits foe the following and so on. You could say that the system is a producer-consumer situation. | ||
| + | |||
| + | ** Used imports ** | ||
| + | * avr/io.h | ||
| + | * util/delay.h | ||
| + | |||
| + | ** Self made imports ** | ||
| + | * init.h -> init function for lcd and other stuff | ||
| + | * timers.h -> the watchdog timer for resets and the timer for an animation | ||
| + | * touch_module.h -> the adc implementation of the resistive touchscreen | ||
| + | * SimpleSd.h -> a custom built sd card reader. I needed a really memory-small module, so I built my own | ||
| + | * LCD.h -> library for the ui elements. It is built on the MCUFriend library | ||
| + | * usart.h -> a self made usart library, containing the custom protocol | ||
| + | * stepper.h -> library for controlling a generic stepper motor, with all functions included | ||
| + | * solenoid.h -> abstraction layer over some port changes | ||
| + | |||
| + | |||
| + | == USART Protocol == | ||
| <note tip> | <note tip> | ||