tag:blogger.com,1999:blog-21402852.post115118620820131940..comments2016-07-29T05:24:47.488+10:00Comments on The NXT STEP is EV3 - LEGO® MINDSTORMS® Blog: Thing's I'd like to see...James Floyd Kelly (Jim)http://www.blogger.com/profile/13876934942928389738noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-21402852.post-1151295485505445412006-06-26T14:18:00.000+10:002006-06-26T14:18:00.000+10:00I gave up the bezier approach to the cosine approx...I gave up the bezier approach to the cosine approx. problem, but I came up with something else:<BR/><BR/>y = 1 - ((x + 0.35) * x * 0.33)<BR/><BR/>It works fine between 0 and PI/2, but you must flip it every 90º in order to work until 360º as follows:<BR/><BR/>x1 = x<BR/>x2 = 3.14/2 - (x - (3.14/2))<BR/>x3 = x - 3.14<BR/>x4 = 3 * 3.14/2 - (x - (3.14/2))<BR/> <BR/>y1 = 1 - ((x1 + 0.35) * x1 * 0.33)<BR/>y2 = ((x2 + 0.35) * x2 * 0.33) - 1<BR/>y3 = ((x3 + 0.35) * x3 * 0.33) - 1<BR/>y4 = 1 - ((x4 + 0.35) * x4 * 0.33)<BR/><BR/>If I'm not mistaken, the error ranges from 0 to 2%.<BR/><BR/>What do you think?Mauricio Zuardihttp://www.blogger.com/profile/14452376266561742382noreply@blogger.comtag:blogger.com,1999:blog-21402852.post-1151287307713765832006-06-26T12:01:00.000+10:002006-06-26T12:01:00.000+10:00The US sensor "pings" roughly 10 times per second....The US sensor "pings" roughly 10 times per second. Yes, a "radar" graph is a good idea, and one I've thought about (even gotten the graphic drawn up). Yes, you can input positions to the Drawing block. The first use I put the trig MyBlocks to was actually an analog (looking) needle display... imagine turning your $250 NXT into a glorified multimeter :-). But it's fun to watch my voice move the "needle". This is complicated somewhat by the fact that the Draw block does not allow you to undraw anything.<BR/><BR/>-- <BR/>Brian DavisBrian Davishttp://www.blogger.com/profile/13348160352741782598noreply@blogger.comtag:blogger.com,1999:blog-21402852.post-1151266151119511432006-06-26T06:09:00.000+10:002006-06-26T06:09:00.000+10:00That's a very nice and usefull idea.How fast is th...That's a very nice and usefull idea.<BR/>How fast is the US sensor?Mauricio Zuardihttp://www.blogger.com/profile/14452376266561742382noreply@blogger.comtag:blogger.com,1999:blog-21402852.post-1151263027649776432006-06-26T05:17:00.000+10:002006-06-26T05:17:00.000+10:00Brian Davis suggested an alternative formula100,00...Brian Davis suggested an alternative formula<BR/><BR/>100,000 * cos() =<BR/>100,000 - 13 x^2 + x^4 / 12379<BR/><BR/>I updated my Excel spreadsheet to include the analysis of this formula. At first sight it appears that the two formulas are about equivalent, with Brian's providing better results for angles close to 90 degrees. The spreadsheet is available at<BR/><BR/>http://home.earthlink.net/~xaos69/<BR/>files/Trig_Approximation.xls<BR/><BR/>An interesting challange would be to mount a US sensor on motor and pan it back and forth like a radar antenna. The program should create a radar like display on the NXT LCD display. Since NXT-G has display draw blocks, this seems like a possibility - providing the blocks have inputs for variables.jeffnoreply@blogger.comtag:blogger.com,1999:blog-21402852.post-1151257841373768292006-06-26T03:50:00.000+10:002006-06-26T03:50:00.000+10:00Hi Mauricio,Yes I think it would be a good idea to...Hi Mauricio,<BR/><BR/>Yes I think it would be a good idea to search for better approximation formulas. Especially it would be good to search for formulas that are easy to implement in the limited numerical environment of 16 bit signed integers.<BR/><BR/>You can get the Excel spreadsheet I used at<BR/><BR/>http://home.earthlink.net/~xaos69/<BR/>files/Trig_Approximation.xls<BR/><BR/>The spreadsheet may help you get a head start on how to adapt a Bezier curve formula to the computational environment of signed integer arithmetic.jeffnoreply@blogger.comtag:blogger.com,1999:blog-21402852.post-1151249421497078692006-06-26T01:30:00.000+10:002006-06-26T01:30:00.000+10:00This comment has been removed by a blog administrator.Mauricio Zuardihttp://www.blogger.com/profile/14452376266561742382noreply@blogger.comtag:blogger.com,1999:blog-21402852.post-1151249343285463572006-06-26T01:29:00.000+10:002006-06-26T01:29:00.000+10:00Hi Jeff,I got really interested in your cosine fun...Hi Jeff,<BR/><BR/>I got really interested in your cosine function and started to think about how improve the precision near 90 degrees and I think I came up with something:<BR/><BR/>What if we use a bezier curve formula to calculate it?<BR/>I found a very nice article about it at http://www.cubic.org/docs/bezier.htm<BR/><BR/>What do you think?<BR/><BR/>(please forgive me if I said something stupid - I'm only a curious brasilian graphic designer that is dying to grab my own NXT kit)Mauricio Zuardihttp://www.blogger.com/profile/14452376266561742382noreply@blogger.comtag:blogger.com,1999:blog-21402852.post-1151208697821509382006-06-25T14:11:00.000+10:002006-06-25T14:11:00.000+10:00As a motivation for trig functions, I added an add...As a motivation for trig functions, I added an addition page outlining how trig functions can be used to create an "internal" map of objects picked up by sensors. Such an internal map would be useful for team play where several robots might all have to keep track of the locations of other robots and fixed objects on the playing field.<BR/><BR/>The page on triangulation is at<BR/><BR/>http://home.earthlink.net/~xaos69/triangulation.htmljeffhttp://home.earthlink.net/~xaos69/triangulation.htmlnoreply@blogger.comtag:blogger.com,1999:blog-21402852.post-1151201234660079562006-06-25T12:07:00.000+10:002006-06-25T12:07:00.000+10:00Nice analysis! I made a few comments under the 19 ...Nice analysis! I made a few comments under the 19 Jun topic as well.<BR/><BR/>-- <BR/>Brian DavisBrian Davishttp://www.blogger.com/profile/13348160352741782598noreply@blogger.comtag:blogger.com,1999:blog-21402852.post-1151193608620295942006-06-25T10:00:00.000+10:002006-06-25T10:00:00.000+10:00I added some more content under the June 19 topic ...I added some more content under the June 19 topic "Thoughts on Complex Programs..."<BR/><BR/>Some of ideas I'd like to see further developed are up on a web page I posted at<BR/><BR/>http://home.earthlink.net/~xaos69/<BR/>cosine_approximation.htmlJeffhttp://home.earthlink.net/~xaos69/cosine_approximation.htmlnoreply@blogger.com