Shop OBEX P1 Docs P2 Docs Learn Events
Fround error — Parallax Forums

Fround error

scottascotta Posts: 168
edited 2007-03-24 22:37 in Propeller 1
Can someone confirm this:

Fround(-22.8) = 21
Fround( 22.8) = 23

It should be :

Fround(-22.8) = -23
Fround( 22.8) = 23

Scott

Comments

  • cgraceycgracey Posts: 14,133
    edited 2007-03-24 18:17
    Scott,

    Was this in the FloatMath.spin object, or some other?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • scottascotta Posts: 168
    edited 2007-03-24 18:22
    It is in "FloatMath.spin", and I don't think I've fiddled with it.

    Have not checked the "Float32FullDynamic" routines, but I have
    a 600 watt motor going 80 inches a second with these routines. They
    are good.


    Scott
  • cgraceycgracey Posts: 14,133
    edited 2007-03-24 18:37
    Okay, I tested this out and it seems to work fine. Either your FloatMath.spin has been modified or something's going on elsewhere that is not apparent yet. Attached is·an archive of a demo which contains the real FloatMath.spin. The demo runs on the Propeller board and outputs your numbers in both float and round form to·a TV. It produces -23 and 23, as expected.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • scottascotta Posts: 168
    edited 2007-03-24 19:01
    Chip,

    I just wasted some of your time..... It was another function I have
    layered in.

    Scott
  • cgraceycgracey Posts: 14,133
    edited 2007-03-24 19:05
    No problem, Scott. I just wish I had a simple answer for your other posted question.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • scottascotta Posts: 168
    edited 2007-03-24 19:40
    There are half a dozen people on the list that can do this
    in 5 minutes, it will probably take me another few days
    to come up with a workable solution. But there is a good
    market for embedded controllers in my area of the country.

    Thanks again !

    Hows your new chip going ?
    Would 12 bit addressing be too much to ask ?

    Scott
  • cgraceycgracey Posts: 14,133
    edited 2007-03-24 20:19
    scotta said...
    There are half a dozen people on the list that can do this
    in 5 minutes, it will probably take me another few days
    to come up with a workable solution. But there is a good
    market for embedded controllers in my area of the country.

    Thanks again !

    Hows your new chip going ?
    Would 12 bit addressing be too much to ask ?

    Scott
    You will benefit immensely from getting this figured out. There's no substitute for really understanding something. It will make your product much better.
    The new chip is coming along great. Just working on the analog/digital I/O pads now.
    Yes, 12 bits is not going to happen. Something better is in the works, though: eight-long transfers per hub access, enabling large-model code to run at half the clock speed with a full 16 cogs. Bill Henning, are you out there? This blows·out the video bottleneck, too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2007-03-24 20:43
    Thank you Scotta for asking, and to Chip for his replies.

    There probably are many of us wondering about what Prop gen#2 will provide.
    Sounds like very good news is in store for us. yeah.gif Keep the hints 'acoming.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • scottascotta Posts: 168
    edited 2007-03-24 20:44
    So true.

    I'll send you a video of your chip cutting glass soon. The assembler
    PID loop is fantastic (140 us for PID position loop, 90us for PI in the
    velocity loop).

    Analog/Digital pads ?

    We could use my C# objects to replace quite a few NI projects.

    AnalogIO myanalog = propeller.NewAnalog();
    AnalogInput myinput = myanalog.NewChannel(ANALOG.IN,3);

    double temp=myinput.Read();
    double avg=myinput.Average(100);

    Scott
  • scottascotta Posts: 168
    edited 2007-03-24 20:44
    Harley,

    I was born to bother people, ask my girl.
  • LitefireLitefire Posts: 108
    edited 2007-03-24 22:37
    hey scott, where'd you get the PID code? i'd LOVE to have a look at it if you don't mind...

    ~~Brian
Sign In or Register to comment.