Re: [neonixie-l] Math wizzards....
On Saturday, February 22, 2014 12:06:59 PM UTC-7, Bill v wrote: Most of us still use tube > equipped appliances. I do not yet see a practical semiconductor > replacement > for the magnetron in our microwave ovens! > Or guitar amplifiers! :-) Joe, N6DGY -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/81fb3934-ec5b-4288-8816-8ab99d586128%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [neonixie-l] Math wizzards....
Hi Bill, I agree with David on this that it is a bit of a strange approach to realize your pendulum routine. The velocity on the outer left and right hand side is 0 so that would result in a very large timer value. However, if you say your numbers based on adding something * 50 gives you a reasonable result, you can use the "int" numbers from the table as attached. I based on on 100 rather than 50, in theory it should be 107 I reckon, but I thought that might cause problems with the rest of your interrupt routines, so 100 should be alright I think. Michel on Feb 23, 2014, Bill van Dijk wrote: The PIC actually has a really cool feature I am using for the LED patterns.First of all, everything is timed through interrupts, every time a timer 2interrupt occurs, LEDs need to be moved. Depending on the active pattern, ituses a number of lookup tables, some for the position, another for thetiming of the next move.Timer 2 overflows once it content matches a particular readable and writablevariable (same function used in its PWM). This is the value I am trying tofind. One swing of the pendulum (let's say left to right) takes 3852interrupts. In this time it completes 36 steps of 107 interrupts, which alsohappens to be 1 second real time. The trick is now to adjust the steps from36 107 interrupts to 36 steps of varying values that still add up to therequired 3852 interrupts, but in steps that approximate the true pendulumdynamic.I have now made a table that goes something like this (off-sets from thebasic 107):..-50 -40 -30 -20 -10 0 +10 +20 +30 +40 +50 | ..-50 -40 -30-20 -10 0 +10 +20 +30 +40 +50It actually looks not bad.Bill-Original Message-From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] OnBehalf Of David ForbesSent: Saturday, February 22, 2014 2:02 PMTo: neonixie-l@googlegroups.comSubject: Re: [neonixie-l] Math wizzardsBill,This problem is not hard to solve when writing new code for a clock, but theconstraint you have offered makes it hard to solve.A faster loop would make it easy.If it were my design, I would make the clock software use a main loop of afew milliseconds (for example 200 loops per second), triggered by a softwaretimer based on the CPU clock crystal. Each cycle through the loop would doany necessary timekeeping tasks, time-setting button reading, etc. Therewould be only one constraint on that code's timing, that it complete beforethe next timer trigger event.Then I would add a short routine to look up which LED to light with a lookuptable based on a cosine wave, calculated in Excel as integers, as wassuggested earlier. The input to the lookup table would be a counter thatincrements once per timing loop and is reset once per pendulum cycle, whenit reaches 200.However, since your code is not structured in this general-purpose manner,you will need to build the cosine into your timing code. A spreadsheet willhelp to calculate the position of each LED based on the cosine of the timeslice.On 2/22/14 8:31 AM, Bill van Dijk wrote:> Hello,>>>> I have built a clock controlled by a PIC with 6 numitrons in the centre.> Around them is a circle of 60LEDs which are programmed to display a > number of different patterns. I am currently working on a pendulum > pattern which uses the lower 30 LEDs. I have the software done, thechallenge is this:>>>> A pendulum has a period and an angular velocity that changes from 0 at > the ends, and maximum in the center, following an equation. In the > software I currently have 36 time slices (program steps, 0 to 35) in a > half period of> 107 clock cycles, for a total of 3852 cycles for one swing (left orright).>>>> Looking at one swing, my challenge now is to divide the 36 program > steps of> 107 clock cycles such that the total number of clock cycles remains > 3852, but the actual number of clock cycles per step are divided such > as to approximate the equation of one pendulum swing (left or right).>>>> Anyone willing to take a stab at this?>>>> Bill van Dijk>--David Forbes, Tucson AZ--You received this message because you are subscribed to the Google Groups"neonixie-l" group.To unsubscribe from this group and stop receiving emails from it, send anemail to neonixie-l+unsubscr...@googlegroups.com.To post to this group, send an email to neonixie-l@googlegroups.com.To view this discussion on the web, visithttps://groups.google.com/d/msgid/neonixie-l/5308F429.9050302%40dakotacom.net.For more options, visit https://groups.google.com/groups/opt_out.-- You received this message because you are subscribed to the Google Groups "neonixie-l" group.To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com.To post to this group, send an email to neonixie-l@googlegroups.com.To view this discussion on the web, visit
Re: [neonixie-l] Math wizzards....
Regarding my previous mention of the LM3914, I was incorrect in stating that you can only have a growing/shrinking stack of LEDs - there is a Dot Mode that would provide the motion of a pendulum bob quite nicely, I think. -- Matthew Smith Business: http://www.smiffytech.com Blog: http://www.smiffysplace.com Linkedin: http://www.linkedin.com/in/smiffy Flickr: http://www.flickr.com/photos/msmiffy Twitter: http://twitter.com/smiffy ABN 16 391 203 815 -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/530922F4.2030500%40smiffytech.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [neonixie-l] Math wizzards....
More thinking aloud, than a practical solution: One of the reasons that I'm in the throes of building an analogue computer is that, in the analogue domain, maths can be done very simply, in hardware. What if you were to get your cosine function as a voltage? Then take said voltage and feed it into a bargraph driver (LM3914 is basically a set of comparators.) OK, that doesn't give you a sequence of one LED illuminating after another, but the growing stack of LEDs would still have the same effective motion - no calculations involved. This is all assuming that there's some way of persuading op amps to get a cosine function out of a square wave - which could be provided by the microcontroller. Not yet well-enough versed with op amp circuits, but sure it must be possible - would start out with an integrator? M -- Matthew Smith Business: http://www.smiffytech.com Blog: http://www.smiffysplace.com Linkedin: http://www.linkedin.com/in/smiffy Flickr: http://www.flickr.com/photos/msmiffy Twitter: http://twitter.com/smiffy ABN 16 391 203 815 -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/5309217E.70801%40smiffytech.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [neonixie-l] Math wizzards....
Bill, Thanks for providing a description of the software architecture. Since you're already using timers, it should be easy to set one up for a periodic interrupt, and have that interrupt turn off the LED that's on and turn on the next LED in the lookup table. Often, the LED that it turns on is the same one that it just turned off, so the pendulum doesn't move during that interval. That's OK. The point is that if the timer interrupt occurs at the same interval every time, the code is a lot easier to write. You don't have to keep changing the interval every time, and no fancy math is required, just a cosine lookup table that maps the fractional pendulum time into the LED position.. On 2/22/14 12:54 PM, Bill van Dijk wrote: The PIC actually has a really cool feature I am using for the LED patterns. First of all, everything is timed through interrupts, every time a timer 2 interrupt occurs, LEDs need to be moved. Depending on the active pattern, it uses a number of lookup tables, some for the position, another for the timing of the next move. Timer 2 overflows once it content matches a particular readable and writable variable (same function used in its PWM). This is the value I am trying to find. One swing of the pendulum (let's say left to right) takes 3852 interrupts. In this time it completes 36 steps of 107 interrupts, which also happens to be 1 second real time. The trick is now to adjust the steps from 36 107 interrupts to 36 steps of varying values that still add up to the required 3852 interrupts, but in steps that approximate the true pendulum dynamic. I have now made a table that goes something like this (off-sets from the basic 107): ..-50 -40 -30 -20 -10 0 +10 +20 +30 +40 +50 | ..-50 -40 -30 -20 -10 0 +10 +20 +30 +40 +50 It actually looks not bad. Bill -- David Forbes, Tucson AZ -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/53090615.4070709%40dakotacom.net. For more options, visit https://groups.google.com/groups/opt_out.
RE: [neonixie-l] Math wizzards....
The PIC actually has a really cool feature I am using for the LED patterns. First of all, everything is timed through interrupts, every time a timer 2 interrupt occurs, LEDs need to be moved. Depending on the active pattern, it uses a number of lookup tables, some for the position, another for the timing of the next move. Timer 2 overflows once it content matches a particular readable and writable variable (same function used in its PWM). This is the value I am trying to find. One swing of the pendulum (let's say left to right) takes 3852 interrupts. In this time it completes 36 steps of 107 interrupts, which also happens to be 1 second real time. The trick is now to adjust the steps from 36 107 interrupts to 36 steps of varying values that still add up to the required 3852 interrupts, but in steps that approximate the true pendulum dynamic. I have now made a table that goes something like this (off-sets from the basic 107): ..-50 -40 -30 -20 -10 0 +10 +20 +30 +40 +50 | ..-50 -40 -30 -20 -10 0 +10 +20 +30 +40 +50 It actually looks not bad. Bill -Original Message- From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of David Forbes Sent: Saturday, February 22, 2014 2:02 PM To: neonixie-l@googlegroups.com Subject: Re: [neonixie-l] Math wizzards Bill, This problem is not hard to solve when writing new code for a clock, but the constraint you have offered makes it hard to solve. A faster loop would make it easy. If it were my design, I would make the clock software use a main loop of a few milliseconds (for example 200 loops per second), triggered by a software timer based on the CPU clock crystal. Each cycle through the loop would do any necessary timekeeping tasks, time-setting button reading, etc. There would be only one constraint on that code's timing, that it complete before the next timer trigger event. Then I would add a short routine to look up which LED to light with a lookup table based on a cosine wave, calculated in Excel as integers, as was suggested earlier. The input to the lookup table would be a counter that increments once per timing loop and is reset once per pendulum cycle, when it reaches 200. However, since your code is not structured in this general-purpose manner, you will need to build the cosine into your timing code. A spreadsheet will help to calculate the position of each LED based on the cosine of the time slice. On 2/22/14 8:31 AM, Bill van Dijk wrote: > Hello, > > > > I have built a clock controlled by a PIC with 6 numitrons in the centre. > Around them is a circle of 60LEDs which are programmed to display a > number of different patterns. I am currently working on a pendulum > pattern which uses the lower 30 LEDs. I have the software done, the challenge is this: > > > > A pendulum has a period and an angular velocity that changes from 0 at > the ends, and maximum in the center, following an equation. In the > software I currently have 36 time slices (program steps, 0 to 35) in a > half period of > 107 clock cycles, for a total of 3852 cycles for one swing (left or right). > > > > Looking at one swing, my challenge now is to divide the 36 program > steps of > 107 clock cycles such that the total number of clock cycles remains > 3852, but the actual number of clock cycles per step are divided such > as to approximate the equation of one pendulum swing (left or right). > > > > Anyone willing to take a stab at this? > > > > Bill van Dijk > -- David Forbes, Tucson AZ -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/5308F429.9050302%40dakotacom.ne t. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/004101cf3008%2404b92d70%240e2b8850%24%40com. For more options, visit https://groups.google.com/groups/opt_out.
RE: [neonixie-l] Math wizzards....
It's the instantaneous velocity at your points that you're after. That's the first derivative as I recall. Once you know these instantaneous velocities, then the problem becomes arriving at the timing between shutting one LED off, and turning the next one on. In this way, the LEDS will fool the eye into "seeing" the prescribed instantaneous velocity during each interval. To show yourself how this works, you could simply start out with an intuitive guess at some values, plug them in, and watch it go for a while. At first it may not look much like a real pendulum if the numbers are way off. But then you can make another iteration and try it again, speeding things up some here, maybe slowing it down a little there, etc. After a while, you should be able to get your values pretty much lined up with the real math, but you really don't need to sweat that much at first just to get something going to see it and to try it. Usually, these sorts of things will help you along if you give them a chance, simply by rigging up a crude first approximation enough to watch it work. Then, later on, make it agree with the math. Chuck Original Message From: bvd...@xplornet.com To: neonixie-l@googlegroups.com Subject: RE: [neonixie-l] Math wizzards Date: Sat, 22 Feb 2014 14:06:59 -0500 >Hi Chuck, > >It appears you and I have different definitions of fun! :-) > >I do still have the books btw, and I did look it up, found the >formulas, and >realized I don't know what to do with them anymore (It is a function >of age >I suppose; according to the sidebar notes I did know 40+ years ago. >Who'da >thunk). It would be something like giving me a sonic screwdriver; >I'd >have no idea what to do with that either! > >At the risk of fully exposing myself, I distinctly remember a >university >professor announcing that they recently invented something they >called a >transistor. He warned us not to be distracted by these things, >nothing could >ever be invented that would replace the thermionic valve! As funny as >that >is today, he was not as far off as some may think. Most of us still >use tube >equipped appliances. I do not yet see a practical semiconductor >replacement >for the magnetron in our microwave ovens! > >Bill > > >-Original Message- >From: neonixie-l@googlegroups.com >[mailto:neonixie-l@googlegroups.com] On >Behalf Of chuck richards >Sent: Saturday, February 22, 2014 1:50 PM >To: bvd...@xplornet.com; neonixie-l@googlegroups.com >Subject: RE: [neonixie-l] Math wizzards > >That should be easy enough to do. I don't have the equations >memorized for >this. If it was me attempting to do it, I'd start by grabbing any >and all >math and physics books, and looking up pendulums and periods and >stuff like >that. Sooner or later if you do that, you'll find the equation which >describes the velocity at any given point in the swing. > >Once you know that, then you can go back to your time slices and your >bits, >and then assign them so that they come the closest possible at each >point >that you have defined. > >Grab all the books, blow the dust off, and have fun!! >This is a good one, and congratulations for doing it! >Let us know how it turns out. > >Chuck > >> >> >> Original Message >>From: bvd...@xplornet.com >>To: neonixie-l@googlegroups.com >>Subject: RE: [neonixie-l] Math wizzards >>Date: Sat, 22 Feb 2014 11:43:44 -0500 >> >>>Yes, I am with you so far. My challenge is to actually put that >>knowledge to >>>work, and find the correct numbers. >>> >>> >>> >>>Cheers, Bill >>> >>> >>> >>>From: neonixie-l@googlegroups.com >>[mailto:neonixie-l@googlegroups.com] On >>>Behalf Of Tidak Ada >>>Sent: Saturday, February 22, 2014 11:03 AM >>>To: neonixie-l@googlegroups.com >>>Subject: RE: [neonixie-l] Math wizzards >>> >>> >>> >>>Remember the swing velocity is a (co)sine function. The highest >>speed is in >>>the zero crossing the tops are the left and right ends of the swing >>with a >>>speed zero. >>> >>> >>> >>>eric >>> >>> >>> >>> _ >>> >>>From: neonixie-l@googlegroups.com >>[mailto:neonixie-l@googlegroups.com] On >>>Behalf Of Bill van Dijk >>>Sent: zaterdag 22 februari 2014 16:31 >>>To: neonixie-l@googlegroups.com >>>Subject: [neonixie-l] Math wizzards >>> >>>Hello, >>> >>> >>> >>>I have built a clo
RE: [neonixie-l] Math wizzards....
Hi Chuck, It appears you and I have different definitions of fun! :-) I do still have the books btw, and I did look it up, found the formulas, and realized I don't know what to do with them anymore (It is a function of age I suppose; according to the sidebar notes I did know 40+ years ago. Who'da thunk). It would be something like giving me a sonic screwdriver; I'd have no idea what to do with that either! At the risk of fully exposing myself, I distinctly remember a university professor announcing that they recently invented something they called a transistor. He warned us not to be distracted by these things, nothing could ever be invented that would replace the thermionic valve! As funny as that is today, he was not as far off as some may think. Most of us still use tube equipped appliances. I do not yet see a practical semiconductor replacement for the magnetron in our microwave ovens! Bill -Original Message- From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of chuck richards Sent: Saturday, February 22, 2014 1:50 PM To: bvd...@xplornet.com; neonixie-l@googlegroups.com Subject: RE: [neonixie-l] Math wizzards That should be easy enough to do. I don't have the equations memorized for this. If it was me attempting to do it, I'd start by grabbing any and all math and physics books, and looking up pendulums and periods and stuff like that. Sooner or later if you do that, you'll find the equation which describes the velocity at any given point in the swing. Once you know that, then you can go back to your time slices and your bits, and then assign them so that they come the closest possible at each point that you have defined. Grab all the books, blow the dust off, and have fun!! This is a good one, and congratulations for doing it! Let us know how it turns out. Chuck > > > Original Message >From: bvd...@xplornet.com >To: neonixie-l@googlegroups.com >Subject: RE: [neonixie-l] Math wizzards >Date: Sat, 22 Feb 2014 11:43:44 -0500 > >>Yes, I am with you so far. My challenge is to actually put that >knowledge to >>work, and find the correct numbers. >> >> >> >>Cheers, Bill >> >> >> >>From: neonixie-l@googlegroups.com >[mailto:neonixie-l@googlegroups.com] On >>Behalf Of Tidak Ada >>Sent: Saturday, February 22, 2014 11:03 AM >>To: neonixie-l@googlegroups.com >>Subject: RE: [neonixie-l] Math wizzards >> >> >> >>Remember the swing velocity is a (co)sine function. The highest >speed is in >>the zero crossing the tops are the left and right ends of the swing >with a >>speed zero. >> >> >> >>eric >> >> >> >> _ >> >>From: neonixie-l@googlegroups.com >[mailto:neonixie-l@googlegroups.com] On >>Behalf Of Bill van Dijk >>Sent: zaterdag 22 februari 2014 16:31 >>To: neonixie-l@googlegroups.com >>Subject: [neonixie-l] Math wizzards >> >>Hello, >> >> >> >>I have built a clock controlled by a PIC with 6 numitrons in the >centre. >>Around them is a circle of 60LEDs which are programmed to display a >number >>of different patterns. I am currently working on a pendulum pattern >which >>uses the lower 30 LEDs. I have the software done, the challenge is >this: >> >> >> >>A pendulum has a period and an angular velocity that changes from 0 >at the >>ends, and maximum in the center, following an equation. In the >software I >>currently have 36 time slices (program steps, 0 to 35) in a half >period of >>107 clock cycles, for a total of 3852 cycles for one swing (left or >right). >> >> >> >>Looking at one swing, my challenge now is to divide the 36 program >steps of >>107 clock cycles such that the total number of clock cycles remains >3852, >>but the actual number of clock cycles per step are divided such as >to >>approximate the equation of one pendulum swing (left or right). >> >> >> >>Anyone willing to take a stab at this? >> >> >> >>Bill van Dijk >> >>-- >>You received this message because you are subscribed to the Google >Groups >>"neonixie-l" group. >>To unsubscribe from this group and stop receiving emails from it, >send an >>email to neonixie-l+unsubscr...@googlegroups.com. >>To post to this group, send an email to neonixie-l@googlegroups.com. >>To view this discussion on the web, visit >>https://groups.google.com/d/msgid/neonixie-l/002101cf2fe3%242ae9c9c0 >%2480bd5 >>d40%24%40com. >>For more options, visit https://groups.google.com/groups/opt_out. >> &g
Re: [neonixie-l] Math wizzards....
Bill, This problem is not hard to solve when writing new code for a clock, but the constraint you have offered makes it hard to solve. A faster loop would make it easy. If it were my design, I would make the clock software use a main loop of a few milliseconds (for example 200 loops per second), triggered by a software timer based on the CPU clock crystal. Each cycle through the loop would do any necessary timekeeping tasks, time-setting button reading, etc. There would be only one constraint on that code's timing, that it complete before the next timer trigger event. Then I would add a short routine to look up which LED to light with a lookup table based on a cosine wave, calculated in Excel as integers, as was suggested earlier. The input to the lookup table would be a counter that increments once per timing loop and is reset once per pendulum cycle, when it reaches 200. However, since your code is not structured in this general-purpose manner, you will need to build the cosine into your timing code. A spreadsheet will help to calculate the position of each LED based on the cosine of the time slice. On 2/22/14 8:31 AM, Bill van Dijk wrote: Hello, I have built a clock controlled by a PIC with 6 numitrons in the centre. Around them is a circle of 60LEDs which are programmed to display a number of different patterns. I am currently working on a pendulum pattern which uses the lower 30 LEDs. I have the software done, the challenge is this: A pendulum has a period and an angular velocity that changes from 0 at the ends, and maximum in the center, following an equation. In the software I currently have 36 time slices (program steps, 0 to 35) in a half period of 107 clock cycles, for a total of 3852 cycles for one swing (left or right). Looking at one swing, my challenge now is to divide the 36 program steps of 107 clock cycles such that the total number of clock cycles remains 3852, but the actual number of clock cycles per step are divided such as to approximate the equation of one pendulum swing (left or right). Anyone willing to take a stab at this? Bill van Dijk -- David Forbes, Tucson AZ -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/5308F429.9050302%40dakotacom.net. For more options, visit https://groups.google.com/groups/opt_out.
RE: [neonixie-l] Math wizzards....
Hi Frank. Yes, that is indeed about the way it works, I currently have a lookup table with 36 entries containing the value 0x6B, each time the PIC shifts the LEDs, it looks up the required step time, resulting in a nice linear pendulum. I did fiddle with a spreadsheet, but after 40+ years of not using any advanced math, I don't know how to set up a formula. I suppose my only other option is to just take a stab at it, add some here, subtract the same somewhere else and approximate something. I figured that there could be someone on this list who'd say: oh, that's easy, you just do. or even better: here are your numbers.. :-) Thanks, Bill. From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of Frank Bemelman Sent: Saturday, February 22, 2014 1:06 PM To: neonixie-l@googlegroups.com Subject: Re: [neonixie-l] Math wizzards Hi Bill, I’d go for a table driven approach. The table has 30 values (or perhaps 15, for one quadrant of your clock face) and the function is called 3852 times with a parameter 0-3852 and compared against the table to decide which led is to be activated. The table can be calculated with a spreadsheet. Just do some experiments with a spreadsheet, until you get that eureka feeling. Then transfer the values to your PIC code, putting them in a nested if-then-else scheme to compare against the 30 or 15 values. It does not take more than 6 compares (maximum) to find the answer. I would not use the PIC to do time consuming floating point math. A precalculated table makes more sense here. Cheers, Frank From: Bill van Dijk <mailto:bvd...@xplornet.com> Sent: Saturday, February 22, 2014 5:43 PM To: neonixie-l@googlegroups.com Subject: RE: [neonixie-l] Math wizzards Yes, I am with you so far. My challenge is to actually put that knowledge to work, and find the correct numbers. Cheers, Bill From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of Tidak Ada Sent: Saturday, February 22, 2014 11:03 AM To: neonixie-l@googlegroups.com Subject: RE: [neonixie-l] Math wizzards Remember the swing velocity is a (co)sine function. The highest speed is in the zero crossing the tops are the left and right ends of the swing with a speed zero. eric _ From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of Bill van Dijk Sent: zaterdag 22 februari 2014 16:31 To: neonixie-l@googlegroups.com Subject: [neonixie-l] Math wizzards Hello, I have built a clock controlled by a PIC with 6 numitrons in the centre. Around them is a circle of 60LEDs which are programmed to display a number of different patterns. I am currently working on a pendulum pattern which uses the lower 30 LEDs. I have the software done, the challenge is this: A pendulum has a period and an angular velocity that changes from 0 at the ends, and maximum in the center, following an equation. In the software I currently have 36 time slices (program steps, 0 to 35) in a half period of 107 clock cycles, for a total of 3852 cycles for one swing (left or right). Looking at one swing, my challenge now is to divide the 36 program steps of 107 clock cycles such that the total number of clock cycles remains 3852, but the actual number of clock cycles per step are divided such as to approximate the equation of one pendulum swing (left or right). Anyone willing to take a stab at this? Bill van Dijk -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/002101cf2fe3%242ae9c9c0%2480bd5d40%24%40com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/!%26!AAAYAPDddShx705MuX20yCpp0vvCgAAAEPGcVbt7i2JNk%2B0ud8ipvKsBAA%3D%3D%40zeelandnet.nl. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https:
RE: [neonixie-l] Math wizzards....
That should be easy enough to do. I don't have the equations memorized for this. If it was me attempting to do it, I'd start by grabbing any and all math and physics books, and looking up pendulums and periods and stuff like that. Sooner or later if you do that, you'll find the equation which describes the velocity at any given point in the swing. Once you know that, then you can go back to your time slices and your bits, and then assign them so that they come the closest possible at each point that you have defined. Grab all the books, blow the dust off, and have fun!! This is a good one, and congratulations for doing it! Let us know how it turns out. Chuck > > > Original Message >From: bvd...@xplornet.com >To: neonixie-l@googlegroups.com >Subject: RE: [neonixie-l] Math wizzards >Date: Sat, 22 Feb 2014 11:43:44 -0500 > >>Yes, I am with you so far. My challenge is to actually put that >knowledge to >>work, and find the correct numbers. >> >> >> >>Cheers, Bill >> >> >> >>From: neonixie-l@googlegroups.com >[mailto:neonixie-l@googlegroups.com] On >>Behalf Of Tidak Ada >>Sent: Saturday, February 22, 2014 11:03 AM >>To: neonixie-l@googlegroups.com >>Subject: RE: [neonixie-l] Math wizzards >> >> >> >>Remember the swing velocity is a (co)sine function. The highest >speed is in >>the zero crossing the tops are the left and right ends of the swing >with a >>speed zero. >> >> >> >>eric >> >> >> >> _ >> >>From: neonixie-l@googlegroups.com >[mailto:neonixie-l@googlegroups.com] On >>Behalf Of Bill van Dijk >>Sent: zaterdag 22 februari 2014 16:31 >>To: neonixie-l@googlegroups.com >>Subject: [neonixie-l] Math wizzards >> >>Hello, >> >> >> >>I have built a clock controlled by a PIC with 6 numitrons in the >centre. >>Around them is a circle of 60LEDs which are programmed to display a >number >>of different patterns. I am currently working on a pendulum pattern >which >>uses the lower 30 LEDs. I have the software done, the challenge is >this: >> >> >> >>A pendulum has a period and an angular velocity that changes from 0 >at the >>ends, and maximum in the center, following an equation. In the >software I >>currently have 36 time slices (program steps, 0 to 35) in a half >period of >>107 clock cycles, for a total of 3852 cycles for one swing (left or >right). >> >> >> >>Looking at one swing, my challenge now is to divide the 36 program >steps of >>107 clock cycles such that the total number of clock cycles remains >3852, >>but the actual number of clock cycles per step are divided such as >to >>approximate the equation of one pendulum swing (left or right). >> >> >> >>Anyone willing to take a stab at this? >> >> >> >>Bill van Dijk >> >>-- >>You received this message because you are subscribed to the Google >Groups >>"neonixie-l" group. >>To unsubscribe from this group and stop receiving emails from it, >send an >>email to neonixie-l+unsubscr...@googlegroups.com. >>To post to this group, send an email to neonixie-l@googlegroups.com. >>To view this discussion on the web, visit >>https://groups.google.com/d/msgid/neonixie-l/002101cf2fe3%242ae9c9c0 >%2480bd5 >>d40%24%40com. >>For more options, visit https://groups.google.com/groups/opt_out. >> >>-- >>You received this message because you are subscribed to the Google >Groups >>"neonixie-l" group. >>To unsubscribe from this group and stop receiving emails from it, >send an >>email to neonixie-l+unsubscr...@googlegroups.com. >>To post to this group, send an email to neonixie-l@googlegroups.com. >>To view this discussion on the web, visit >>https://groups.google.com/d/msgid/neonixie-l/!%26!AAAYAA >AAAPDddS >>hx705MuX20yCpp0vvCgAAAEPGcVbt7i2JNk%2B0ud8ipvKsBAA%3D%3D%40z >eelandne >>t.nl. >>For more options, visit https://groups.google.com/groups/opt_out. >> >>-- >>You received this message because you are subscribed to the Google >Groups "neonixie-l" group. >>To unsubscribe from this group and stop receiving emails from it, >send an email to neonixie-l+unsubscr...@googlegroups.com. >>To post to this group, send an email to neonixie-l@googlegroups.com. >>To view this discussion on the web, visit >https://groups.google.com/d/msgid/neonixie-l/002d01cf2fed%2452113dd0% >24f633b970%24%40com. >>For more options, vis
Re: [neonixie-l] Math wizzards....
Hi Bill, I’d go for a table driven approach. The table has 30 values (or perhaps 15, for one quadrant of your clock face) and the function is called 3852 times with a parameter 0-3852 and compared against the table to decide which led is to be activated. The table can be calculated with a spreadsheet. Just do some experiments with a spreadsheet, until you get that eureka feeling. Then transfer the values to your PIC code, putting them in a nested if-then-else scheme to compare against the 30 or 15 values. It does not take more than 6 compares (maximum) to find the answer. I would not use the PIC to do time consuming floating point math. A precalculated table makes more sense here. Cheers, Frank From: Bill van Dijk Sent: Saturday, February 22, 2014 5:43 PM To: neonixie-l@googlegroups.com Subject: RE: [neonixie-l] Math wizzards Yes, I am with you so far. My challenge is to actually put that knowledge to work, and find the correct numbers. Cheers, Bill From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of Tidak Ada Sent: Saturday, February 22, 2014 11:03 AM To: neonixie-l@googlegroups.com Subject: RE: [neonixie-l] Math wizzards Remember the swing velocity is a (co)sine function. The highest speed is in the zero crossing the tops are the left and right ends of the swing with a speed zero. eric From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of Bill van Dijk Sent: zaterdag 22 februari 2014 16:31 To: neonixie-l@googlegroups.com Subject: [neonixie-l] Math wizzards Hello, I have built a clock controlled by a PIC with 6 numitrons in the centre. Around them is a circle of 60LEDs which are programmed to display a number of different patterns. I am currently working on a pendulum pattern which uses the lower 30 LEDs. I have the software done, the challenge is this: A pendulum has a period and an angular velocity that changes from 0 at the ends, and maximum in the center, following an equation. In the software I currently have 36 time slices (program steps, 0 to 35) in a half period of 107 clock cycles, for a total of 3852 cycles for one swing (left or right). Looking at one swing, my challenge now is to divide the 36 program steps of 107 clock cycles such that the total number of clock cycles remains 3852, but the actual number of clock cycles per step are divided such as to approximate the equation of one pendulum swing (left or right). Anyone willing to take a stab at this? Bill van Dijk -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/002101cf2fe3%242ae9c9c0%2480bd5d40%24%40com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/!%26!AAAYAPDddShx705MuX20yCpp0vvCgAAAEPGcVbt7i2JNk%2B0ud8ipvKsBAA%3D%3D%40zeelandnet.nl. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/002d01cf2fed%2452113dd0%24f633b970%24%40com. For more options, visit https://groups.google.com/groups/opt_out. --- Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus-bescherming actief is. http://www.avast.com -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/66AE152FD6994EB98E6054A1225E6255%40FrankPC2012. For more options, visit https://groups.google.com/groups/opt_out.
RE: [neonixie-l] Math wizzards....
Yes, I am with you so far. My challenge is to actually put that knowledge to work, and find the correct numbers. Cheers, Bill From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of Tidak Ada Sent: Saturday, February 22, 2014 11:03 AM To: neonixie-l@googlegroups.com Subject: RE: [neonixie-l] Math wizzards Remember the swing velocity is a (co)sine function. The highest speed is in the zero crossing the tops are the left and right ends of the swing with a speed zero. eric _ From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of Bill van Dijk Sent: zaterdag 22 februari 2014 16:31 To: neonixie-l@googlegroups.com Subject: [neonixie-l] Math wizzards Hello, I have built a clock controlled by a PIC with 6 numitrons in the centre. Around them is a circle of 60LEDs which are programmed to display a number of different patterns. I am currently working on a pendulum pattern which uses the lower 30 LEDs. I have the software done, the challenge is this: A pendulum has a period and an angular velocity that changes from 0 at the ends, and maximum in the center, following an equation. In the software I currently have 36 time slices (program steps, 0 to 35) in a half period of 107 clock cycles, for a total of 3852 cycles for one swing (left or right). Looking at one swing, my challenge now is to divide the 36 program steps of 107 clock cycles such that the total number of clock cycles remains 3852, but the actual number of clock cycles per step are divided such as to approximate the equation of one pendulum swing (left or right). Anyone willing to take a stab at this? Bill van Dijk -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/002101cf2fe3%242ae9c9c0%2480bd5 d40%24%40com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/!%26!AAAYAPDddS hx705MuX20yCpp0vvCgAAAEPGcVbt7i2JNk%2B0ud8ipvKsBAA%3D%3D%40zeelandne t.nl. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/002d01cf2fed%2452113dd0%24f633b970%24%40com. For more options, visit https://groups.google.com/groups/opt_out.
RE: [neonixie-l] Math wizzards....
Remember the swing velocity is a (co)sine function. The highest speed is in the zero crossing the tops are the left and right ends of the swing with a speed zero. eric _ From: neonixie-l@googlegroups.com [mailto:neonixie-l@googlegroups.com] On Behalf Of Bill van Dijk Sent: zaterdag 22 februari 2014 16:31 To: neonixie-l@googlegroups.com Subject: [neonixie-l] Math wizzards Hello, I have built a clock controlled by a PIC with 6 numitrons in the centre. Around them is a circle of 60LEDs which are programmed to display a number of different patterns. I am currently working on a pendulum pattern which uses the lower 30 LEDs. I have the software done, the challenge is this: A pendulum has a period and an angular velocity that changes from 0 at the ends, and maximum in the center, following an equation. In the software I currently have 36 time slices (program steps, 0 to 35) in a half period of 107 clock cycles, for a total of 3852 cycles for one swing (left or right). Looking at one swing, my challenge now is to divide the 36 program steps of 107 clock cycles such that the total number of clock cycles remains 3852, but the actual number of clock cycles per step are divided such as to approximate the equation of one pendulum swing (left or right). Anyone willing to take a stab at this? Bill van Dijk -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/002101cf2fe3%242ae9c9c0%2480bd5 d40%24%40com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to neonixie-l+unsubscr...@googlegroups.com. To post to this group, send an email to neonixie-l@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/neonixie-l/!%26!AAAYAPDddShx705MuX20yCpp0vvCgAAAEPGcVbt7i2JNk%2B0ud8ipvKsBAA%3D%3D%40zeelandnet.nl. For more options, visit https://groups.google.com/groups/opt_out.