+ bd_set_current_thresholds(&mainboard.distance.bd, 500, 8000, 1000000, 20);
+
+#ifndef HOST_VERSION
+ /* ---- CS left_cobroller */
+ /* PID */
+ pid_init(&mainboard.left_cobroller.pid);
+ pid_set_gains(&mainboard.left_cobroller.pid, 80, 10, 10);
+ pid_set_maximums(&mainboard.left_cobroller.pid, 0, 30000, 4095);
+ pid_set_out_shift(&mainboard.left_cobroller.pid, 5);
+ pid_set_derivate_filter(&mainboard.left_cobroller.pid, 6);
+
+ /* CS */
+ cs_init(&mainboard.left_cobroller.cs);
+ cs_set_correct_filter(&mainboard.left_cobroller.cs, pid_do_filter, &mainboard.left_cobroller.pid);
+ cs_set_process_in(&mainboard.left_cobroller.cs, pwm_ng_set, LEFT_COBROLLER_PWM);
+ cs_set_process_out(&mainboard.left_cobroller.cs, encoders_left_cobroller_speed, LEFT_COBROLLER_ENCODER);
+ cs_set_consign(&mainboard.left_cobroller.cs, 0);
+
+ /* Blocking detection */
+ bd_init(&mainboard.left_cobroller.bd);
+ bd_set_speed_threshold(&mainboard.left_cobroller.bd, 60);
+ bd_set_current_thresholds(&mainboard.left_cobroller.bd, 500, 8000, 1000000, 50);
+
+ /* ---- CS right_cobroller */
+ /* PID */
+ pid_init(&mainboard.right_cobroller.pid);
+ pid_set_gains(&mainboard.right_cobroller.pid, 80, 10, 10);
+ pid_set_maximums(&mainboard.right_cobroller.pid, 0, 30000, 4095);
+ pid_set_out_shift(&mainboard.right_cobroller.pid, 5);
+ pid_set_derivate_filter(&mainboard.right_cobroller.pid, 6);
+
+ /* CS */
+ cs_init(&mainboard.right_cobroller.cs);
+ cs_set_correct_filter(&mainboard.right_cobroller.cs, pid_do_filter, &mainboard.right_cobroller.pid);
+ cs_set_process_in(&mainboard.right_cobroller.cs, pwm_ng_set, RIGHT_COBROLLER_PWM);
+ cs_set_process_out(&mainboard.right_cobroller.cs, encoders_right_cobroller_speed, RIGHT_COBROLLER_ENCODER);
+ cs_set_consign(&mainboard.right_cobroller.cs, 0);
+
+ /* Blocking detection */
+ bd_init(&mainboard.right_cobroller.bd);
+ bd_set_speed_threshold(&mainboard.right_cobroller.bd, 60);
+ bd_set_current_thresholds(&mainboard.right_cobroller.bd, 500, 8000, 1000000, 50);
+#endif /* !HOST_VERSION */