<?xml version="1.0"?>
<motor_driver xmlns:xi="http://www.w3.org/2001/XInclude">

    <motor
            pole_pairs="7"
            speed_constant="182"
            torque_constant="52.5/1000.0"
            max_winding_current="100.0"
            max_motor_speed="5000"
            max_winding_temperature="125"
            winding_resistance="0.293"
            winding_inductance="0.279/1000.0"
            torque_temp_constant="nan"
            velocity_temp_constant="nan"
    />

    <thermal_model
            housing_thermal_resistance="1.94"
            winding_thermal_resistance="1.48"
            housing_thermal_time_const="69.9"
            winding_thermal_time_const="16.1"
            temperature_source="SENSOR"
            model_start_percentage="0.5"
    />

    <controller mode="BLOCK_COMMUTATION">
    </controller>

    <encoders 
        motor_encoder="HALLS" 
        output_encoder="NONE" 
        deflection_encoder="NONE" 
        torque_source="CURRENT_ESTIMATE">
        <hall_switches 
            direction="REVERSE" 
            absolute="true" 
            ticks_per_revolution="42.0" 
            position_filter_size="1.0" 
            velocity_filter_size="1.0"
        />
        <encoder_a1 type="NONE" calibration_type="NONE"/>
        <encoder_a2 type="NONE" calibration_type="NONE"/>
        <encoder_b1 type="NONE" calibration_type="NONE"/>
        <encoder_b2 type="NONE" calibration_type="NONE"/>
    </encoders>

    <board 
        min_duty_cycle="0.05" 
        max_duty_cycle="0.95" 
        max_board_current="50.0" 
        switching_frequency_hz="97660.0" 
        current_sense_threshold_vds="880.0" 
        current_sense_threshold_winding="200.0" 
        current_sense_gain="40.0" 
        current_filter_size="10.0" 
        control_divider="8" 
        winding_order="CBA" 
        hall_order="ABC"
    />

    <board_calibration 
        offset_i_a="nan" 
        offset_i_b="nan" 
        offset_i_c="nan" 
        offset_i_bus="nan" 
        offset_v_a="0.0" 
        offset_v_b="0.0" 
        offset_v_c="0.0"
    />

    <!-- Gear Ratio is 156:1 and 60/50 belt reduction, so 156*60 / 50 = 9360 / 50 -->
    <!-- Efficiency is just a guess, and is used to convert measured winding current to an torque in Nm -->
    <gear_train 
        gear_ratio_numerator="9360" 
        gear_ratio_denominator="50"
        efficiency="0.75" 
        max_output_torque="0.0"
    />
</motor_driver>