MKS-SERVO42C icon indicating copy to clipboard operation
MKS-SERVO42C copied to clipboard

UART communication protocol does not set 256 microsteps as it only uses a byte

Open DanielMarcato opened this issue 1 year ago • 1 comments

The firmware is not capable of setting the microsteppings to 256 via UART even though the display shows 256 as option and this can be chosen via the physical buttons. Reason is the communication procotol uses a byte for the microstepping and a byte can only have 255 as maximum value. This is also true for the official MKS SERVO42C CONTROL TOOL and can be seen in their source code.

if (DataSended == 12)           
{
    SubdivisionText = Convert.ToUInt16(comboBox22.Text, 10);
    Console.WriteLine(SubdivisionText);
    if (SubdivisionText < 257 && SubdivisionText >= 1)
    {
        Subdivision = Convert.ToByte(SubdivisionText);
        tCHK = Addr + data + Subdivision;
        byte t = (byte)tCHK;
        Buffer = new byte[] { Addr, (byte)data, (byte)Subdivision, (byte)tCHK };
        WriteByteToSerialPort(Buffer, 0, 4);
    }
    else
        MessageBox.Show(Text1_SubdivisionError, Text1_window);
}

which throws an exception when actually calling this with a SubdivisionText of 256

DanielMarcato avatar Jan 18 '24 09:01 DanielMarcato

Ugh, I was considering getting some of these, this type of thing is horrendous, it's such a dumb bug it means that MKS didn't even try their product ONCE before shipping it.

kyle-wendling avatar Feb 12 '24 21:02 kyle-wendling