Skip to content

Instantly share code, notes, and snippets.

@rasheeddo
Last active January 7, 2021 12:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rasheeddo/91a3672d019616abb48ef66f29f04941 to your computer and use it in GitHub Desktop.
## This code is to generate equation string as X and Y
## to use with Solidworks -> Equaiton Driven Curve
## to generate cycloidal disc sketch
'''
# ratio 14:1 with 7015GYEMS
R = 42
E = 1.5 #E < R/N
Rr = 4
N = 15
'''
# ratio19:1 with 5010/5015 GYEMS servo
R = 28
E = 1 # E < R/N
Rr = 4
N = 20
# Definitions
# R : Radius of the roller's PCD (Pitch Circle Diameter)
# E : Eccentricity (or offset) from input shaft to a cycloid disc
# Rr : Radius of the roller
# N : Number of rollers
# Raio is N-1:1
# Precalculation
R_EN = R/(E*N)
NmE = N-E
_N = 1-N
#X = (R*cos(t))-(Rr*cos(t+arctan(sin((1-N)*t)/((R/(E*N))-cos((1-N)*t)))))-(E*cos(N*t))
#Y = (-R*sin(t))+(Rr*sin(t+arctan(sin((1-N)*t)/((R/(E*N))-cos((1-N)*t)))))+(E*sin(N*t))
X = "({}*cos(t)) - ( {}*cos( t+arctan( sin({}*t)/({} - cos({}*t)) ) ) ) - ({}*cos({}*t)) ".format(R,Rr,_N,R_EN,_N,E,N)
Y = "(-{}*sin(t)) + ( {}*sin( t+arctan( sin({}*t)/({} - cos({}*t)) ) ) ) + ({}*sin({}*t)) ".format(R,Rr,_N,R_EN,_N,E,N)
print(X)
print(Y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment