quick ? about LOOKDOWN/UP comand...
RinksCustoms
Posts: 531
it's an easy enough comand to understand, the question is with how the tables are stored in memory. Is each element stored as a LONG, or can it be modified like a data structure with BYTE/WORD before the elements?
Specifically, I'm wondering if two tables with 225 elements each, and each element having a numeric value up to 45370 (a pseudo floating decimal) which would fit into a WORD value based table system.
As you can see, 450 LONGs would·just about tie up a cog by themselves, so the idea of modifying the elements with a WORD alignment would use memory most efficiently while cutting memory usage in half. This is the only approach I know to obtain data from a MAF sensor, (Mass Air Flow).
I have obtained 225 data points for this sensor as it's response is more of a log curve. I have the data in Exel format if any·mathematitians know of a way to convert the output frequency to a more useable grams/sec measurement in what is sure to be a complex formula. Obtaining this data alone took 2 months of scouring the internet. The data reads from 0.14 grams/sec @ 750Hz to 453.70 g/sec@ 12KHz and there are 225 data points in my information. I'm not going to post the data here due to the proprietory nature of it, but I can e-mail it to anyone willing to take a stab at the formula approach.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
Specifically, I'm wondering if two tables with 225 elements each, and each element having a numeric value up to 45370 (a pseudo floating decimal) which would fit into a WORD value based table system.
As you can see, 450 LONGs would·just about tie up a cog by themselves, so the idea of modifying the elements with a WORD alignment would use memory most efficiently while cutting memory usage in half. This is the only approach I know to obtain data from a MAF sensor, (Mass Air Flow).
I have obtained 225 data points for this sensor as it's response is more of a log curve. I have the data in Exel format if any·mathematitians know of a way to convert the output frequency to a more useable grams/sec measurement in what is sure to be a complex formula. Obtaining this data alone took 2 months of scouring the internet. The data reads from 0.14 grams/sec @ 750Hz to 453.70 g/sec@ 12KHz and there are 225 data points in my information. I'm not going to post the data here due to the proprietory nature of it, but I can e-mail it to anyone willing to take a stab at the formula approach.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
Comments
LOOKDOWN ("variable" word : word0, word1, word2, .. )
I'm looking to make one lookdown list having 225 entries, comparing an incoming frequency from a sensor to a frequency in the LOOKDOWN list, when/if that lookdown returns a value from the list, that value would then be passed to a LOOKUP list where the desired g/sec is returned to the program.
This is the best way I know how to deal with a logarithmic sensor with known data points across it's range of opperation. I probably have another misconception of how spin and these comands work.
Are the elements in a lookdown/up "list" in the form of LONGs, & if the default is a LONG for an element, does a modifier exist to change the alignment from a LONG to a WORD? - since my largest value will not exeed the maximum value that a WORD can store.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
Post Edited (RinksCustoms) : 3/27/2008 3:44:11 AM GMT
Don't forget that the propeller has a log table that you may be able to use if you have the equation for the sensor. This could give you a better resolution and may be faster or slower depending on the function. Did you get my PM?
That will work in Spin "as is", but you don't need the "word:" qualifier ...
It doesn't matter if word0, word1 etc are byte, word or long variables, the LookDown will deal with that automatically. If you want to alter what those values are at run-time you'll have to create your own lookup table as an array and then write code which will scan through it.
f you have a spare Cog that lookup table scanning can be done in PASM and should be very quick compared to the actual LookDown Spin command.
But if the lokdown/up does this automatically, then no worries, also i didn't know you could do this with variables/constants, cool.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
But it needs considerable and quite unpredictable time which is not so cool. Accessing an ordered constant list of any length to speak of (and this starts near 64) is generally done in a different way...
Post Edited (deSilva) : 3/29/2008 11:07:02 AM GMT