def config_as_gcode(**kwargs):
    """
    Make a set of commands to save the configuration.

    :param x_ratio: The X axis ratio (mm/step)
    :param y_ratio: The Y axis ratio (mm/step)
    :param z_ratio: The Z axis ratio (mm/step)

    :param x_drive: X axis drive mode (0:normal, 1:full torque, 2:half step)
    :param y_drive: Y axis drive mode (0:normal, 1:full torque, 2:half step)
    :param z_drive: Z axis drive mode (0:normal, 1:full torque, 2:half step)

    :param x_play: X axis play
    :param y_play: Y axis play
    :param z_play: Z axis play

    :param x_reverse: Should the X axis be reversed ?
    :param y_reverse: Should the Y axis be reversed ?
    :param z_reverse: Should the Z axis be reversed ?

    :param x_min_time: The minimal duration between 2 pulse for the x axis in
        milliseconds.
    :param y_min_time: The minimal duration between 2 pulse for the y axis in
        milliseconds.
    :param z_min_time: The minimal duration between 2 pulse for the z axis in
        milliseconds.

    :type x_ratio: float
    :type y_ratio: float
    :type z_ratio: float

    :type x_drive: int
    :type y_drive: int
    :type z_drive: int

    :type x_play: float
    :type y_play: float
    :type z_play: float

    :type x_reverse: bool
    :type y_reverse: bool
    :type z_reverse: bool

    :type x_min_time: int
    :type y_min_time: int
    :type z_min_time: int
    """
    r = []
    r.append('M92 X{x_ratio} Y{y_ratio} Z{z_ratio}'.format(**kwargs))
    drive = [5, 6, 7]
    r.append('S{} X'.format(drive[kwargs['x_drive']]))
    r.append('S{} Y'.format(drive[kwargs['y_drive']]))
    r.append('S{} Z'.format(drive[kwargs['z_drive']]))
    r.append('S8 X{x_play} Y{y_play} Z{z_play}'.format(**kwargs))
    reverse = {(True): 9, (False): 10}
    r.append('S{} X'.format(reverse[kwargs['x_reverse']]))
    r.append('S{} Y'.format(reverse[kwargs['y_reverse']]))
    r.append('S{} Z'.format(reverse[kwargs['z_reverse']]))
    r.append('S11 X{x_min_time} Y{y_min_time} Z{z_min_time}'.format(**kwargs))
    return '\n'.join(r)
