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

Option to use raw digipot values #17536

Merged
merged 13 commits into from
Apr 19, 2020
Merged

Option to use raw digipot values #17536

merged 13 commits into from
Apr 19, 2020

Conversation

grauerfuchs
Copy link
Contributor

@grauerfuchs grauerfuchs commented Apr 14, 2020

For machines with the MCP4018 digipot controller (i.e. Mightyboard)

The existing driver hard-codes the current calculations for the A4988 stepper driver. This is fine on stock machines, but users must fudge the numbers if they use a different type of stepper driver on one or more axes.

Usage:
Defining the new MCP4018_USE_RAW_VALUES config option will enable use of the DIGIPOT_MOTOR_CURRENT config option values rather than DIGIPOT_I2C_MOTOR_CURRENTS, and M907 will accept raw wiper values (0-127) on all channels.

Testing:
This code is now running on both of my FFCP machines with TMC2100s on X and Y and the original steppers on Z, A, and B. The TMC2100 driver modules in use are designed specifically for drop-in compatibility on the Mightyboard, including use of the digipot for setting Vref.

@thinkyhead thinkyhead changed the title Option: Use raw digipot values for MCP4018 instead of A4988 currents Option to use raw digipot values Apr 19, 2020
@thinkyhead thinkyhead merged commit 4a5a3d2 into MarlinFirmware:bugfix-2.0.x Apr 19, 2020
@tharts
Copy link
Contributor

tharts commented Apr 24, 2020

This change seems to break building for MKS Sbase (LPC1768) if mcp4451 is uncommented. Sanity check complains about missing pins definitions which wasn't the case before.
Digipots worked with the previous version when the option digipot_i2c was uncommented.

thinkyhead added a commit that referenced this pull request Apr 25, 2020
@thinkyhead
Copy link
Member

Patched! Apparently MKS SBASE is special and provides its own interface. Others will still need these pins.

@tixenre
Copy link

tixenre commented Aug 2, 2020

This change seems to break building for MKS Sbase (LPC1768) if mcp4451 is uncommented. Sanity check complains about missing pins definitions which wasn't the case before.
Digipots worked with the previous version when the option digipot_i2c was uncommented.

I'm having the same issue building for Smoothieboard (LPC1769) if mcp4451 on Marlin 2.06
#error "DIGIPOT_MCP4018/4451 requires DIGIPOTS_I2C_SDA_* pins to be defined."

@thinkyhead
Copy link
Member

Comment out the #error line and see if it can build.

jmp0x0000 pushed a commit to jmp0x0000/Marlin that referenced this pull request Aug 7, 2020
jmp0x0000 pushed a commit to jmp0x0000/Marlin that referenced this pull request Aug 7, 2020
njibhu pushed a commit to njibhu/Marlin that referenced this pull request Aug 24, 2020
njibhu pushed a commit to njibhu/Marlin that referenced this pull request Aug 24, 2020
HairingX pushed a commit to HairingX/Marlin that referenced this pull request Jun 16, 2021
HairingX pushed a commit to HairingX/Marlin that referenced this pull request Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants