Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
MicroMega's uFPU
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Forum Index -> General
Author Message
GTBecker



Joined: 18 Jan 2006
Posts: 472
Location: Cape Coral

Posted: 16 January 2007, 22:59 PM    Post subject: Reply with quote

I've found more improvement in the FPU code. The 3x3 inversion on the FPU now takes 465µS; that's about the best I think I can do for now. I'm eager to receive a new FPU version that provides multi-register SPI moves, including byte-reversed transfers, soon.

The ZBasic code has simplified from a determinant improvement, too, so it currently requires 1798µS. You'll find the code up-thread.


Last edited by GTBecker on 17 January 2007, 17:50 PM; edited 2 times in total
Back to top
stevech



Joined: 23 Feb 2006
Posts: 688

Posted: 16 January 2007, 23:46 PM    Post subject: Reply with quote

interesting. Is the time you show for the math only - or does it include the fetch and store (in AVR memory space) of the operands?
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 472
Location: Cape Coral

Posted: 17 January 2007, 0:42 AM    Post subject: Reply with quote

Read up-thread and you'll see that this time does not include the SPI transfer time.
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 472
Location: Cape Coral

Posted: 19 February 2007, 21:17 PM    Post subject: Reply with quote

I'm finally getting around to apply the µM-FPU to a Kalman filter in an IMU with a beta of FPU microcode that provides several new instructions and expanded serial capability.

Raw NMEA data no longer needs to go through the processor. The FPU can directly buffer incoming NMEA and post status when a sentence is ready to be decoded, which is only one function call, making the GPS data available in a series of registers. At the moment, I convert 11 fields from three sentence types.

Any number of mixed-type registers can now be transferred in one call, in reverse byte order, directly into a series of mixed-type RAM vars in the processor; that takes about 1mS, essentially independent of the register count. So, just two FPU instructions will get you current GPS data, ready to calculate. Of course, the data can remain on the FPU for navigation math there.

My 3x3 matrix multiplicative inverse FPU code now runs in 1405µS, including an SPI transfer of nine floats.

FYI.
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 472
Location: Cape Coral

Posted: 24 March 2007, 20:45 PM    Post subject: Reply with quote

The 3x3 inversion now takes 248µS on the FPU. MicromegaCorp incorporated the 2x2 and 3x3 determinant and inverse functions into its v3.1.0 beta instruction set, and added several functions that make working on submatrices much easier.

I suppose a 4x4 should be next.
Back to top
victorf



Joined: 01 Jan 2006
Posts: 342
Location: Schenectady, New York

Posted: 01 June 2007, 19:34 PM    Post subject: Reply with quote

Tom,

I know you have done considerable development with the FPU. I see in the Yahoo forum that version 3 of both the FPU and the IDE have been released. When do you think the IDE will contain a code generator for either ZBasic or BasicX? Have you got any influence at MicroMega? Smile

Any enlightenment will be appreciated.

Vic
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 472
Location: Cape Coral

Posted: 01 June 2007, 20:28 PM    Post subject: Reply with quote

> ... Have you got any influence at MicroMega?

No more than any other user, I imagine.

No, neither ZBasic nor BasicX code is generated by the FPU IDE. I don't use the part that way, though, so I have not missed the feature. If it was available, it would offer drag-and-dropable processor source to call SPICmd with appropriate parameters to execute the function you need. It is intended to generate code that you would insert in your processor source, one FPU command at a time.

For processors like these that already have float functions onboard, calling a single external FPU function might make little sense unless it is not already available on the processor, like the matrix operations. Data needs to be moved to and from the FPU, too, per function, using that method. Still, for multiple float functions - a moderately complex algorithm, perhaps - transferring data and a series of instructions can be significantly faster than doing the same process onboard the processor, I've found.

Instead, I write FPU functions, a series of FPU commands that are stored on the part and executed via a single function call from the processor. When the function autonomously completes it interrupts the processor, which makes another function call. For this, the IDE generates FPU code that is stored in FPU flash via its own debug serial port. For me, that works fine.


Tom
Back to top
liam.zbasic



Joined: 25 Mar 2008
Posts: 163
Location: Southern California (Blue)

Posted: 27 April 2010, 8:05 AM    Post subject: Reply with quote

Are you still using external FPU devices for matrix inversions, or are you satisfied with the speed of the native chips? I'm preparing to implement a Kalman filter for my GBOT90 project to improve the IR sensor readings.

http://www.youtube.com/watch?v=bxx14Xe2iNg
Back to top
GTBecker



Joined: 18 Jan 2006
Posts: 472
Location: Cape Coral

Posted: 27 April 2010, 11:58 AM    Post subject: Reply with quote

Not at the moment, no.

I've shelved my IMU altogether in favor of optical feedback. Tracking a visible fixed object from the moving platform provides the attitude data for now.

On speed, I thoroughly enjoy native mode. I will also - always - thoroughly enjoy more speed.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> General Time synchro. with the server - Timezone/DST with your computer
Goto page Previous  1, 2, 3
Page 3 of 3

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group