Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chain sag adjustment to simulator #609

Merged
merged 1 commit into from
Feb 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Simulation/simulationCanvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def initialize(self):
self.leftChainOffset.bind(value=self.onSliderChange)
self.rightChainOffset.bind(value=self.onSliderChange)
self.rotationRadiusOffset.bind(value=self.onSliderChange)
self.chainSagCorrectionOffset.bind(value=self.onSliderChange)

self.vertCGDist.bind(value=self.onSliderChange)
self.gridSize.bind(value=self.onSliderChange)
Expand Down Expand Up @@ -81,6 +82,7 @@ def resetSliders(self):
self.leftChainOffset.value = 0
self.rightChainOffset.value = 0
self.rotationRadiusOffset.value = 0
self.chainSagCorrectionOffset.value = 0
self.gridSize.value=300

def recompute(self):
Expand Down Expand Up @@ -391,7 +393,10 @@ def onSliderChange(self, *args):

self.distortedKinematics.rotationDiskRadius = self.correctKinematics.rotationDiskRadius + self.rotationRadiusOffset.value
self.rotationRadiusLabel.text = "Rotation Radius\nSpacing Error: " + "%.2f" % self.rotationRadiusOffset.value + "mm"


self.distortedKinematics.chainSagCorrection = self.correctKinematics.chainSagCorrection + self.chainSagCorrectionOffset.value
self.chainSagCorrectionLabel.text = "Chain Sag\Correction Error: " + "%.2f" % self.chainSagCorrectionOffset.value

#self.machineLabel.text = "distance between sled attachments ideal: "+str(self.correctKinematics.l)+" actual: "+str(self.distortedKinematics.l)+"mm\nvertical distance between sled attachments and bit ideal: "+str(self.correctKinematics.s)+" actual: "+str(self.distortedKinematics.s)+"mm\nvertical distance between sled attachments and CG ideal: "+str(self.correctKinematics.h3+self.correctKinematics.s)+" actual: "+str(self.distortedKinematics.h3+self.distortedKinematics.s)+"mm\ndistance between motors ideal: "+str(self.correctKinematics.D)+" actual: "+str(self.distortedKinematics.D)+"mm"

self.gridSizeLabel.text = "Grid Size: "+str(int(self.gridSize.value))+"mm"
Expand Down
14 changes: 14 additions & 0 deletions groundcontrol.kv
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,8 @@
gridSizeLabel:gridSizeLabel
rotationRadiusOffset:rotationRadiusOffset
rotationRadiusLabel:rotationRadiusLabel
chainSagCorrectionOffset:chainSagCorrectionOffset
chainSagCorrectionLabel:chainSagCorrectionLabel
kinematicsSelect:kinematicsSelect

rows: 3
Expand Down Expand Up @@ -1344,6 +1346,18 @@
value: 0
disabled: root.isQuadKinematics
id: rotationRadiusOffset
Label:
text: "Chain Sag Correction"
text_size: self.width, self.height
font_size: sp(self.height)/sp(3)
disabled: root.isQuadKinematics
id: chainSagCorrectionLabel
Slider:
min: -50
max:50
value: 0
disabled: root.isQuadKinematics
id: chainSagCorrectionOffset
Label:
text: "Grid Size: 150mm"
text_size: self.width, self.height
Expand Down