This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Sunday, July 22, 2007

[oopic] Re: Sin and Cos Functions

I understand some of the confusion. Your figure 4-4 explains what one
might expect from the ooPIC. I would expect otherwise... Is the
figure correct?

I'm sure there is some reason for the ooPIC producing the results you
depict, perhaps to reduce computational overhead within the ooPIC or
to allow for a smoother interface with the rest of the robotic
control functions...

I understand that the sin function does not use signed math so the
output has been scaled to fit integers 0 to 255, and a circle has
been divided into 256 units, not 360...

I would expect 0 input to give mid-scale output, which the ooPIC
does - 127.

I would expect math where 90 degrees, 64 input units, would give full-
scale result not bottom-scale, so full-scale would give 255 as a
result - the ooPIC gives 0.

I would expect values between 0 and 90 degrees, 0 to 64 units, to
give results between mid-scale and full-scale - the ooPIC gives
results between mid-scale and bottom-scale.

180 degrees would be midscale, the ooPIC gives 127 which is midscale
for 0 to 255, which would be correct.

I would expect 270 degrees to give bottom-scale - the ooPIC gives 255
which is full-scale...

It appears the ooPIC math is "upsidedown" from what I would expect...

--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
wrote:
>
> What part needs explanation? Remember that the outputs of these
> functions are in BRADs, or Binary RADians. A BRAD is the number
which
> over 255 is the fraction of the radian represented. This was a way
to
> represent the 2PI radians with a single byte instead of a whole
word
> which would be needed if 360 degrees were used. The resolution is
much
> lower than with 360 degrees (2PI radians), but more convenient to
use.
> Also, the n returns, which represents n/255 is used because the
ooPIC
> does not do non-integer math.
>
> DLC
>
> samitharansara wrote:
> > Are there any computational errors within the oopic, when
executing
> > these type of functions ? Can someone explain it please.
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
>
> --
> ------------------------------------------------------
> Dennis Clark ooPIC Tech Support
> www.oopic.com
> ------------------------------------------------------
>



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

No comments: