Final project

For my final project, I wil be designing and making a seed planting robot. I began by discussing possible options for my project with my parents, to see if they had any input for me on which things would be good ideas, and would be something impactful. I came down to 2 final ideas, a telescoping tower, and a seed planting robot. When making this decision I considered which would be more impactful of a project, and I decided that it was obvious that the seed planting robot would be better. I discussed these ideas with my teacher, Mrs. Morrow, who had taken this class in previous years, and she also agreed that the seed planting robot was a better idea. She helped me walk through which units the project would hit, in order to maximize the number of units I would hit. Below is the original sketch of this design.

Project Sketch

After I had my project chosen, Dr, Taylor helped me work out full which weeks I could place under my project. below is a table of which weeks I have assigned to do different tasks. I initially planned this by just typing on a google doc, but this is the final itteration of my planned build

| Week 1 | - Project management: This week I will plan my project and create a base design sketch

| Week 2 | - Computer-aided-design: This week I will design my project in my cad program of choice

| Week 3 | - Computer controlled cutting: This week I will create stickers/decals for the project, and will begin making some parts for the chasis

| Week 4 | - Embedded Programming: I will begin learning how to code, and will start to make basic code for my projects movements

| Week 5 | - 3D printing: I will print out the designed parts I made in week 2, and will begin assembling the main portions of my project

| Week 6 | - Electtronics design: I will design the boards needed to controll the program, and will start thinking about how to wire the components suchs as the motors and servos

| Week 7 | - Computer controlled machining: This week I will mill out a mold for the wheels of my machine, because they need to be able to stretch. This week I will also begin programming the moving parts of the machine, in order to allow for later control.

| Week 8 | - Electronics prouction: This week I will mill out the boards I need, and will install them into the chasis

| Week 9 | - Molding and casting: I will mold the front wheels as well as cast them, in order to ensure durability and flexibility of the treads

| Week 10 | - Outputs: This week I will program the outputs of my machine, so that the motors and servos work correctly, to allow for full functionability of the projects movement systems. The motors will synchronize to allow for movement, and the servos will each operate independently

| Week 11 | - Break: This week I will catch up on projects that aren't finished yet, as well as continue working on what problems remain in the synthesis of parts/ programming of my robot

| Week 12 | - Inputs: I will program the robot so it can be controlled remotely with an xbox controller

| Week 13 | - Networking and communications: This week I will allow for remote controlling of my project, so that it will be able to move independently without stray wires, allowing for planting in remote areas

| Week 14 | - Interfacing: I will interface the project with the xbox controller, and will continue to improve the code of the project, so that it can run smoothly

After these portions are complete, I can work on stray parts of my project that need attention. Such as fixing broken parts, casts, and manipulating the gear ratio of the drive train to allow for more easy movement. These final few weeks will be heavy dedication to fixing errors likely primarily in the code.

Week 2 progress

To start week two, what I needed to do here was design my project in my software of choice, and I chose Fusion360. In fusion, I made a small wheel that would run on a tread with another small wheel. Here is the process for the smaller wheel:

Photos

After I designed the wheel, I printed one out, but I realized that the depth of the slot for the teeth of the tread I ordered was to small. I accidentally subracted the tread depth from the diameter instead of the radius. I then changed this, along with making the clearances larger, and reprinted the part. There were no issues with the new part, so I printed a second one and tested to check how large the tread would be when fully extended out. The tread was much smaller than I anticipated, so I had to create a new workaround for this in the way of creating a large front wheel, which I had not anticipated. I designed a new front wheel as well, which I anticipated that I would cast later. I designed the whole projects layout in fusion and here is what that looked like

Final project design

Mrs. Morrow then pointed me out that my big wheel would be unable to mill, so I had to change the tread pattern.

New tread pattern

This is the final project but with new treads:

New Final Project

I still had to add more parts to it, but I was unsure what other objects I would need to include, and what I would need to use electronics wise. I was also unsure about how large the chasis would be, but I had a general approximation of the shape and size it needed to be.

Week 3 progress

As I mentioned above in the chart on what I will be doing each week, this week I was slotted to create parts for the chasis. Instead of cutting out final portions for the project, I just cut out a piece in order to scale the machine to the appropriate dimensions. Since I had set up my design of the project with parameters, I only had to change the parameter I entered to change the material thickness to the thickness of carboard. I exported the file to a drawing in fusion, and then exported that drawing to corel draw in order to cut out a piece. I cut the piece out and used my wheel assembly I printed out to check the scale of the build

Size reference

I determined that I wanted the design to be taller, so I changed the dimensions to fit the new design. Last week, I also met with doctor fagan, and he pointed out that it was unrealistic to have a robot this small dig a holw with an auger bit. Because of this I shrunk the size lengthwise and made the front wheels and the angle at the front less extreme.

Redesigned final

New Final Project

After talking to Neil, he pointed out how I was incorporating too much into my final project and that I should simplify it. I then decided to just do the seed dropping mechanism and the mechanism to fill in the holes. I still wanted my project to work, so I asked Merritt if he would be willing to collaboarte and place my mechanisms onto his wagon, and he said that he was fine with it. I then designed a new project Idea, and called it the seeed box, as I planned on using the Xiao seeed within part of it, and it was a very pivotal part of my fab experience.

Once I had created the sketch I moved onto the CAD design. I created 3 slots for 3 different types of seeds, which would alternate between the 3 different types. The control for each of these designs would be controlled by the usage of 3 servos which would be connected to a RP2040 Pico, and then would funnel down towards the center of the wagon and drop the seeds in a whole. I also plan on using a VL53L1X TOF sensor to detect the holes and an accelerometer to properly time the dispensing of the seeds. Whenever the wagon would drive over a hole, it would wait a little based on the speed, then dispense the seeds and turn a servo at the end of a rod to fill the hole back in. Here is the design of the funnels as well as the box itself.

The plan I had for the rod mechaism would likely be similar to Prusa's wire hiding they would do, where they take the wire, place it in a T-bar, and place a cap over it. I would mount this on the back of the wagon and create a hole from where the electronics would be stored to make the cable mangement much easier. The time of flight sensor would likely be closer to the front of the wagon, but not too far just so that I could properly calculate when to drop the seeds and have time to deploy the servos.

Full design

Project development

Day 1 progress

Today wasn't a hugely productive day in terms of final project, rather more catching up on documentation. THe final design was finished, as you can see above. I also attempted to mill something to mold and cast, but the wax slipped, so I will try again tomorrow, I believe it may have had something to do with the toolpaths I was using, and the subsequent bit I used, I misremembered and used a 1/32 inch flat end mill instead of a 1/8 inch flat end mill. The design went well though, I now had mounts for all my servos, and the dropper mechanism was done. I began a 3D print, but it wont be done until tomorrow. The next few days will be much more eventful however, I simply needed today to have all my fusion designs finished, so that I had a better understanding of how everything would fit together. Thus far I am on track for what I need to do, and luckily I gave myself some extra days at the end too, which will be helpful in the case of a hang-up or issue.

Day 2 progress

Today unfortunately wasn't as efficient as I had hoped. I was having a lot of trouble with the vl53l1x sensor. I tried multiple different options, such as the adafruit circuitPython library and example code, the same code we used in our group machine week project, yet nothing worked. Eventually I called adam to ask exactly what needed to happen with the code for our machine week project, and he told me I needed to have the micropython version 1.18 installed on my Pico instead of the most recent version, 1.20. I changed this, and yet it still didn't work. What I did get done however today was networking both boards together, and getting them to communicate the value of the MPU6050 accelerometer on the seeed to the pico. This was not too difficult, and was a significant step in my final project. I also got more 3D prints done, and did some slight alterations to my design to create some improvements.

Day 3 progress

Today a lot of progress was made. I began the day by creating my aspire file for the housing of the box, and then while waiting for Ryan to add his design to my project, I began a few more prints, and then we both moved on to milling. The mill turrned out great, but as Mr. Dubick later pointed out, I should've used 1/4 inch wood instead of 1/2 inch, because I didn't need to make it that sturdy, and was just making it more challenging for merrit. After the mill was finished, I sanded down all the pieces, and used the domino to create some joints to join both boards together. I double checked to make sure it all looked good, which it did, so I wood glued everything but the top together. While The glue was somewhat drying, I wanted to laser cut the access door for the electronics, so I quickly accounted for the kerf on my design, and went to the laser cutter to cut it out. Once it was in the file, I decided I wanted to add text, so I added "Save the trees", which resonates with the purpose of my project. Once this cut out, I tried to fit it into the cavity I created with my mill, but it was too small. I accounted for kerf too little! I then just took the acrylic to sand it down, and with that, it worked, and it fit very solidly into the cavity. At the end of the day, one of the prints for my dropper mechanism was done, so I tested that with the middle hole, and it worked great! It didn't work so well in the other holes though, so I will have to sand them more later. Merritt also found some vl530x tof sensors, which were simply the previous version of the ones I was already using.

Day 4 progress

