This shows you the differences between two versions of the page.
|
pm:prj2026:jan.vaduva:stefan.nemeti [2026/05/09 19:30] stefan.nemeti |
pm:prj2026:jan.vaduva:stefan.nemeti [2026/05/22 00:38] (current) stefan.nemeti |
||
|---|---|---|---|
| Line 44: | Line 44: | ||
| * n x Step-down Converter | * n x Step-down Converter | ||
| - | === Main Circuit ==={{ :pm:prj2026:jan.vaduva:circuit_electric_stefan_nemeti.jpeg?nolink&800 |}} | + | === Main Circuit === |
| + | |||
| + | {{ :pm:prj2026:jan.vaduva:circuit_electric_stefan_nemeti.jpeg?nolink&800 |}} | ||
| <note tip> | <note tip> | ||
| 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 | ||
| - | </note> | + | </note> \\ |
| + | |||
| + | |||
| + | I wanted to go the extra mile when doing this project, and in the spirit of DIY, i had to make my own pcb. so i came up with this:\\ | ||
| + | {{ :pm:prj2026:jan.vaduva:pcb_nemeti_stefan.png?400 | }} \\ | ||
| + | |||
| + | So this, alongside two arduino uno is the full circuit. The holes in the top right are meant for the a4988 modules. In the testing phase of this build i managed to burn some. The conclusion: every component that can burn has to be in header pins. So the pcb has a pot of header pins, besides the ones seen in the 3d render.\\ | ||
| + | The pcb was routed by hand and adapted for the laser printer method (larger routes). The material i had at home was only one sided, so i had no possibility for vias. There are 4 in the pcb that had to be soldered with normal wires.\\ | ||
| + | |||
| + | The process was really straight forward.\\ | ||
| + | I printed the circuit on the board:{{ :pm:prj2026:jan.vaduva:pcb_printat_nemeti_stefan.jpeg?600 |}}\\ | ||
| + | |||
| + | After this step, i submerged the printed board in FeCl3 for about 30 min, and it came out looking like this!\\ | ||
| + | {{ :pm:prj2026:jan.vaduva:pcb_curat_nemeti_stefan.jpeg?500 |}} \\ | ||
| + | In the end i added all the components and ended up lookig like this! (drilling with 0.8 is a pain like i've never experienced before) | ||
| + | {{ :pm:prj2026:jan.vaduva:pcb_final_nemeti_stefan.jpeg?300 |}} \\ | ||
| + | The holes are not in line with each other, but that is the best i could!\\ | ||
| + | As every first time trying, i forgot to add the dc jack for the arduinos, but i added it later. | ||
| + | |||
| + | <note tip> | ||
| + | Rant about LM7812:\\ | ||
| + | |||
| + | It was the first time trying this component. This is a voltage "stabilizer". It takes a voltage between 12V and 25V and generates a steady 12 V on the output. It works by converting the surplus energy into heat.\\ | ||
| + | The first time plugging the pcb in, the stepper motors started moving normally, but as time passed, they became weaker and weaker until coming to a full stop. When i picked up the pcb to see if anything got burnt, i picked up the pcb by the lm7812. It as hot. The data sheet says 150 deg hot (celsius).\\ | ||
| + | After a lot of wasted time, i read in the data sheet that in case of high temperatures, the component enters a "protective state", that shuts off the component.\\ | ||
| + | In the end the solution was adding a radiator. Now it looks really goofy but works just fine. | ||
| + | </note>\\ | ||
| + | |||
| + | |||
| + | == 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> | ||