This shows you the differences between two versions of the page.
|
pm:prj2026:jan.vaduva:stefan.nemeti [2026/05/16 21:39] stefan.nemeti |
pm:prj2026:jan.vaduva:stefan.nemeti [2026/05/22 00:38] (current) stefan.nemeti |
||
|---|---|---|---|
| Line 51: | Line 51: | ||
| Perhaps some important information: | Perhaps some important information: | ||
| * Because i could not find the right solenoid push actuator, i had to make my own. | * Because i could not find the right solenoid push actuator, i had to make my own. | ||
| - | * The shaft is 3D printed | ||
| - | * Length: 2.75cm | ||
| - | * Internal diameter: 3mm | ||
| - | * External diameter: 8mm | ||
| - | * The wire used: 0.2 mm copper wire | ||
| - | * It has 11 rows of 137 wire passes | ||
| - | * Power source: 24V | ||
| * The shaft that feeds the paper was recycled from an old printer | * The shaft that feeds the paper was recycled from an old printer | ||
| * The motor and gears that drive the head around were recycled from that same old printer | * The motor and gears that drive the head around were recycled from that same old printer | ||
| Line 88: | Line 81: | ||
| </note>\\ | </note>\\ | ||
| - | A lot of tweaking was necessary for the hardware to work, but now it needs just a little less adjustment. | ||
| + | == Making the push solenoid ==\\ | ||
| + | I could not find a component with enough power to make the perfect point, so i had to make my own. | ||
| + | * The shaft is 3D printed | ||
| + | * Length: 2.75cm | ||
| + | * Internal diameter: 3mm | ||
| + | * External diameter: 8mm | ||
| + | * The wire used: 0.2 mm copper wire | ||
| + | * It has 11 rows of 137 wire passes | ||
| + | * Power source: 24V | ||
| + | * 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.\\ \\ | ||
| + | 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. | ||
| + | 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> | ||