| Arduino Forum ::  Members :: Morris Dovey
 Show Posts Pages: 1 2 [3] 4 5 ... 29
 31 Using Arduino / Programming Questions / Re: how do you perform math on a function in an array? on: April 23, 2012, 10:42:33 pm I would tackle it this way:(1) Isolate and evaluate the whole part as an int value(2) Isolate and evaluate the numerator as an int value(3) Isolate and evaluate the denominator as an int value(4) multiply denominator times whole part and add numerator to produce the numerator of a (possibly improper) fraction(5) add one-half of the denominator to this numerator for rounding, if desired(6) divide this numerator (cast to float) by the denominator (also cast to float)(7) the quotient is the value you're after.
 32 Using Arduino / Programming Questions / Re: Least Squares Approximation on: April 23, 2012, 03:51:51 pm It should be effective for closed-loop control as well. I'm applying heat to bring a Ni/H reaction to the ignition point and, since there isn't any historical data to work from (and because significant overheating could be hazardous), I'd like the control program to be able to use the actual dT/dt as the basis for determining how aggressively energy is being pumped into the reactor as it is heated to a target (test) temperature.I've shown 200˚C as my target temperature for the plots, in which the vertical axis is the duty cycle of the heater and the horizontal axis is the current temperature. The degree of "aggression" is controlled by a one byte value that's adjusted dynamically to speed up or slow down the heating process.I finally got around to plotting the "family" of curves for parameter values of 1, 2, 4, 8. and 16 (convenient doing division by shifting). I'll attach the plot.
 33 Using Arduino / Programming Questions / Re: Least Squares Approximation on: April 23, 2012, 07:05:29 am I think that the most effective strategy might be to first use the Arduino as a data acquisition front-end for a more capable machine for the least squares analysis to discover the specifics of the relationships, then make use of that relationship in the production Arduino software.When that strategy can be adopted, the need to maintain a statistically-significant collection of data can be much reduced.I did a bit of that myself this past weekend to come up with a formula for the amount of power to be applied to the ignition heater of a small LENR reactor. I wanted a formula that my controller code could adjust as it "learned" about the quirks of each particular reactor so which it might be connected. I'll attach some plots so you can see what I'm talking about and, perhaps, find the technique useful in your own project.
 34 Using Arduino / Programming Questions / Re: An easy-to-use code flow diagramming tool? on: April 23, 2012, 12:03:56 am Ken - Sample attached (It'd have been better if I could have figured out how to label the decision choices.  )
 35 Using Arduino / Programming Questions / Re: An easy-to-use code flow diagramming tool? on: April 22, 2012, 10:57:52 pm Represent the function call with a "pre-defined process" flowchart symbol.You can flowchart the called function just like any other program.
 36 Using Arduino / Programming Questions / Re: An easy-to-use code flow diagramming tool? on: April 22, 2012, 04:30:49 pm Was lurking...I downloaded both packages for the Mac and gave them a quick try. For flowcharting (only) yEd looks pretty good - and for flowcharting plus a lot of other flavors of diagramming, Dia looks like a winner (although it uses up a sizable amount of file space).I decided that for the time being I'd keep yEd for flowcharts, and see how much I actually need the capabilities of Dia. If it turns out that I don't need all that capability, I'll un-install Dia.I think I'll retire my old green plastic template.
 37 Using Arduino / Programming Questions / Re: How to determine trending of values.. on: April 21, 2012, 08:50:36 am The home-brew machine is a 3½-axis (spindle can be locked anywhere from vertical to horizontal) with a 1/4800" step size. My only images are stills I took during the build/test stage. I've posted three of the stills in the thread at http://arduino.cc/forum/index.php/topic,88204.0.html (Bar Sport, where stuff like this is topical).More topical: If you have difficulty converting data points to a function, do a forum search on "least squares" - a while back I posted C source for a program (FABLS.c) that fits linear and a number of non-linear functions. It may help.
 38 Using Arduino / Programming Questions / Re: How to determine trending of values.. on: April 20, 2012, 06:28:59 pm If you're reduced to fishing, it's time to step back from the task at hand and learn more about the more general nature of programming in the Arduino environment.If the problem has your head spinning, then it's time to take a break from the implementing of a solution and think about what you have to work with and what, in general, you want to use it to achieve.When you're more relaxed with the endeavor, try writing a complete functional specification as though you were were going to spend your own hard-earned money to have someone else (paid by the hour!) build your device for you.(BTW, I'm a ShopBot owner - and I also have designed and built my own CNC router. I like the looks of your Stinger.)
 39 Using Arduino / Programming Questions / Re: How to determine trending of values.. on: April 20, 2012, 04:47:43 pm Another approach might be to acquire stepper position and voltage readings at both ends of the pot's range. Since it's linear, you can then interpolate to make an accurate estimate of desired stepper position, move the stepper to that position, take a voltage reading and fine tune (probably just a step or two in either direction) if needed.
 40 Using Arduino / Programming Questions / Re: How to determine trending of values.. on: April 20, 2012, 03:36:05 pm 1. What is the expected minimum and maximum time between events?2. If the analog values were plotted against time, do you expect a linear or non-linear graph? (If non-linear, what type of relationship are you expecting?)3. Are you aware that there will be (in computer time) a significant delay between the time you acquire an analog reading and the time the stepper completes the indicated movement? One of the possibilities is to incorporate heuristic and/or predictive processing - but the (apparent) downside is that that kind of help can't be provided by "blindfolded" people...