dt_ctrl_az_sim.ctrl 3.99 KB
Newer Older
Jeroen Vreeken's avatar
Jeroen Vreeken committed
1
blocks ($(frequency), $(delay)) {
Jeroen Vreeken's avatar
Jeroen Vreeken committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
	{ "limit",	"dt_az_speed_limit"	}
	{ "quantize",	"dt_az_speed_quantize"	}
	{ "subtract",	"dt_az_speed_fb"	}
	{ "pid",	"dt_az_driver"	}
	{ "limit_dyn",	"dt_az_torque_limit"	}
	{ "friction",	"dt_az_friction"	}
	{ "pid",	"dt_az_accelerate"	}
	{ "pid",	"dt_az_speed2pos"	}
	{ "value",	"dt_az_offset"	}
	{ "add",	"dt_az_offset_add"	}
	{ "quantize",  	"dt_az_pos_quantize"	}
	{ "register",	"dt_az_enabled"	}
	{ "value_bool",	"dt_az_safety_n"	}
	{ "not",	"dt_az_safety_n_not"	}
	{ "value_bool",	"dt_az_safety_p"	}
	{ "not",	"dt_az_safety_p_not"	}
18
	{ "value_bool",	"dt_az_bex" 		}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
19
	{ "value",	"dt_az_focusbox"	}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
20
21
	{ "not",        "dt_az_ba1"             }
	{ "not",        "dt_az_ba2"             }
Jeroen Vreeken's avatar
Jeroen Vreeken committed
22

Jeroen Vreeken's avatar
Jeroen Vreeken committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	module ("dt_az") {
		{
			{ "speed",  "dt_az_speed_limit", "in"     }
			{ "torque", "dt_az_torque_limit", "limit" }
			{ "enable", "dt_az_enabled", "input"      }
			{ "ba1",    "dt_az_ba1", "input"          }
			{ "ba2",    "dt_az_ba2", "input"          }
		}
		{
			{ "position",        "dt_az_pos_quantize", "out"    }
			{ "speed",           "dt_az_accelerate", "out"    }
			{ "torque",          "dt_az_torque_limit", "out"    }
			{ "enabled",         "dt_az_enabled", "output" }
			{ "be1",             "dt_az_safety_n_not", "output" }
			{ "be2",             "dt_az_safety_n", "value"  }
			{ "be3",             "dt_az_safety_p_not", "output" }
			{ "be4",             "dt_az_safety_p", "value"  }
			{ "be5",             "dt_az_bex", "value"  }
			{ "ae1",             "dt_az_focusbox", "value"  }
			{ "external_enable", "dt_az_bex", "value"  }
		}
	}
Jeroen Vreeken's avatar
Jeroen Vreeken committed
45
46
47
48
49
50
51
}

links {
        { "dt_az_speed_limit",		"out",		"dt_az_speed_quantize",		"in",		true }
	{ "dt_az_speed_quantize",	"out",		"dt_az_speed_fb", 		"positive",	true }
	{ "dt_az_speed_fb",		"difference",	"dt_az_driver", 		"in",       	true }
	{ "dt_az_driver",		"out",		"dt_az_torque_limit",		"in",       	true }
52
	{ "dt_az_torque_limit",		"out",		"dt_az_friction",		"in",       	true }
Jeroen Vreeken's avatar
Jeroen Vreeken committed
53
54
55
56
57
	{ "dt_az_friction",		"out",		"dt_az_accelerate",        	"in",       	true }
	{ "dt_az_accelerate",		"out",		"dt_az_speed2pos",         	"in",       	true }
	{ "dt_az_accelerate",		"out",		"dt_az_speed_fb",          	"negative", 	false }
	{ "dt_az_accelerate",		"out",		"dt_az_friction",          	"speed",    	false }

Jeroen Vreeken's avatar
Jeroen Vreeken committed
58
59
	{ "dt_az_speed2pos",		"out",		"dt_az_offset_add",        	"in0",      	true }
	{ "dt_az_offset",		"value",	"dt_az_offset_add",        	"in1",		true }
Jeroen Vreeken's avatar
Jeroen Vreeken committed
60
61
62
63
64
65
66
67

	{ "dt_az_offset_add",		"out",		"dt_az_pos_quantize",      	"in", 		false }

	{ "dt_az_safety_n", 		"value",	"dt_az_safety_n_not",		"input",	true }
	{ "dt_az_safety_p", 		"value",	"dt_az_safety_p_not",		"input",	true }
}

params {
68
69
70
	{ "dt_az_speed_limit",       "max",		(float) rpm2rads(3000.0) }
	{ "dt_az_speed_limit",       "min",             (float)-rpm2rads(3000.0) }
	{ "dt_az_speed_quantize",    "quantum",         (float) rpm2rads(3000.0)/16384.0 }
Jeroen Vreeken's avatar
Jeroen Vreeken committed
71
72
73
74
75
76
77
78
79
80
81
82
83
	{ "dt_az_driver",            "kp",             	(float)1.0 }
	{ "dt_az_driver",            "ki",              (float)100.0 }
	{ "dt_az_driver",            "kd",              (float)0.01 }
	{ "dt_az_friction",          "friction_static",	(float)6.0 }
	{ "dt_az_friction",          "friction_dynamic",(float)5.8 }
	{ "dt_az_friction",          "deadzone_max",    (float)0.1 }
	{ "dt_az_friction",          "deadzone_min", 	(float)-0.1 }
	{ "dt_az_accelerate",        "kp",              (float)0.0  }
	{ "dt_az_accelerate",        "ki",             	(float)25.0 }
	{ "dt_az_accelerate",        "kd",              (float)0.0 }
	{ "dt_az_speed2pos",         "kp",              (float)0.0 }
	{ "dt_az_speed2pos",         "ki",              (float)1.0 }
	{ "dt_az_speed2pos",         "kd",              (float)0.0 }
84
	{ "dt_az_pos_quantize",      "quantum",         (float)2.0 * pi / 16384.0 }
Jeroen Vreeken's avatar
Jeroen Vreeken committed
85
86
	{ "dt_az_focusbox",          "value",           (float)5.0 }
	{ "dt_az_offset",            "value",      	(float)-21730.3997815 }
87
	{ "dt_az_bex",               "value",      	(int)0 }
Jeroen Vreeken's avatar
Jeroen Vreeken committed
88
89
	{ "dt_az_safety_p",          "value",      	(int)1 }
	{ "dt_az_safety_n",          "value",      	(int)1 }
Jeroen Vreeken's avatar
Jeroen Vreeken committed
90
}