robot

Dependencies:   FastPWM3 mbed

Revision:
44:3fd6a43b91f0
Parent:
39:80b38a8e1787
Child:
52:fd3d8df99287
--- a/config_loop.h	Fri Jan 06 09:10:45 2017 +0000
+++ b/config_loop.h	Sun Jan 08 09:03:15 2017 +0000
@@ -6,8 +6,7 @@
 #define K_LOOP 1.0f
 #define KI_BASE 0.01f
 
-#define KP (K_LOOP / BUS_VOLTAGE * 5000.0f / F_SW)
-#define KI (KI_BASE * K_LOOP / BUS_VOLTAGE * 5000.0f / F_SW)
+#define F_SLOW_LOOP 100.0f
 
 #define INTEGRAL_MAX 1.0f
 
@@ -16,4 +15,9 @@
 #define W_FILTER_STRENGTH 0.99f
 #define DQ_FILTER_STRENGTH 0.0f
 
+/*internally computed*/
+#define KP (K_LOOP / BUS_VOLTAGE * 5000.0f / F_SW)
+#define KI (KI_BASE * K_LOOP / BUS_VOLTAGE * 5000.0f / F_SW)
+#define SLOW_LOOP_COUNTER ((int) (F_SW / F_SLOW_LOOP))
+
 #endif
\ No newline at end of file