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 Wrap Direction #607

Merged
merged 3 commits into from
Feb 5, 2018
Merged

Add Chain Wrap Direction #607

merged 3 commits into from
Feb 5, 2018

Conversation

reecej
Copy link
Contributor

@reecej reecej commented Feb 2, 2018

This adds a configuration setting to select which way the chain wraps around the sprocket to go to the motor. Changes are also made to update the simulator and triangular kinematics calibration code, as well as add a calibration step to select the appropriate configuration.

Since I don't have my Maslow yet I was not able to take pictures showing the top versus bottom configurations in the calibration process, so I did my best to utilize already-available images. Additional images may help new users here though.

Note that this does not update the quadrilateral kinematics, so using quadrilateral kinematics with the chains on bottom of the motor sprockets could lead to accuracy errors.

This is the GroundControl PR associated with Firmware PR 382.

This adds a configuration setting to select which way the chain wraps around the sprocket to go to the motor. Changes are also made to update the simulator and triangular kinematics calibration code, as well as add a calibration step to select the appropriate configuration.
@reecej
Copy link
Contributor Author

reecej commented Feb 2, 2018

Note that the calibration process will need to be tested for the chain on bottom configuration. Specifically, I would ask someone to test that the motor spacing measurement technique using the chains still works. I added a piece of code to allow this to still be utilized with the chain on bottom of the left sprocket, but it required additional math.

@blurfl
Copy link
Collaborator

blurfl commented Feb 2, 2018

I am gathering the parts to set up to test this, maybe get it tested today.

@BarbourSmith
Copy link
Member

You work FAST! I will test this right away also

@davidelang
Copy link
Contributor

davidelang commented Feb 2, 2018 via email

@reecej
Copy link
Contributor Author

reecej commented Feb 2, 2018

Good point, didn't think of that. I'll have to brainstorm on this.

@BarbourSmith
Copy link
Member

I played around with the idea of going from the bottom on one side to the top on the other side. It's not very clean and I wouldn't recommend it.

image

image

I think we should do what @reecej and @davidelang are suggesting and just do it like we did before but send reverse commands if the chain is on the bottom.

@BarbourSmith
Copy link
Member

For the sake of smoothness and getting things done I say we don't mess with that calibration step at all in this PR and just merge the parts of this PR which add the setting to GC because that's a whole feature in and of itself.

I've got #604 , #605, and #606 open which clean up how some of this works (letting the user extend any length of chain) and it might make more sense to start building off of those after they are merged.

@reecej
Copy link
Contributor Author

reecej commented Feb 2, 2018

That sounds good to me. I'll pull out the calibration changes, but leave in the settings value and kinematics updates. I'll also put in the reverse commands for the motor spacing!

@BarbourSmith
Copy link
Member

Perfect!

@blurfl
Copy link
Collaborator

blurfl commented Feb 3, 2018

When we do start looking into the calibration stuff, the chain cal CW and CCW need to be reversed. Too, it's not possible to hook the first link on the 'top' tooth, do we need to hook the second or third link there?

@davidelang
Copy link
Contributor

davidelang commented Feb 3, 2018 via email

@blurfl
Copy link
Collaborator

blurfl commented Feb 3, 2018

we should be hooking the chain to the top tooth

With the chain feeding to the sprocket horizontally, the top tooth isn't enough to hold the chain in place. Give it a try. This is the same issue that was addressed in the motor distance measurement by using the third link on the top tooth. We need to change the math, and update the instructions.

Removed the chainOverSprocket selection from the calibration menu, and added some enhancements for the sprocket alignment and Y offset measurement.
Updated the motor Y offset measurement for the chain on bottom configuration.
@reecej
Copy link
Contributor Author

reecej commented Feb 4, 2018

Made some updates. I removed the chainOverSprocket from the calibration process. Also configured a few calibration steps to account for the chain on bottom configuration, including the sprocket zero step, the measure motor spacing step, and the measure Y offset step. Would you guys be able to try it out?

There are a few things still outstanding. First, at some point if they want the chains on bottom we need to include that as a step, especially for the left motor as they will have been using that with the chain on top for the calibration process. Should we have them put the third link of the chain on the sprocket in that case, to prevent it falling off?

@BarbourSmith
Copy link
Member

I will test this right away! Excellent!

self.data.gcode_queue.put("G90 ")

def RightCW(self):
degValue = float(self.data.config.get('Advanced Settings',"gearTeeth"))*float(self.data.config.get('Advanced Settings',"chainPitch"))/360.0;
self.data.gcode_queue.put("G91 ")
self.data.gcode_queue.put("B09 R-"+str(degValue)+" ")
if self.data.config.get('Advanced Settings', 'chainOverSprocket') == 'Top':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really beautifully done. Its simple, but I like that it just works based on the settings and doesn't ask the user anything

@BarbourSmith
Copy link
Member

This works great for me! I'm going to merge it and then start thinking about what is next for the calibration process 👍 👍 💯

@BarbourSmith BarbourSmith merged commit f9928ba into MaslowCNC:master Feb 5, 2018
@blurfl
Copy link
Collaborator

blurfl commented Feb 5, 2018

The change of Top/Bottom doesn't take effect until GC is restarted, is that right? If so, maybe making the change should pop up a dialog reminding the user of this, counseling to quit.

@reecej
Copy link
Contributor Author

reecej commented Feb 5, 2018

This is where it gets a bit complicated. When the setting is changed in GC, it takes immediate effect. So right away the calibration step functions, such as the buttons to rotate the motors CW/CCW will be reversed. However, the firmware only checks the value at system startup. So really, when the setting is changed in GC the board should be restarted right away.

I think it would be good to include some disclaimer there. I can add that as a separate PR. Also, when this begins undergoing more thorough testing, just be aware that there may still be a few random bugs!

@reecej reecej deleted the Chain-Around-Sprocket branch February 6, 2018 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants