View Single Post
  #1   Spotlight this post!  
Unread 04-27-2015, 02:01 AM
will4499 will4499 is offline
Registered User
FRC #4499
 
Join Date: Apr 2014
Location: Fort Collins
Posts: 9
will4499 is an unknown quantity at this point
Fastest Possible Canburglar

I wrote a python script to calculate the fastest possible canburglar you could make if it was powered by motors... it appears to be in the 20 ms range. This was inspired by the can burglar from 973 that we were putting on our robot in place of the "tail" at the championship. Let me know what you think.

I attached the python file as canburglar.txt and a pdf which I used for some of the equations. Here is the code:

import math
## Using SI Units - kg, m, s, current in Amperes, angles are printed in degrees but calculations are in radians

##System
t = 0
e = 2.718281828459045
dt = 0.001
rod_mass = .15 # kg
rod_length = 2.5 # m
hook_mass = .05 # kg
J = ((16/48) * rod_mass * (rod_length ** 2)) + hook_mass * (rod_length ** 2) ## rod moment of inertia + hook moment of inertia
angle = 0
terminalangle = 90 * (math.pi / 180) # in radians

#Motor Banebots RS-775 down-regulated to 12v
motor_num = 4
motor_stall_I = 100
motor_stall_T = 1.175
motor_free_omega = 13000 * math.pi * 2
geardown = 1
test_endpoint = 3000
print(motor_free_omega)

def getVelocity():
power_term = -((motor_stall_T * motor_num * geardown)/ (J * (motor_free_omega / geardown))) * t
return (motor_free_omega / geardown) * (1 - e ** power_term)

lowestt = 1, 1, 10000 # low geardown, high geardown, time
while (geardown <= test_endpoint):
#print("terminal velocity = " + str(motor_free_omega / geardown / (2 * math.pi)))
while angle < terminalangle:
angle += getVelocity() * dt
t += dt
print("terminal velocity = " + str(motor_free_omega / geardown / (2 * math.pi)) + " rpm " + " geardown = " + str(geardown) + " angle = " + str(angle / (math.pi / 180) ) + " t = " + str(t) + " velocity = " + str(getVelocity() / (2 * math.pi)) + " rpm " + " \n")
#print("geardown = " + str(geardown) + " angle = " + str(angle / (math.pi / 180) ) + " t = " + str(t))
if (lowestt[2] > t):
lowestt = geardown, geardown, t
elif lowestt[2] == t:
lowestt = lowestt[0], geardown, t

t = 0
angle = 0
geardown += 1

print("fastest canburglar, geardown = " + str(lowestt[0]) + " :")
geardown = lowestt[0]
while angle < terminalangle:
angle += getVelocity() * dt
t += dt
print("terminal velocity = " + str(motor_free_omega / geardown / (2 * math.pi)) + " rpm " + " geardown = " + str(geardown) + " angle = " + str(angle / (math.pi / 180) ) + " t = " + str(t) + " velocity = " + str(getVelocity() / (2 * math.pi)) + " rpm " + " \n")

if (test_endpoint == lowestt[1]):
print("******************************************* ************************************************** **********************************************")
print("**************** Warning, you may not have found the absolute minimum for cangrabber speed. Increase test_endpoint. ***********************")
print("******************************************* ************************************************** **********************************************")
else:
print(" Choose a gear ratio between " + str(lowestt[0]) + " and " + str(lowestt[1]))
Attached Files
File Type: pdf motors.pdf (546.5 KB, 39 views)
File Type: txt canburglar.txt (2.6 KB, 34 views)
Reply With Quote