So I purchased a Smoothieboard from AliExpress.
Struggled to get anything working, finally found that the VREF voltage at the stepper drivers was WAY too high, so started to have a closer look…
Then I found a youtube video explaining that these boards are fitted with MCP4441-104 devices which are incorrect. They have an internal resistance of 100K for each potentiometer and a resolution of 7 bits, whereas the design calls for MCP4451-503. The correct device has internal resistance of 50K and resolution of 8 bits.
This has important implications for the design as the 4 potentiometers within the MCP chip are connected in parallel to a resistor that then connects to 3.3v. The wiper output from the potentiometer is used for the VREF voltage sent to the A4958 stepper drivers.
A detailed perusal of the datasheets and the smoothieware source code revealed that the setting of the MCP4451 controls the configuration of the chip to set the value of the potentiometer which acts as a voltage divider.
The value of the current setting for each stepper motor is held in the configuration file and should be a maximum of 2 amps.
This current setting is converted into a 8 bit value (<= 255) using a conversion factor and sent to the MCP chip. The conversion factor is chosen to be 113.33 in the source code, and the code caps the maximum value sent to the MCP at 255.
Unfortunately, this does not work well with the MCP4441-104 devices, as the VREF voltage supplied to the A4958 stepper drivers is either way too high, or unpredictable, due to the conversion factor used and the 7 bit resolution of the wiper output. Also, the voltage divider uses a 33K resistor, which when used with the 100K MCP4441-104 results in the voltage being too high for the divider to work in the correct range.
So, can this be fixed? Well, the answer is sort of. You can replace the 4441 with the correct chip or if the conversion factor can be altered, then it might be possible to get a workable setting.
Fortunately, this variable is exposed in the configuration file, but not present by default.
If you include the following line in your config, then it will be much improved, with an accuracy of within around 2% of the desired values.
digipot_factor 36.6
Please note that there is NO current limit on this, it is theoretically possible to exceed the maximum current that the A5984 is supposed to be able to handle (2A), so be careful not to set the current on each stepper motor too high, or the result may be unpredictable.
Enjoy!