Today was a repeat of day 2, it wasn't super great in terms of the progress made electronically. I tried again to use the vl53l0x tof sensor, but to no avail. I even found a library to make it work, but that library for whatever reason wasn't working for me. The tried to get this to work for around 2 or 3 hours, switching pins around, changing the version of micropython that I was using, in concern of having the same problem adam told me about the vl53l0x, so I switched the version but it still didn't work. Then I handed the sensor off to Stuart ot let him try with it, becuase he needed one for his project, and it worked for him, but the issue with it was that it used gpio pins 0 and 1 on the PICO, which I needed for my UART communication between my two boards. Despite this, I tried it on my computer, with the same code as stuart, who followed the same tutorial I did, but it didn't work. I decided I would move in a different direction from there. I wanted to change what I was doing, so now instead of planting a tree whenever a whole is detected, the planted would plant one about every 6 feet, or whatever number I set it to. The reasoning for this, would be that the seeds would not be dropped into a hole that it wasn't supposed to drop into, it would instead drop into the exact distance of the set holes. The upside to this is more precision (hopefully), because from prior experience, the sensor isn't always the most acurate, and the hole could be any depth and the sensor would still work. The seeds already need to be space a certain distance from each other, so it would make sense to do it this way anyway. All this results as is a more coding and calculation intense project. The downside here, it that it could be too precise, and this would result in errors, becuase of what the human did. Overall, I think this is a necessary step, and will likely make this a better project. In the future it is definitely possible for me to use a combination of both. Tomorrow will likely be a big day, and will consist mostly of testing, milling and putting the project all together, and preparing for the end. At this point, the physical portion of the project is nearly done, I jsut need to finish the funnels, and mold and cast the dropper mechanism.

Now, after being at school, I asked chapt GPT to This was the code it gave me

import math

# Constants
ACCELERATION_THRESHOLD = 2.0  # G
GRAVITY = 9.81  # m/s^2 (standard gravity)

# Function to calculate time to travel 6 feet
def calculate_time_to_travel_six_feet(acceleration):
    # Convert G to m/s^2
    acceleration_mps2 = acceleration * GRAVITY

    # Check if the acceleration is above the threshold
    if acceleration_mps2 > ACCELERATION_THRESHOLD:
        # Calculate the time using the formula: time = sqrt(2 * distance / acceleration)
        distance = 6.0 * 0.3048  # 6 feet to meters
        time = math.sqrt(2 * distance / acceleration_mps2)
        return time
    else:
        return None

# Example usage
acceleration_value = 1.5  # Replace this with the actual acceleration value from your accelerometer

time_to_travel_six_feet = calculate_time_to_travel_six_feet(acceleration_value)

if time_to_travel_six_feet is not None:
    print("The time to travel 6 feet is:", round(time_to_travel_six_feet, 2), "seconds.")
else:
    print("Acceleration is below the threshold.")

I decided that I didn't need the section for debugging going over the 2g threshold, because it is highly unlikely merritt's wagon accelerates faster than 44 mph/second, so it would just be useless code. I patched it together with some pieces of code which I used during input week to get a good reading. This code essentially will send the time to travel 6 feet, then the other line of code (which is not yet written) will wait for an amount of time slightly less than that, then begin to move servos, to hopefull drop the seeds accurately.

Day 5 progress

Today was a very large day for the development of my project. I began my day be removing a few more prints, and they all turned out fine. Then once the prints were taken off, I began to work on my code more. Upon speaking with Mr. Dubick, he pointed out that I would only be able to make this work if the speed was consistent, which was a slight issue, that I tried to track before, but it wasn't the most efficient way of working. Then Drew Griggs offered to help with that portion, becuase it entailed calculous, which I currently do not know. The code is fairly understandable, and is a more effiecient and concise way of keeping track of the acceleration. This was the code he helped write below

''' Est_V += ax*Time_Const Est_X += Est_V * Time_Const if(abs(Est_X - prev_drop) > 1.83): com1.send("yes") prev_drop = Est_X sleep(Time_Const) '''

This is some fairly understandable code. It takes the acceleration and multiplies it by the time, which was similar to what I had written last night, then it tried to map out how far it was from where it started, until it reaches 1.83 meters (6 feet). Once it hits that 6 feet mark, it sends a message to the Pico to drop a seed. Once I got this working I started to test with the servos after I began the 3D print for my mold, which would be the piece that I used in the dropper. I found a library that allows for server controlls in micropython, for which the syntax was very similar to the syntax in arduino, making it easy to learn. When I first tried the first servo, it was giving some weird feedback similar to the stepper motor I used in output week. Later after trying to trouble shoot, I unplugged the power wire, because I felt the servo heating up. I plugged it back in, and it started to move somewhat. Then I repeated this a few times, and the servo worked! Next I wanted to test it with all of my servos, so I plugged them all in. After this, I tested the code, and it successfully alternated between each servo, and after each servo, the fourth servo would move. I had to play around with the delay values a bit to make sure they could fully open before closing again. Eventually this worked! This was the code for the receiving / servo dropping code

