From: Joseph Coffland Date: Wed, 3 May 2017 20:45:26 +0000 (-0700) Subject: docs and config changes X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=22b849b55dcca8f82520b65e72bbd3f592bae675;p=bbctrl-firmware docs and config changes --- diff --git a/avr/src/config.h b/avr/src/config.h index 0bde1f4..ac2df06 100644 --- a/avr/src/config.h +++ b/avr/src/config.h @@ -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 diff --git a/avr/src/plan/line.c b/avr/src/plan/line.c index 8cb4565..6f17bbd 100644 --- a/avr/src/plan/line.c +++ b/avr/src/plan/line.c @@ -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; diff --git a/avr/src/vars.c b/avr/src/vars.c index 93325ac..7f39c75 100644 --- a/avr/src/vars.c +++ b/avr/src/vars.c @@ -57,7 +57,7 @@ static const char indexed_code_fmt[] PROGMEM = "\"%c%s\":"; static const char bool_name [] PROGMEM = ""; #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