// DRV8711 settings
-#define DRV8711_OFF 12
-#define DRV8711_BLANK 0x80
-#define DRV8711_DECAY (DRV8711_DECAY_DECMOD_AUTO_OPT | 6)
-#define DRV8711_STALL (DRV8711_STALL_SDCNT_2 | DRV8711_STALL_VDIV_8 | 200)
+#define DRV8711_OFF 24
+#define DRV8711_BLANK (0x32 | DRV8711_BLANK_ABT_bm)
+#define DRV8711_DECAY (DRV8711_DECAY_DECMOD_MIXED | 16)
+#define DRV8711_STALL (DRV8711_STALL_SDCNT_2 | DRV8711_STALL_VDIV_4 | 200)
#define DRV8711_DRIVE (DRV8711_DRIVE_IDRIVEP_50 | \
DRV8711_DRIVE_IDRIVEN_100 | DRV8711_DRIVE_TDRIVEP_500 | \
DRV8711_DRIVE_TDRIVEN_500 | DRV8711_DRIVE_OCPDEG_2 | \
DRV8711_DRIVE_OCPTH_500)
-#define DRV8711_TORQUE DRV8711_TORQUE_SMPLTH_50
-#define DRV8711_CTRL (DRV8711_CTRL_ISGAIN_10 | DRV8711_CTRL_DTIME_850)
+#define DRV8711_TORQUE DRV8711_TORQUE_SMPLTH_200
+#define DRV8711_CTRL (DRV8711_CTRL_ISGAIN_10 | DRV8711_CTRL_DTIME_450 | \
+ DRV8711_CTRL_EXSTALL_bm)
// Huanyang settings
* segment. Delta needs to be defined, so let's replace the term max_jerk (see
* note 1) with max junction deviation, or "delta". This indirectly sets the
* radius of the circle, and hence limits the velocity by the centripetal
- * acceleration. Think of the this as widening the race track. If a race car is
+ * acceleration. Think of this as widening the race track. If a race car is
* driving on a track only as wide as a car, it'll have to slow down a lot to
* turn corners. If we widen the track a bit, the car can start to use the
* track to go into the turn. The wider it is, the faster through the corner
if (!a_delta || !b_delta) return 0; // One or both unit vectors are null
float delta = (sqrt(a_delta) + sqrt(b_delta)) / 2;
- float sintheta_over2 = sqrt((1 - costheta) / 2);
- float radius = delta * sintheta_over2 / (1 - sintheta_over2);
+ float sin_half_theta = sqrt((1 - costheta) / 2);
+ float radius = delta * sin_half_theta / (1 - sin_half_theta);
float velocity = sqrt(radius * JUNCTION_ACCELERATION);
return velocity;
static const char bool_name [] PROGMEM = "<bool>";
#define TYPE_NAME(TYPE) static const char TYPE##_name [] PROGMEM = "<" #TYPE ">"
MAP(TYPE_NAME, SEMI, flags_t, string, pstring, float, uint8_t, uint16_t,
- int32_t, char);
+ int32_t);
// Eq functions