Skip to content

Commit

Permalink
Merge pull request #386 from MaslowCNC/Split-kinematics-settings-from…
Browse files Browse the repository at this point in the history
…-motor-settings

Split kinematics settings from motor settings
  • Loading branch information
BarbourSmith authored Aug 17, 2017
2 parents ea91b1c + 51f33af commit 46c2a04
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Simulation/simulationCanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def recompute(self):
self.verticalPoints = range(int(int(topBottomBound/self.gridSize.value)*self.gridSize.value), -topBottomBound, -1 * int(self.gridSize.value))
self.horizontalPoints = range(int(int(leftRigthBound/self.gridSize.value)*self.gridSize.value), -leftRigthBound, -1 * int(self.gridSize.value))

#self.doSpecificCalculation()
self.doSpecificCalculation()

for j in self.verticalPoints:
for i in self.horizontalPoints:
Expand Down
59 changes: 30 additions & 29 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,26 +437,8 @@ def close_settings(self, settings):

def push_settings_to_machine(self, *args):

cmdString = ("B03"
+" A" + str(self.data.config.get('Maslow Settings', 'bedWidth'))
+" C" + str(self.data.config.get('Maslow Settings', 'bedHeight'))
+" Q" + str(self.data.config.get('Maslow Settings', 'motorSpacingX'))
+" E" + str(self.data.config.get('Maslow Settings', 'motorOffsetY'))
+" F" + str(self.data.config.get('Maslow Settings', 'sledWidth'))
+" R" + str(self.data.config.get('Maslow Settings', 'sledHeight'))
+" H" + str(self.data.config.get('Maslow Settings', 'sledCG'))
+" I" + str(self.data.config.get('Maslow Settings', 'zAxis'))
+" J" + str(self.data.config.get('Advanced Settings', 'encoderSteps'))
+" K" + str(self.data.config.get('Advanced Settings', 'gearTeeth'))
+" M" + str(self.data.config.get('Advanced Settings', 'chainPitch'))
+" N" + str(self.data.config.get('Maslow Settings' , 'zDistPerRot'))
+" P" + str(self.data.config.get('Advanced Settings', 'zEncoderSteps'))
+ " "
)

self.data.gcode_queue.put(cmdString)

#Split the settings push into two so that it doesn't exceed the maximum line length
#Push motor configuration settings to machine


if int(self.data.config.get('Advanced Settings', 'enablePosPIDValues')) == 1:
Expand All @@ -477,27 +459,48 @@ def push_settings_to_machine(self, *args):
KiV = 1
KdV = 0

if self.data.config.get('Advanced Settings', 'kinematicsType') == 'Quadrilateral':
kinematicsType = 1
print "quadrilateral recognized"
else:
kinematicsType = 2
print "triangular kinematics recognized"

cmdString = ("B03"

cmdString = ("B12"
+" I" + str(self.data.config.get('Maslow Settings', 'zAxis'))
+" J" + str(self.data.config.get('Advanced Settings', 'encoderSteps'))
+" K" + str(self.data.config.get('Advanced Settings', 'gearTeeth'))
+" M" + str(self.data.config.get('Advanced Settings', 'chainPitch'))
+" N" + str(self.data.config.get('Maslow Settings' , 'zDistPerRot'))
+" P" + str(self.data.config.get('Advanced Settings', 'zEncoderSteps'))
+" S" + str(KpPos)
+" T" + str(KiPos)
+" U" + str(KdPos)
+" V" + str(KpV)
+" W" + str(KiV)
+" X" + str(KdV)
+ " "
)

self.data.gcode_queue.put(cmdString)

#Push kinematics settings to machine
if self.data.config.get('Advanced Settings', 'kinematicsType') == 'Quadrilateral':
kinematicsType = 1
else:
kinematicsType = 2

cmdString = ("B03"
+" A" + str(self.data.config.get('Maslow Settings', 'bedWidth'))
+" C" + str(self.data.config.get('Maslow Settings', 'bedHeight'))
+" Q" + str(self.data.config.get('Maslow Settings', 'motorSpacingX'))
+" E" + str(self.data.config.get('Maslow Settings', 'motorOffsetY'))
+" F" + str(self.data.config.get('Maslow Settings', 'sledWidth'))
+" R" + str(self.data.config.get('Maslow Settings', 'sledHeight'))
+" H" + str(self.data.config.get('Maslow Settings', 'sledCG'))
+" Y" + str(kinematicsType)
+" Z" + str(self.data.config.get('Advanced Settings', 'rotationRadius'))
+ " "
)

self.data.gcode_queue.put(cmdString)



'''
Update Functions
Expand Down Expand Up @@ -604,8 +607,6 @@ def setPosOnScreen(self, message):
except:
print "One Machine Position Report Command Misread"
return



def setErrorOnScreen(self, message):

Expand Down

0 comments on commit 46c2a04

Please sign in to comment.