On Fri, Jun 11, 2010 at 12:19:27AM +0100, Andy Pugh wrote:
> +The complementary \\FBinit-done\\FP pin can be used to handle the required 
> sequencing.
You still have the wrong markup for fonts.  Should be \\fB etc, not
\\FB.  I'd prefer that these text blocks wrap at under 80 characters
(ideally around 72 characters)..

> +             V = value;
> +             theta = (pi2 / scale) * ((rawcounts - scale * floor(rawcounts / 
> scale)) - offset);
> +             
> +             if (dir) {
> +                     theta = theta - angle * deg2rad;
> +             }
> +             else {
> +                     theta = theta + angle * deg2rad;
> +             }
> +     }
> +             
> +    A_value = V * cos(theta);
> +    B_value = V * cos(theta + pi23);
> +    C_value = V * cos(theta - pi23);

I am still concerned about 'dir'.  I see that if angle is 90 that
negating value or inverting dir do the same thing, but for other values
of angle this isn't true.  For instance, if 'angle' is 60 and you try to
invert the rotational direction by having a negative 'value' and not
changing 'dir' then you'll get an effective theta of -120 when the
desired is -60.

consider something like:
    V = fabs(value);
    D = dir;
    if(value < 0) D = !d;
so that both the sign of 'value' and the 'dir' bit can cantribute to
deciding whether to lead/lag the current motor angle.

Or instead of 'dir' have 'scale' like pwmgen has:
    V = value * scale;
    D = (V > 0);
    V = fabs(V);
to make a positive command turn the other direction, negate scale (just
like on pwmgen).

Jeff

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to