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
MKS SBASE Set current issue #14
Comments
Oops, likely typo on my part. WIll commit a fix. It will be great if you can verify that setting the current works as I do not have a MKS board for testing. |
According to the MKS SBASE board schematic, it would also be more accurate if the current setting factor was 100.45f instead of 113.0f. cmd [1] = (uint8_t) min (255.0f, roundf (current * 100.45f)); However, the current adjustment functionality works correctly. Nice work with the software, Terjeio |
The Marlin driver uses 106.7 as the factor (AFAICT). The schematic I have specifies two different values for Rsense depending on the driver version (DRV8824 vs DRV8825) and R11 = 20K (with an asterix meaning that this might be different on the board?) in the BOM so for me it it is impossible to tell what is correct. So I'll change it to 100.45. I must say I am a bit curious about how you arrived at that factor though. |
Yes, the R11 in my board (DRV8825) is exacty 20K. The Vref impedance in the DRV8825 is superior at 1M1 ohms, then, the Vpot drain current (at the cursor) is negligible. There are 4 50K potenciometers in parallel and with the R1 they are forming a voltage divisor to obtain 1.269 volts as reference for the 4 potenciometers. Applying electronic mathematics, the value for the potenciometer is Value=100.45 *Imotor. I have measured it on my board with a voltmeter and the theory exactly matches the result. |
it's good to be curious ... |
No problem. I wonder if the factor should be multiplied with sqrt(2) to set the RMS value as it looks like the current from Equation 1 (in chapter 8.3.2) in the datasheet is the peak current. The Trinamic driver code I've seen does that. However, the Marlin documentation for digipots does not help in making that clear, not even for the Trinamic setting which I assume is the RMS current... |
Fix committed with your factor. |
There is an error in the configuration of the motor current at routine "mks_set_current" in the file mks_sbase.c
The correct line is:
static const uint8_t wiper_registers[] = {0x00, 0x01, 0x06, 0x07};
The text was updated successfully, but these errors were encountered: