def calc_rpm(da, wait):
    """
    Given an angular delta and a wait time, calculate the rpm needed to achieve

    [Join Mode]
    0 ~ 1,023(0x3FF) can be used, and the unit is about 0.111rpm.
    If it is set to 0, it means the maximum rpm of the motor is used
    without controlling the speed. If it is 1023, it is about 114rpm.
    For example, if it is set to 300, it is about 33.3 rpm.

    AX12 max rmp is 59 (max speed 532)
    rev  min     360 deg      deg
    --- -------  ------- = 6 ----
    min  60 sec    rev        sec

    rpm = abs(new_angle - old_angle)/(0.111 * wait * 6)
    """
    return int(abs(da) / (0.111 * wait * 6))
