####################################################################################### #This section works out the speeds and feeds for the motors based on the layup schedule. ####################################################################################### import math # Define Variables mandrelStart = 0.0 # How far along the mandrel to start in mm mandrelLength = 200.0 #Mandrel Length in mm mandrelDiameter = 25.0 #Mandrel Diameter in mm filamentWidth = 5.0 # Width of filiament in mm layupSchedule = [45, 0, 90] # Define full coverage layers in laminate mandrelRPM = 10 #Revolutions of the mandrel per minute #Calculate required x speed to achieve angle called out in layupSchedule ply = 1 # ply number will need to change automatically later plyAngle = layupSchedule[ply-1] # angle specific to that ply print 'plyAngle = ', plyAngle mandrelLinearVelocity = mandrelDiameter/2 * mandrelRPM #mm/min # print(mandrelLinearVelocity) # 90 would be 0 feed, 0 would be full feed and 0 rpm.... cicumfrential length = angle * radius zSpeedrev = (2 * mandrelDiameter ) / math.tan(math.radians(plyAngle)) # z speed in mm/rev zSpeedlin = zSpeedrev * mandrelRPM #xSpeed = math.cos(math.radians(plyAngle-45)) * mandrelLinearVelocity print'Speed/Rev:', zSpeedrev, 'mm/rev' print'Speed Linear', zSpeedlin, 'mm/min' ########################################################################################## zAxisRatio = 1.5 #Mechanical ratio that the Z carrige moves wrt the Z stepper. windingLength = mandrelLength - mandrelStart layerFill = 1 # 1 = 100% coverage #zDistanceToMove #cDistancetoMove
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question