# 2024 Machine Building Video of Maching Building. <video width="640" height="440" controls> <source src="./2024Resources/2024Machinevideo.mp4" type="video/mp4"> <source src="./2024Resources/2024Machinevideo.ogv" type="video/ogg"> <source src="./2024Resources/2024Machinevideo.webm" type="video/webm"> </video> <br> <a href="#2022-machine-building">2022 Fab Academy Machine Building</a> <br><br> ## Background I want to thank Bryan, Steven and Singapore Polytechnic team of experts helping me with the machine building project. It was a meaningful experience and journey as it had been so 2 years since I last did this. I was really thankful that Prof Neil cleared our machine during 2022, honestly I was worried to redo after putting in effort, but other teams were all amazing. During 2022, We build a Camera Dolly. Below is the 3D cad file of the Camera Dolly designed. During 2022, Bryan helped me alot and I was struggling badly with everything FabAcademy. Here's the 3D design of the Final Project done that year. I finished the 3D model shown below in F360.<br> <img src="./2024Resources/3D_CAD_F360.jpg" width="480" /><br> [F360 Design File](./2024Resources/FabAcademyMachinev3.f3z) <br> <br> ## New Challenge At 2024, Steven instructed me to make the machine again and add improvement. Hence I did these improvement, though little, but it was honest effort. This week, I tried many ways of doing the dolly and improve under Steven's guidance. Every guidance which he gave helped me improve though I needed alot of time to digest and walk further out of comfort zone to improve. Used threaded screws to make the Dolly, learnt about the kevlar string and [urumbu.](https://gitlab.fabcloud.org/quentin.bolsee/urumbu_printed_axis). The picture shown by Steven is shown below and the threaded rod version dolly which I did. While building the threaded rod version, i found myself missing several items and alot of documentation to make if I do threaded rod, hence I decided to redo. <br> <img src="./2024Resources/Urumbu.jpg" width="480" /><br><br> ## Tearing down Ender 3 v2 for parts I took apart my ender 3 v2. Previously I brought it to use it to conduct free lessons to community and less fortunate, while also improving my personal fabrication skills. Here's the Ender 3 where I am tearing down for the parts. <br> <img src="./2024Resources/Dismantle.jpg" width="480" /><br><br> ### Mechanical Design Aim _Goal: machine that has mechanism + actuation + automation, manually operate it._<br><br> ### List of Materials (To Get) These were the items that we acquired for the project. |Item|Quantity|New for 2024| |----|--------|--------| |Timing belt + bore| from Ender 3 v2| Same as 2022| |Ball Bearing (diameter 8mm)|1| Same as 2022| |Stepper motor| 2 | 2024: One more stepper motor to control rotation| |Stepper driver (TMC2208)|1| 2024: Used CNC shield and different Stepper Driver| |20mmx20mm Aluminium profile from Ender 3|1| 2024: Used a shorter profile, did not want to waste timing belt| |M5 screws|4| Same| |M5 nuts|8| Same| |M5 washers|4| Same| |M3 screws|2| Same| |M3 nuts|2| Same| |Book Screws 5M x 5 |4| 2024: used Book Screws to make frame| |Acrylic A4| 1| 2024: made new design.| |Rollers| 4| Same as 2022| |Limit Switch for Enders| 1| 2024: taken from Ender 3v2| <br><br> ### List of Materials (To Make &/ Design) These were the items that needed to be fabricated, unlike 2022, I did not fabricate nor designed the board for 2024: In the links are the files. <br> <table border="1"> <tr> <th>Item</th> <th>Quantity</th> <th>Comments</th> </tr> <tr> <td><a href="./2024Resources/DesignFiles/LaserCut Base.cdr">Movement platform</a></td> <td>1</td> <td>2024: Created a new platform using Coreldraw, added holes to slot in the timing belt. The design was made in coreldraw but my computer only have inkscape so I showing the picture here.<br> <img src="./2024Resources/InkscapeBed.jpg" width="480" /><br> </td> </tr> <tr> <td><a href="https://cad.onshape.com/documents/51392c354b9e42f05724732f/w/fa4da3d8dd4d3774dc5f03df/e/0c3a8fdc725ab8b624619aa1?renderMode=0&uiState=66140ce9c821d9172bd405e2">Phone holder</a></td> <td>1</td> <td>2024: Created a holder for my iphone 13 pro max using Onshape. I used the set screw concept which Steven showed me. and the parts was two different print so that I can print faster and assemble them.<br> <img src="./2024Resources/Onshape2Part.jpg" width="480" /><br> <img src="./2024Resources/Onshape2PartSeparate.jpg" width="480" /><br> </td> </tr> <tr> <td><a href="./2024Resources/FabAcademyMachinev3.f3z">Stepper holder</a></td> <td>1</td> <td>Used the same holder as what I designed in 2022, it was crude but it was my work when i was starting out. I still remember going to select the 3D parts from McMaster.<br> <img src="./2024Resources/Select.jpg" width="480" /><br> <img src="./2024Resources/F360Slider.jpg" width="480" /><br> </td> </tr> <tr> <td><a href="./roller_holder.f3d">Ball bearing holder</a></td> <td>1</td> <td>Used the holder which Bryan designed in 2022.</td> </tr> <tr> <td><a href="./axle.stl">Axle clamp</a></td> <td>1</td> <td>Used the holder which Bryan designed in 2022.</td> </tr> </table> <br><br> ## Mechanism The steps of mechanism are summarised in table below. <table> <tr> <th>Step</th> <th>Description</th> </tr> <tr> <td>2022-1</td> <td>Inspiration taken from Ender 3 V2's x-axis linear motion for replicability.</td> </tr> <tr> <td>2024-1B</td> <td>Added rotation for the camera holder </td> </tr> <tr> <td>2022-2</td> <td>Designed a moving platform for the camera using 3D printed M4 spacers and rollers.</td> </tr> <tr> <td>2024-2B</td> <td>Changed moving platform using laser cut parts to put a stepper on top of it. <br> <img src="./2024Resources/LasercutBase.jpg" width="480" /><br> </td> </tr> <tr> <td>2022-3</td> <td>Attached the platform to a 3mm acrylic piece.</td> </tr> <tr> <td>2024-3B</td> <td>Used book screws to support the stand to allow 2nd stepper to rotate the camera holder<br> <img src="./2024Resources/Bookscrews.jpg" width="480" /><br> </td> </tr> <tr> <td>2022-4</td> <td>Created a camera (phone) holder to sit on a 3mm acrylic piece.</td> </tr> <tr> <td>2024-4B</td> <td>Remove old camera holder, create new camera holder to be screw mounted to 2nd stepper so that it can be rotated and secured usign set screw concept. <br> <img src="./2024Resources/SetScrew.jpg" width="480" /><br> <img src="./2024Resources/CameraHolder.jpg" width="480" /><br> </td> </tr> <tr> <td>2022-5</td> <td>Decided against separate platforms for camera and movement, combining both functions.</td> </tr> <tr> <td>2022-6</td> <td>Assembled the moving platform first, then attached the camera mount to it.<br> <img src="./2024Resources/YMotor.jpg" width="480" /><br> </td> </tr> <tr> <td>2022-7</td> <td>Conducted a manual test by zip-tying a timing belt to the platform and checking motion.<br> <img src="./2024Resources/LasercutBase.jpg" width="480" /><br> <img src="./2024Resources/Ziptie.jpg" width="480" /><br> </td> </tr> <tr> <td>2024-7B</td> <td>Added one limit switch to stop Moving Platform when it touches end.<br> <img src="./2024Resources/LimitSwitch.jpg" width="480"/><br> </td> </tr> </table> <br><br> ## Actuation The devices below allow for actuation | Component | Description | |-------------------|-----------------------------------------------------------------------------| | Stepper Motor For Linear Motion | Converts rotational motion to linear motion, akin to the Ender 3 operation. It is connected to timing belt| | Stepper Motor For Rotational Motion | Provides rotational motion . It is connected to Camera holder| | Limit Switch | Stop the Linear Stepper when it reaches end | | Timing Belt and Pulley| Convert Rotational motion to linear for the linear motion | Stepper Holder | Required for mounting the stepper motor. | | Ball Bearing Holder | Necessary for the smooth operation of the system. | | Rollers | To clamp the moving platform so that it is stable when moving.| | CNC Shield| Simplfy connection of arduino and drivers. | <br><br> ## CNC Shield <img src="https://www.diyengineers.com/wp-content/uploads/2022/12/CNC-Shield-Pins_3-1.png" width="auto"/><br> <table border="1"> <thead> <tr> <th>CNC Shield Pin</th> <th>Function</th> <th>Arduino Pin</th> <th>Notes</th> </tr> </thead> <tbody> <tr> <td>X-Step</td> <td>Controls step for X-axis</td> <td>2</td> <td>Connected to stepper driver for X-axis movement <br> <img src="https://www.diyengineers.com/wp-content/uploads/2022/12/CNC-Shield-Axis.png" width="480"/><br> </td> </tr> <tr> <td>X-Dir</td> <td>Controls direction for X-axis</td> <td>5</td> <td>Specifies the direction of X-axis movement<br> </td> </tr> <tr> <td>Y-Step</td> <td>Controls step for Y-axis</td> <td>3</td> <td>Connected to stepper driver for rotation</td> </tr> <tr> <td>Y-Dir</td> <td>Controls direction for Y-axis</td> <td>6</td> <td>Specifies the direction of rotation.</td> </tr> <tr> <td>Limit Switches X</td> <td>Input for X-axis limit switch</td> <td>9</td> <td>Used for X-axis homing and preventing overtravel. Previously, I do not know how to use it well, lucky Steven gave me tips to better use it. Multimeter is awesome.</td> </tr> </tbody> </table> <br><br> ## Code Used: Below is the code used for the project where the camera will be moved forward and rotated at the same time. It will stop only if it touches the limit switch. <textarea rows="25" cols="100" readonly> #include <AccelStepper.h> // Define step and direction pin numbers for the two axes // Define Linear Stepper int stepPinX = 3; // Pin number for the X-axis stepper motor step input int dirPinX = 6; // Pin number for the X-axis stepper motor direction input // Define Rotational Motor int stepPinRot = 2; // Pin number for the camera rotation stepper motor step input int dirPinRot = 5; // Pin number for the camera rotation stepper motor direction input // Define the limit switch pin int limitSwitchPinX = 9; // Pin number for the X-axis limit switch // Create AccelStepper objects AccelStepper stepperX(AccelStepper::DRIVER, stepPinX, dirPinX); AccelStepper stepperRot(AccelStepper::DRIVER, stepPinRot, dirPinRot); void setup() { // Set up the stepper motor's maximum speed and acceleration stepperX.setMaxSpeed(1000); stepperX.setAcceleration(1000); stepperRot.setMaxSpeed(3000); stepperRot.setAcceleration(1000); // Set up the limit switch pin as an input pinMode(limitSwitchPinX, INPUT_PULLUP); } void loop() { // If the limit switch is not triggered, move the X-axis stepper motor if (digitalRead(limitSwitchPinX) == HIGH) { stepperX.move(1); stepperRot.move(1); } else { stepperX.stop(); // Stop the motor when the limit switch is triggered stepperRot.stop(); // Stop the motor when the limit switch is triggered } // Perform the steps stepperX.run(); stepperRot.run(); } </textarea> <br><br> ## Key Explainations of Code <table border="1"> <thead> <tr> <th>Function</th> <th>Parameter(s)</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>AccelStepper</code></td> <td><code>AccelStepper::DRIVER, stepPinX, dirPinX</code><br><code>AccelStepper::DRIVER, stepPinRot, dirPinRot</code></td> <td>Constructor for creating a stepper object. Specifies the interface type (DRIVER) and pins for step and direction control.</td> </tr> <tr> <td><code>setMaxSpeed</code></td> <td><code>(speed)</code></td> <td>Sets the maximum speed in steps per second. For <code>stepperX</code>, it's set to 1000. For <code>stepperRot</code>, it's set to 3000.</td> </tr> <tr> <td><code>setAcceleration</code></td> <td><code>(acceleration)</code></td> <td>Sets the acceleration in steps per second squared. Both <code>stepperX</code> and <code>stepperRot</code> are set to 1000.</td> </tr> <tr> <td><code>pinMode</code></td> <td><code>limitSwitchPinX, INPUT_PULLUP</code></td> <td>Sets the pin mode for the limit switch pin to input with an internal pull-up resistor so that it works with CNC shield.</td> </tr> <tr> <td><code>digitalRead</code></td> <td><code>limitSwitchPinX</code></td> <td>Reads the value from the limit switch pin. Used to determine if the limit switch is pressed (HIGH).</td> </tr> <tr> <td><code>move</code></td> <td><code>(steps)</code></td> <td>Enqueues a move of a certain number of steps. Positive to move forward, negative for backward.</td> </tr> <tr> <td><code>stop</code></td> <td>N/A</td> <td>Stops the motor immediately without deceleration.</td> </tr> <tr> <td><code>run</code></td> <td>N/A</td> <td>Continuously moves the stepper motor. </td> </tr> </tbody> </table> <br><br> ## Video of its working The video below shows its the motors are working properly.<br> <video width="640" height="440" controls> <source src="./2024Resources/MovingVideo.mp4" type="video/mp4"><br><br> </video> The video below shows its the mobile can fit properly.<br> <video width="640" height="440" controls> <source src="./2024Resources/WithCam.mp4" type="video/mp4"> </video> <br><br> <br><br> ----------------------------------------------------------------------------- <br><br> <a id="2022-machine-building"><h2>2022 Fab Academy Machine Building</h2></a> <video width="640" height="440" controls> <source src="./GrpProjectVideo.mp4" type="video/mp4"> </video> # Brainstorming Ideas We did some research and found the following projects 1. [Cat laser (Pan Tilt Motion)](https://fabacademy.org/2021/labs/taipei/assignments/week10/) 2. [Pen Plotter](https://fabacademy.org/2021/labs/berytech/Machine_Building.html) Steven chimed in and gave a few suggestions 1. Panorama capture tool 2. Egg Plotter 3. CNC machines To make this assignment to be more manageable, we've decided to embark on the Panorama Capture Tool project. ## Drawing inspiration from available examples <img src="./dolly_example.jpg" width="480" height="480" /> We took a look at this design. Making the dolly motorized at the stand however was too big of an undertaking. Some of the things we identified that needed to be designed are: 1. Linear Motion 2. Camera Mount 3. Left and Right Stands Next we did a task allocation among ourselves. Jon will be designing most of the mechanical aspects of the Dolly, while Bryan will focus on automating the entire Camera Dolly procedure. # Mechanical Design _Goal: machine that has mechanism + actuation + automation, manually operate it._ ### List of Materials These were the items that we acquired for the project. |Item|Quantity| |----|--------| |Timing belt + bore|~1meter| |Ball Bearing (diameter 8mm)|1| |Stepper motor|1| |Stepper driver (TB6600)|1| |20mmx20mm Aluminium profile 600mm|1| |M5 screws|4| |M5 nuts|8| |M5 washers|4| |M3 screws|2| |M3 nuts|2| |Breadboard|1| These were the items that needed to be fabricated: |Item|Quantity| |----|--------| |[Rollers]()|4| |[Movement platform]()|1| |[Phone holder]()|1| |[Stepper holder]()|1| |[Ball bearing holder](./roller_holder.f3d)|1| |[Axle clamp](./axle.stl)|1| |[M8 spacers]()|1| |[M4 spacers]()|1| |Micro-Controller [traces](./hello_world.png) [outline](./hello_world.outline.png)|1| ## Mechanism The main mechanism is a single axis linear motion. Since the example above motorizes near the camera mount and seemed a bit complicated, we decided to take inspiration from a more replicable design. Looking at the various Ender 3 V2 in our lab, we noticed that there was potential in reproducing the x-axis linear motion. <img src="./ender3_docs_image.jpg" width="480" height="480" /> To start, we designed a move platform for the camera. This is done by 3D printing M4 spaces and Rollers, and screwed on a piece of 3mm acrylic. Next, we designed a holder for the camera (in this case it is our phone). It sits on a piece of 3mm acrylic. We were debating over to use a singular platform or just have one single platform has both functionalities. To save some time and prototype more efficiently, we decided to go with the latter, where the moving platform is constructed first, then the camera mount is screwed on the moving platform. This is a test of moving the platform manually. We zip tied the timing belt on the moving platform and tried to pull it to check for smoothness of motion. ## Actuation The actuation is our stepper motor, where we convert the rotation motion to linear motion, similar to how Ender 3 oeprates. To realize this, we need to construct the following: 1. Stepper holder 2. Ball bearing holder ### Right hand side holder Designed a clamp to hold the stepper, and have space to fit the timing belt. This part was 3D printed. <img src="./left_stepper_holder.jpg" width="480" height="480" /> ### Ball Bearing holder + Dolly Left Side Support The dolly is supported on the left hand side by a stand. We measured the height from the stepper and the bottom support, and placed the ball bearing axis at the same height as the right hand side. This component was 3D printed. The construction was an 8mm diameter axis through the 3D print. spacers were used to offset the ball bearing to the center, and its position fixed. <iframe src="https://myhub.autodesk360.com/ue2fa8fb0/shares/public/SH35dfcQT936092f0e43df1486e4632d83e7?mode=embed" width="640" height="480" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" frameborder="0"></iframe> ### Driving the Stepper Motor <img src="./circuit_diagram.jpg" width="480" height="480" /> For the microcontroller, we decided to use [Bryan's ATTiny1614 Microcontroller](https://fabacademy.org/2022/labs/singapore/students/bryan-tee/assignments/week06/) as he has pulled out all of the pins for his hello world board. - [.sch](https://fabacademy.org/2022/labs/singapore/students/bryan-tee/files/week06/hello_world.sch) - [.brd](https://fabacademy.org/2022/labs/singapore/students/bryan-tee/files/week06/hello_world.brd) We decided to drive the stepper at 12Vs, and power the Mircontroller via USB. ### Testing [Code to control stepper](./test-stepper.ino) We have decided to use just Bang Bang motion, as the Dolly's speed should be constant to take a perfect Panorama Shot. ``` #define EN 0 // PA4 #define PUL 1 // PA5 #define DIR 2 // PA6 #define REV 800 // steps/rev => 38mm #define STEP_DIST 38 // mm void rotate_CW(float distance) { Serial.print("Rotate CW by "); Serial.println(distance); int steps = (distance / STEP_DIST) * REV; digitalWrite(EN, LOW); digitalWrite(DIR, LOW); for(int i = 0; i < steps; i++) { digitalWrite(PUL, LOW); delay(1); digitalWrite(PUL, HIGH); } digitalWrite(EN, HIGH); } void rotate_CCW(float distance) { Serial.print("Rotate CCW by "); Serial.println(distance); int steps = (distance / STEP_DIST) * REV; digitalWrite(EN, LOW); digitalWrite(DIR, HIGH); for(int i = 0; i < steps; i++) { digitalWrite(PUL, LOW); delay(1); digitalWrite(PUL, HIGH); } digitalWrite(EN, HIGH); } void rotate(float distance) { if (distance > 0) { rotate_CW(distance); } else { rotate_CCW(-distance); } } void setup() { // put your setup code here, to run once: pinMode(EN, OUTPUT); pinMode(PUL, OUTPUT); pinMode(DIR, OUTPUT); // initialize stepper digitalWrite(PUL, HIGH); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: if (Serial.available()) { float input_distance = Serial.parseFloat(); if (input_distance > 0 || input_distance < 0) { // filter out 0 values rotate(input_distance); } delay(1000); } } ``` <video width="640" height="440" controls> <source src="./test_actuator.mp4" type="video/mp4"> </video> We tested to see that the stepper moves in our intended distance, which means the abstraction would start from moving the platform by `x` distance. ## Automation This is the panorama code logic flowchart: <img src="./logic_flow_min.jpg" width="480" height="480" /> [Code for Panorama view](./panorama.ino) ``` #define EN 0 // PA4 #define PUL 1 // PA5 #define DIR 2 // PA6 #define LIMIT_SW 8 // PA3 #define GO_SW 9 //PA2 #define REV 800 // steps/rev => 38mm #define STEP_DIST 38 // mm / rev #define MAX_DIST 550 // 550mm // Global variables bool is_zeroed = false; float curr_dist = 0; float delta_dist = (STEP_DIST * 1.0) / REV; // Note: define CCW as negative distance void rotate_CW(float distance) { Serial.print("Rotate CW by "); Serial.println(distance); int steps = (distance / STEP_DIST) * REV; digitalWrite(EN, HIGH); digitalWrite(DIR, LOW); for (int i = 0; i < steps; i++) { digitalWrite(PUL, LOW); delay(1); digitalWrite(PUL, HIGH); curr_dist += delta_dist; if (curr_dist + delta_dist > MAX_DIST) break; } digitalWrite(EN, LOW); Serial.println("Done CW"); } void rotate_CCW(float distance) { Serial.print("Rotate CCW by "); Serial.println(distance); int steps = (distance / STEP_DIST) * REV; digitalWrite(EN, HIGH); digitalWrite(DIR, HIGH); for (int i = 0; i < steps; i++) { digitalWrite(PUL, LOW); delay(1); digitalWrite(PUL, HIGH); curr_dist -= delta_dist; if (curr_dist - delta_dist < 0) break; } digitalWrite(EN, LOW); Serial.println("Done CCW"); } void rotate(float distance) { if (distance > 0) { rotate_CW(distance); } else { rotate_CCW(-distance); } } void zeroPan() { digitalWrite(EN, HIGH); digitalWrite(DIR, HIGH); while (!is_zeroed) { digitalWrite(PUL, LOW); delay(1); digitalWrite(PUL, HIGH); is_zeroed = !digitalRead(LIMIT_SW); } digitalWrite(EN, LOW); rotate_CW(10); is_zeroed = false; Serial.println("Done zero!"); curr_dist = 0; } void runPan() { rotate_CW(MAX_DIST); } void setup() { // put your setup code here, to run once: pinMode(EN, OUTPUT); pinMode(PUL, OUTPUT); pinMode(DIR, OUTPUT); pinMode(LIMIT_SW, INPUT); pinMode(GO_SW, INPUT); // initialize stepper // digitalWrite(EN, HIGH); digitalWrite(PUL, HIGH); Serial.begin(9600); zeroPan(); } void loop() { // put your main code here, to run repeatedly: if (Serial.available()) { float input_distance = Serial.parseFloat(); if (input_distance > 0 || input_distance < 0) { rotate(input_distance); } delay(1000); } bool go = !digitalRead(GO_SW); if (go) { runPan(); delay(2000); zeroPan(); } } ``` Results are as per video. Here is a demo of the logic: <video width="640" height="440" controls> <source src="./panorama_test.mp4" type="video/mp4"> </video> <br/> This is a screenshot of some of the circuits that we still have in our archive. The machine has since been dismantled and repurposed for other projects. <img src="./partial_circuit_2.jpg" width="720" /> The circuit itself was quite messy, we wired it according to the circuit diagram above, and powered the system with a lab bench power supply, as shown in the video at the top of the page at timestamp 0:45. Our teammate Jon had lost his phone, which contained better images. Nonetheless, I think the "better images" are still as messy as the one shown above. # Future improvements 1. Make Microcontroller specific for Dolly 2. Better Roller designs 3. Increase length of Dolly for more effective Panorama shots ## Some fun works that were done but not included: Stepper clip that worked really well. This was intended to be used with the custom microcontroller, and pasted at the back of the stepper. <iframe src="https://myhub.autodesk360.com/ue2fa8fb0/shares/public/SH35dfcQT936092f0e43dafe88fc359a66c5?mode=embed" width="640" height="480" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" frameborder="0"></iframe>