docs and config changes
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Wed, 3 May 2017 20:45:26 +0000 (13:45 -0700)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Wed, 3 May 2017 20:45:26 +0000 (13:45 -0700)
avr/src/config.h
avr/src/plan/line.c
avr/src/vars.c

index 0bde1f472e84764b971d6e91fa54c81571954f52..ac2df069f279398ff1535530948b0e9e8883ca57 100644 (file)
@@ -166,16 +166,17 @@ enum {
 
 
 // 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
index 8cb45655693a39841d7384d62fc63198c7dc19fa..6f17bbdf6f7dc92571f8eb78c4eda1e181964802 100644 (file)
@@ -53,7 +53,7 @@
  * 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
@@ -129,8 +129,8 @@ static float _get_junction_vmax(const float a_unit[], const float b_unit[]) {
   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;
index 93325ac9f1d2c069e6763f20b3e10f2090676f58..7f39c7522ce7a3fc73a9cfefcd4c5d8473607c6f 100644 (file)
@@ -57,7 +57,7 @@ static const char indexed_code_fmt[] PROGMEM = "\"%c%s\":";
 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