''' from easy_comms import Easy_comms from time import sleep from servo import Servo

com1 = Easy_comms(uart_id=0, baud_rate=9600) com1.start()

servo1 = Servo(2) servo2 = Servo(3) servo3 = Servo(4) servo4 = Servo(5)

track = 1

def servo_Spin(): global track

if track == 1:
    servo1.write(45)
    servo4.write(90)
    sleep(.4)
    servo1.write(0)
    track = 2
else:
    if track == 2:
        servo2.write(45)
        servo4.write(90)
        sleep(.4)
        servo2.write(0)
        track = 3
    else:
        servo3.write(45)
        servo4.write(90)
        sleep(.4)
        servo2.write(0)
        track = 1

servo1.write(0) sleep(.4) servo2.write(0) sleep(.4) servo3.write(0) sleep(.4) servo4.write(0) sleep(.4)

while True: message = "" message = com1.read()

if message is not None:
    print(f"message received: {message.strip('\n')}")
if message == "yes":
    servo_Spin()
    print("spinning", f"{track}")
    sleep(.4)
    servo4.write(0)

''' datasheet for servos

By this time, the 3D print was finished, so I moved onto making the silicone mold for my cast. Unfortunately, I had accidentally missed part of the extrusion in my fusion file, so the slot for the hole went all the way through. I cast this anyway, and the cast turrned out well, the details were all very clearly represented, a testiment to the ability of casting for precision. Once the cast was finished, I began the solid molding process, which turned out well, I added to the purple coloring for a bit more color within the design. The design came out well, and it even looked like a 3D print! I fit it to the servo, and it fit incredibly well, there is a small gap, but so long as I don't use really small seeds, it shouldn't be a problem. Now that everything was desinged, I cast a 2 more times, for the remaining pieces I needed, and they both came out great as well. Then I began work on my PCB. In the PCB there was going to be the same layout I had when I breadboarded. There was an issue here though, the voltage regulator footprint was incorrect to how those within our lab functioned. This took a bit of trial and error to fix, and I only realized this after Stuart pointed it out to me. Then I moved onto the routing, and had another problem, due to the setup of my board, there would be some issues with wiring, so I created a few 0 ohm resistors which were unfortunately necessary. From there that was were I ended the day, tomorrow there will be a strong possibility that the project will be finished.

Day 6 progress

Today I milled a board to begin the day. While milling the board I realized that I had left off a pad in order to bridge a gap, so I tried to simply jump over it with a wire. This didn't work so I tried again, and this time it wasn't adhered well enough to the bed. Finally on the third try, I finished it, again without the pad using a wire and this time the board worked. I tried to run it using the same code that I used with the breadboard. This worked wiht my computer, but it didn't work when I tried to run it off of the nine volt battery. The code worked, but the servos were unable to move

Day 7 progress

Today I began by asking Mr. Durrett what might have been the problem with my board, and I checked the voltage, and the servos were not getting enough power to move. Mr. Durrett suggested I use 1 or more buck converters to make sure that I could get enough amps and voltage to power my servos. I redid my circuit and milled another board to add two buck converters in, which would power my project. After I milled and soldered the board, I was still unable to get this working, even with the two buck converters I used in tandem with the other battery. I then decided I would make another pivot to another different idea for powering, a USB power bank. I figured that since this is able to run off the power on my computer's USB, it might be feasable to try and run it off of the power bank, because it would hopefully supply enough volts to run the servos. When I plugged it in it worked! I used the original board, but it managed to work!

Day 8 progress

Today all that I did were some final touches to my project. I cut a longer t-bar for the hole filling rake, as well as remilling the board to be much more clean and concise. The board now looks so much better and is smaller as well, as another added bonus. To mount the board to my project, I had printed some small pieces to fit on the corners of the board to make it stay still. I simply drilled them into my box, and the board could no longer move! With those final small touches my project was now finished and I could move onto creating the videos and final slide!

Bill of materials

4 tiankong mg996r servo motors

1 Seeed studio XIAO RP2040

1 raspberry pi pico rp2040

1/2 inch plywood

1/8 inch acrylic

PLA 3D printing filament

1 MPU6050 accelerometer

1 USB power bank

1 piece of T-bar

Molding and casting materials

assorted screws and fasteners

Project workings

My final project functions by using 4 Tiankong mg996r servo motors which are used to drop the seeds.

These motors are hooked up to a raspberry pi rp2040 PICO, and are running in micropython. The project drops a seed at a set distance based off the acceleration value received by an mpu6050 accelerometer.

The accelerometer is connected to a Seeed studio XIAO rp2040 via I2C connection, and sends a command to the PICO via UART communication. The project is made up of 3D printed, casted, CNC milled, and laser cut parts, all designed completely by myself. The paddles attatched to the servos for the dropper mechanism were molded and casted.

The box/housing was cnc milled and fastened using the domino and wood glue.

The tubing, funnels, mounting brackets, and rake were completely 3D printed.

And were designed fully in fusion 360

The panel for access to the board was created by laser cutting.

All of this culminates with this final project

File download

File for my final project can be found here

The Seeed Box is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.