{"id":22869839,"url":"https://github.com/arathbv/romi-term-project","last_synced_at":"2026-01-30T10:45:26.009Z","repository":{"id":267866374,"uuid":"899173099","full_name":"ArathBV/Romi-Term-Project","owner":"ArathBV","description":"Cal Poly ME 405 Final Project. Differential Drive Romi-bot.","archived":false,"fork":false,"pushed_at":"2024-12-14T03:19:26.000Z","size":310,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T11:28:21.438Z","etag":null,"topics":["embedded","mechatronics","micropython","python","robotics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArathBV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-05T18:53:15.000Z","updated_at":"2025-02-13T02:30:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"5c4299c9-079a-4ad1-9b7f-a1bb4fe20b8a","html_url":"https://github.com/ArathBV/Romi-Term-Project","commit_stats":null,"previous_names":["arathbv/romi-term-project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArathBV%2FRomi-Term-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArathBV%2FRomi-Term-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArathBV%2FRomi-Term-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArathBV%2FRomi-Term-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArathBV","download_url":"https://codeload.github.com/ArathBV/Romi-Term-Project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252903617,"owners_count":21822476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","mechatronics","micropython","python","robotics"],"created_at":"2024-12-13T13:11:51.768Z","updated_at":"2026-01-30T10:45:25.964Z","avatar_url":"https://github.com/ArathBV.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Romi-Term-Project\n### Authors: Arath Villanueva, Aiden Largay\nCal Poly ME 405 Final Project. Differential Drive Romi-bot. This repository contains a detailed description of our hardware and \nsoftware design used to navigate a complex course with a Romi robot. The 'src' folder contains all our source code including\ntask, function, and driver classes. The 'Diagrams' folder contains 'Hardware' and 'Software' folders containing various diagrams\ndescribing our design.\n\n![IMG_5083](https://github.com/user-attachments/assets/6634316a-27ad-42bf-85a4-1a34ac572fc5)\n\n## Romi Software Design\nThe motor control tasks (1 and 2) were designed according to the finite state machine below. The four motor states, following\ninitialization, cycle between Start, Maintain, Stop, and Wait. It relies on the 'start' flag to be set or cleared from the sense\ntask. The important state for motor control is the Maintain state. This state is responsible for the Feed-forward + Integral controller, \nthat quickly gets up to speed and maintains low error at steady state. Our Kff and Ki values were determined through testing and tuning.\n\n![ME405 FSM Tasks 1 and 2](https://github.com/user-attachments/assets/33f364ec-16d3-458c-8956-a4ce0f9edb17)\n\nThe sensor task (3) design is represented in the finite state machine below. It is an involved task with several states responsible\nfor the line following, bump detection, and overall course navigation of Romi. The Init Speed state is used to set Romi's speed to drive\nforward in a straight line. This state immediately transitions into the Line Sense state, which handles the line sensor reading, centroid\ncalculation, and set speed adjustments enabling Romi to successfully follow lines: including dashed and tight-radius. For the majority of\nthe course, Romi resides in the Line Sense state. Once the bump sensors are triggered, Romi executes a series of 4 states designed to \nnavigate out and around the wall obstacle. This involves timed transitions between the Backup, Turn 90deg, Large Arc, Turn 180deg, and\nStraight states. Following the completion of the Straight state, Romi transitions back to the Init Speed state to correct the speed,\ndriving straight and intersecting with the line. Romi navigates the remainder of the course in the Line Sense state, only transitioning\nto the final Turn 180deg state when the finish line has been reached.\n\n![ME405 FSM Task 3](https://github.com/user-attachments/assets/fa52ffe9-b5a6-4174-966f-9bf72126dee4)\n\nThese three tasks work cooperatively to control Romi, and require certain shared variables, or 'shares' to successfully work together.\nThe five shares used by these tasks include start, dutyL, dutyR, set_omegaL, and set_omegaR. The interraction between the tasks and \nshares are shown below. One challenge with our Romi was the delay in capacitor discharge of our DC line sensor. The threshold for a \nblack line for each of our eight sensors was around 4500us. We implemented a cutoff at this threshold to save on time above that, but\nstill had difficulty running our Sense task faster than 100-110Hz. Given that, we set the priorities between all three tasks to be even,\nsince motor control and sensor reading needed to coincide for successful course navigation.\n\n![Screenshot 2024-12-13 181541](https://github.com/user-attachments/assets/b38e1101-1e7c-4fd9-a60b-7d1e1baf820e)\n\n## Romi Hardware Design\n\nThe sensors and components we used are as follows: 1 HC-06 bluetooth module, 1 QTR-8RC reflectance sensor array, 2 Pololu mini snap-action\nswitches (used as bump sensors), and a BNO055 inertial measurement unit (functional with our driver class but unemployed for term project).\nThe reflectance sensor array is supported with zip-ties through front holes of Romi's chassis, and the bump sensors are mounted with M2 \nscrews and nuts. To extend beyond the front of the reflectance sensor array, the bump sensors were outfit with extension wires attached using\nhot-glue. The IMU was attached using provided M2.5 standoffs and screws; all sensor attachment can be seen below.\n\n![IMG_5081](https://github.com/user-attachments/assets/92791398-eb6c-4855-a269-e412c57ecfee)\n\nShown below is the wiring diagram of our Romi system. Each of the sensors and components mentioned above are shown below, including how each component's pins are connected to STM32L476RG board. The wiring diagram corresponds to how the set up for each component in software.\n![ME 405 ROMI Wiring Diagram](https://github.com/user-attachments/assets/69d522b9-7ecf-4a55-a899-2480047d2555)\n\n## Romi Results\nShown below is the course designed for Romi to navigate, featuring different challenges for line sensors, bump sensors, and overall navigation.\n![IMG_5084](https://github.com/user-attachments/assets/4c6f6fb1-14a9-436e-be9a-9cc8aaa613dd)\n\n[ROMI Trial Video](https://youtu.be/yMir0CIqmmk \"@embed\")\n\n## Challenges and Improvements\nThis term project was a challenging but rewarding experience, during which we learned a lot about control structures, sensor data collection,\nand cooperative multitasking. A major hurdle of ours was the burning out of our first RC line sensor, following its implementation, two days \nbefore the final trials. We adapted by utilizing two of the operational sensors from our first sensor to calibrate our white/black threshold\nand test motor speed changes while awaiting the arrival of a new sensor. Unfortunately, this work proved inconsequential since the new sensor\nhad entirely different response times, which should have been anticipated. That being said, we are proud to have accomplished a successful line\nfollowing, wall-navigating robot that made it to, and almost over, the finish line.\n\nSome improvements we would like to make, given more time, would include writing a series of interrupts to avoid blocking operations while waiting\nfor line sensor readings. This would reduce our Sensor class period, allowing us to run it more frequently. This would allow Romi the ability to\nnavigate the course successfully at higher speeds. We also would like to have implemented inertia measurement unit data to provide a specific\nheading for Romi to spin to while finding its way back to start.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farathbv%2Fromi-term-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farathbv%2Fromi-term-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farathbv%2Fromi-term-project/lists"}