Our funnel was created in Onshape by designing a shape and using the revolve tool. We were careful to make it as narrow as we could to prevent
Height - approx. 4 inches
Width - 9mm (wide enough for 1 skittle)
Bezels - 1mm
This piece was the main part of our singularizer. When a skittle reached the bottom of the funnel, the smaller circle was under the funnel ready to recieve the skittle. It then dragged it to the sensor, and after to the hole to go to the slide.
Diameter(Large circle) - 3 inches
Diameter(Small circle) - 11mm
The singularizing servo spins between the funnel, sensor, and hole to get the skittles sensed and to the slide. We glued it to a shelf to maintain its position as well.
This was the code that we used for the singularizer, and it was very basic. The top 2 lines are what grab the skittle from the funnel, and the bottom 2 take the skittle to the sensor to be read.
Our color sensor was the hardest part of this project. The way the color sensor works is that it shines a light, and then reads 3 values, being the RGB, temperature, and Lux. We tested each color skittle under the sensor to get an average reading, and then made a system of if statements to determine what color each skittle was. Colors like green and purple, that have 1 extremely high RGB value(green and blue, respectively), were very easy to sort, but red, orange, and yellow, were harder.
These were all of the if statements that we used. Once a skittles values were read, they were sent through this sequence of if statements, so that the color could be determined. In these if statements was also the ramp movement, to cut down on wasted time.
In our first design, we did a recangular slide, but with testing we found that it was hard to guarentee the way the skittle would come down the slide. We decided to go into a more triangular slide, because that way the way the skittle comes off the slide was easily repeatable.
The ramp servo works similarily to the singularizing servo, but it has overall less movement to do. Along with this, because it is a positional servo, there is no need to 'reset' it back to a central angle, which saves time.
Onshape is a digital design platform that allows for the user to fabricate 2D objects and laser cut them, or 3D objects and 3d print them. For laser cutting, we used our 2 Glowforges, and for 3D printing we used our Ender 3D printers. I used Onshape to laser cut all parts of my robot, including the chassis, sides, tops, and wheels. I also used Onshape to 3D print the parts with heights, for example my caster wheel and servo mounts.
I fabricated every piece on my robot, including:
Chassis
Sides
Trunk
Windshield and Back Glass
Front Grill
Caster Wheel
Servo Mount
This file holds the progress of my robot, from my original chassis to the final design with three electronic components
In my code, I used functions to control my robot's movement(forward, backward, left and right, stop), and to control other aspects of my code like lights or my ultrasonic sensor
I also used if statements so that my robot knew when to run the code. For example, when my robot was close to reaching a wall, it would stop, turn, and then give control back to the user(turned off to allow for more control for the driver)
import binascii
import board
import busio
import digitalio
import time
import pwmio # imports a library called pwmio
from adafruit_motor import (
servo,
) # imports a library called servo from the folder adafruit_motor
from dabble import Dabble
dabble = Dabble(board.GP0, board.GP1, debug=True)
# create a PWMOut object on Pin A2.
pwm_left = pwmio.PWMOut(
board.GP2, duty_cycle=2 ** 15, frequency=50
) # defines an object called pwm using the pwm library & attaches it to GP22
pwm_right = pwmio.PWMOut(
board.GP22, duty_cycle=2 ** 15, frequency=50
) # defines an object called pwm using the pwm library & attaches it to GP2
# Create a servo object, my_servo.
my_servo_left = servo.Servo(
pwm_left
) # defines an object called my_servo using the servo library & pwm
my_servo_right = servo.Servo(
pwm_right
) # defines an object called my_servo using the servo library & pwm
def forward():
my_servo_left.angle = 180 # rotates servo horn at full speed CCW
my_servo_right.angle = 0 # rotates servo horn at full speed CW
def backward():
my_servo_left.angle = 0 # rotates servo horn at full speed CW
my_servo_right.angle = 180 # rotates servo horn at full speed CCW
def left():
my_servo_left.angle = 0
my_servo_right.angle = 0
def right():
my_servo_left.angle = 180
my_servo_right.angle = 180
def avoid():
my_servo_left.angle = 90
my_servo_right.angle = 90
time.sleep(1)
my_servo_left.angle = 180
my_servo_right.angle = 180
time.sleep(1)
my_servo_left.angle = 90
my_servo_right.angle = 90
time.sleep(1)
def stop():
my_servo_left.angle = 90
my_servo_right.angle = 90
time.sleep(1)
while True:
message = dabble.read_message()
if message.up_arrow_pressed:
print("Move both motors forward")
forward()
elif message.down_arrow_pressed:
print("Move both motors backward")
backward()
elif message.right_arrow_pressed:
print("Move left motor forward and right motor backward")
right()
elif message.left_arrow_pressed:
print("Move left motor backward and right motor forward")
left()
elif message.no_direction_pressed:
print("Stop both motors")
stop()
Straight - 9/10 - Robot goes forward when desired, slight drift along surfaces with less grip(tile, wet floors)
Turning - 8/10 - Robot turns effeciently and in place, due to the caster wheel, and along with the lack of 2 front passive wheels
Looks - 7/10 - Electronics fully enclosed, no glue showing, but some pieces didn't come together fully.
How has this project compared to other projects that you have done in your other classes?
This project has been one of a kind, both in its ups and downs. However, it has been one of my favorite projects I've ever done
What would you change about your robot if you were to do this project again?
I would have started preparing for the final design earlier in the class, and worked more dilligently. I also would've tried to familiarize myself and organize my wiring better, to avoid problems that came up later
What is the top skill that you think you know well enough to that you could teach to others and why?
I think that after the amount of times I had to rewire and reorganize my wires, that I could teach proper wiring management and documentation.