:::danger ❗Copy the contents of this HackMD page and make your own HackMD page for the person you are writing the feedback. ❗ ::: # Template homework assignments OHA 2023 # [Controlling laser scanner via an ESP32 ] https://github.com/hstarmans/esp32_hexastorm/ https://github.com/hstarmans/hexastorm https://github.com/amaranth-lang/amaranth --- # Week 0 ## Exercise 1: Choose your project - 3. [Controlling laser scanner via an ESP32 ](https://docs.google.com/document/d/1fuuUHY6MZa03Pm-uVUkLuP_o3lA5nRFtg6YaSfUm0N4/edit) Current idea is to control the laser scanner which uses a FPGA from the ESP32. Previous development around this area:Some area are validated with Micropython using a different board. # Week 1 ## Exercise 1: Go through the OSHWA definition ## Exercise 2: Learn from open source projects **Some interesting open source projects and initiatives you can google:** **Hardware** - Arduino - RepRap and Prusa 3D printers - Adafruits company - Precious plastic - others... **Software** - Python - Linux and git - FreeCAD - OpenSCAD - others... ## Excercise 3 (Optional): Find an open source project related to your domain Find out if there are open source projects out there related to your project. You can start with the [open hardware observatory](https://en.oho.wiki/index.php?title=Special%3ARunQuery%2FprojectSearch&pfRunQueryFormName=projectSearch&ProjektSearch%5Bcontains_pdf_drawings%5D=yes&ProjektSearch%5Bsubcat%5D=Bending+machine) where there are lots of open hardware projects. # Week 2 ## Excercise 1: Start sharing your documentation #### Porting a system from a Raspberry Pi to an ESP32 involves significant changes due to the differences in processing power, memory, interfaces, and GPIO capabilities between these platforms. ### Initial Assessment and Preparation: #### Module Availability: - Verify if the required modules (struct, time, etc.) used in the Python code are available in MicroPython. Some modules or specific functions might have variations or might not exist in MicroPython. - - Replace Python libraries with their MicroPython equivalents. For instance, MicroPython often uses different modules for hardware interactions (machine, ustruct) compared to the standard Python library. #### Hardware Interaction: - Adapt hardware interaction code for MicroPython. MicroPython interfaces with hardware differently, using its own modules like machine for I2C, SPI, GPIO, etc. - MicroPython might have specific characteristics and limitations regarding SPI, I2C, and GPIO compared to standard Python libraries. - Import the necessary MicroPython modules and replace library-specific functions for interacting with hardware, such as SPI communication, I2C usage, and GPIO control. #### Syntax and Compatibility: - Ensure that the code follows MicroPython syntax and standards. MicroPython may have differences in supported syntax compared to standard Python. - MicroPython often works in constrained environments, so optimizations might be required to reduce memory usage and runtime complexity. - #### Library Replacement: - Check for compatible libraries or functionalities in MicroPython. Certain complex libraries or functionalities used in the Python code might not be directly available in MicroPython. Adaptation or replacement may be needed. #### Testing and Debugging: #### Test your code incrementally on a MicroPython-supported device. Test each section/module after adaptation to ensure it works as expected. Debug issues that arise during the porting process and resolve compatibility problems. Optimization: MicroPython has limited resources, so optimize your code for memory and performance. ## Excercise 3: Make a plan for the future - Make a checklist of what your documentation should look like by the end of the program. - Assess if it is too much for your current status or is a good match. # Week 3 ## Exercise 1: Create a first value proposition ``` For open source community Who provide cheaper option and more ecnomical to experiment and research in lithography The product name is hexastorm is Microcontroller It is cheaper as the laser scanner can be controlled by ESP32. Unlike multi-laser, single laser lithography allows for control over the resolution and precision of patterns, which is crucial in fields requiring high-resolution structures. Our product is cheaper and allows hobyist to further research in this domain. ``` # Week 4 ## Pains - Raspberry Pi, ESP32: Understanding their GPIO capabilities, processing power, memory, and interfacing options is crucial for hardware integration. - Familarity with HDL is required and might require to visit amaranth HDL. ## Gains - The technology is completely open-source, you can create a spin-off or even sell a copy. PCB motors can be used for other gadgets like a fan, toy car, drone etc. There are even startups which want to use PCB motor for electric cars. - Broadened Expertise: Expanding expertise beyond a specific platform to understand and work with different microcontrollers and control systems. - Cross-Platform Understanding: Gaining insight into the strengths and limitations of various hardware platforms for specific applications. ## Product features and specs (Products and services) - - ## Pain relievers - The board is built around the ESP32-s3-wroom2. It has 32 MB onboard memory. some tests with Micropython using a different board is already done. ## Gain creators ## Other things you want to include in your frame? (You can extend your framing with whatever you find relevant to make your project theory more complete) - Deadlines?? - Desired outcomes??? ``` ## Excercise 2: Prioritize your target specs and features ## Exercise 3: Frame your next iteration Now that you have captured hypothesis and ideas about your project. Pick an aspect, target specification or spec you think is critical, and frame an iteration of your project where you focus solely on these aspects. ::: success **Tips** - Set a goal or intent for this iteration (Is it going to be documentation focused? Focused on refinement? Testing and debugging something you have made? Or getting feedback from potential users?) - Think of an iteration or sprint as a period of 1-3 months where you end up with a deliverable that includes what you build, why you build it, the results and the learnings. - It may well be that your project is already functioning and yu simply need to focus on documenting it in the best possible way you can for the "customers" or target audience you are prioritizing. - You might want to focus on a core component of your project (software, electronics) - Or you want to test options of materials and find suppliers that allow you to lower the cost of the project. - It can be a know-how building iteration where you focus on learning through different builds of setups to understand better the problem. ::: ## Exercise 4 (Optional): Generate an assignment - Use your framing knowledge to generate an assignment or design challenge. # Week 4 **Goal:** The goal of these exercises is to help you set up a simple testing framework with a free, simple and available tool that is widely used by open source communities in software and hardware development. **Hopefully these exercises will help you work further in your project using an agile-like project management approach.** ## Exercise 1: Create a progress board We are going to rely mostly on GitHub and markdown to do these exercises. Consider doing all the documentation using markdown in your own notes and then transfer them in github issues and the board so that you keep also those notes reusable. :::warning :hand: Before getting started you need to have a GitHub ::: **Instructions:** - Create a GitHub project if you haven't for your project (remember you can use github as one of the different distribution channels for your open hardware documentation) - Use GitHub project boards to create a progress board. Make an example that people can copy ## Exercise 2: Pick up a hypothesis that is core to your project and design several experiments using the test cards :::warning :hammer_and_wrench: Here we provide a template that already combines a test card and a learning card. This ::: **Instructions** - Document your experiments in a local hackmd so that you can reuse it later using the template we are providing below. - Open an issue and name it based on a test design. [Read more about how to open an issue in GitHub](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue). - Add the issue to your project board. [Read more about how to do this step](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue) ### Template ``` # Week 5 ## Ensure existing test works with porting. ### Test Motor Control - simulates a motor control operation by sending a series of data (the list lst) to the motor driver and reads the response from the ADC. Verification 1. compares the actual data received from the motor control system (res) with the expected data using self.assertEqual. 2. If the actual received data matches the expected data, the test passes. If there's a discrepancy, the test fails, indicating an issue in the communication or response ## Test Memory and Invalid Instruction ### Tests for memory filling and emptying 1. Fill the entire memory and see if it is properly emptied by ensuring that the position changes as excepted. ### Testing invalid instruction passing through the dispatcher. 1. Write invalid instruction and verify it passes dispatcher ### LaserheadTest ### Purpose: Verify the ability to set the laser power. - Description: Sets a specific power level on the digital potentiometer via I2C and confirms whether the set value matches the read value of the potentiometer. ### Purpose: Spins the prism for a specified duration. - Description: This method involves enabling the component responsible for the rotation of the prism for a specified duration. ### Purpose: Tests the laser by enabling it for a specific period. - Description: Activates the laser for a defined duration to ensure its functionality and stability. ### Purpose: Checks the photodiode trigger when motors and lasers are enabled. - Description: Tests the photodiode, which should be triggered after a specified waiting period once the lasers and motors are activated. ## Purpose: Verifies stability after synchronization. - Description: Tests for stability after a synchronization period, checking for a successful photodiode trigger. test_move: ### Purpose: Verifies movement during a forward and backward scanning move. - Description: Simulates movement in both forward and backward directions, ensuring the movement matches the expected distance. test_scanline: ### Purpose: Tests the execution of scanning lines. - Description: Runs a specified number of scan lines and checks for errors after execution. ## MotorTest Class: ### Purpose: Handles the completion of measurements. - Description: concludes the measurement process, saves the output to a CSV file, and performs specific analysis based on the selected mode, providing statistics or data analysis for the particular motor debugging mode. ### Purpose: Test the motor, laser, and verify photodiode triggers. - Description: tests triggering of the photodiode by enabling the motor and laser components for a specific duration. ### Purpose: Tests the detection of triggers from limit switches. - Description: detect triggers from limit switches, typically executed manually by placing a sheet of paper in the cavity of the optical switch. ### Purpose: Tests enabling and disabling motors via communication with the FPGA. - Description: Checks whether the motors are enabled and if their execution can be controlled by communication with the FPGA. ### Purpose: Verifies the movement of the motors with different directions and distances. - Description: Tests the movement functionality of the motors, confirming the motor movements for various directions and distances. ### MoveTest Class: - Tests for movement core, checking motor triggers and enabling/disabling motors. - Tests for multiple movements with different offsets. ### PrintTest Class: - Tests for printing patterns and specific exposure simulations using LDgraphy. # Week 6 :::danger Copy the contents of this HackMD page and make your own HackMD page for the person you are writing the feedback. ::: ## Name of the person reviewing [Miguel F. Marrero Tarrau] ## Name of the project being reviewed [ FAIR-Battery] [https://github.com/SanliFaez/FAIR-Battery#the-fair-battery-project] **Provide feedback in the form of recommendations, observations, suggestions, or questions** - For each feedback session:     - Write a minimum of 5 points where you think there is room for improvement     - Write a minimum of 3 aspects you like about the project ### Give feedback on your hardware documentation **Look for the following:** - Is the project findable or accessible? - Check if the readme contains an introduction with a clear value proposition? - Check if you can figure out easy to navigate is the project via the folders - Check if assembly instructions are published; - Check if the bill of materials is published; - There is some contribution guidance is published; - published files are shared in original format (for example Gerber files or cad files) - use of versioning control system - use of issue management system - all this information is published under a license allowing commercial reuse. ### Give feedback on your project The main goal is to see if you have set up a systematic plan to realize your project vision and if it's realistic in terms of time and scope. Instructions: - Is there a list of priorities or hypothesis     - This could be in the form of a roadmap     - or a progress board with a list of features     - or GitHub issues     - (Some kind of project documentation that reflects your thinking) - Is there consistency between ideas and expectations, and ongoing prototyping activities - Do you think these prioritized tasks are feasible during the academy or the next 3 months     - Or would you recommend breaking down the project into smaller iterations <!-- ### Give feedback about project openness - Is the project findable or accessible? - Is it clear what is the status of the project? (early stage, mature stage focused on documentation) - Does the README provides the following:     - Clear, straightforward, and to the point value proposition     - Is there a bill of materials or a draft of a bill of materials     - design files are published * assembly instructions are published * a bill of materials is published * a contribution guide is published * published files are shared in original format * use of versioning control system * use of issue management system * All this information is published under a license allowing commercial reuse. -->