Ted wrote:There should be some kind of algorithm to determine the values directly in the program without the need for all of that data.
Yes indeed Ted, there should be an algorithm. I've been googling but are yet to find something usable. I think the algorithm/equation should solve for a parabola (or part of) Some stuff I've seen invloves quadratic equations (whatever they are

) and look very complicated.
Ted wrote:After all, how did you create the graphical curve in the first place? How did you get the data for the file?
The curve data was created as per the method below.
In a previous post I wrote:We have actually achieved this accel/decel curve using a rather unconventional "clever but lazy" method. We used Audio editing software and created a square wave from aprox. 2Hz to 2kHz - saved the file as raw data and imported it into a simple qb program that detects the leading edge of each square wave. This data is then used as reference to how many clock cycles the computer will do before giving the stepper a pulse - Works absolutely perfectly.
The timing can be fine tuned by using a multiplying number.
Ted wrote:One problem is that QB can only time accurately down to .05 seconds. If you are just relying on counter loops to time it, the speed will vary on different speed machines. Today most programmers use TIMER loops to avoid that problem.
No probs Ted, relying on the computers clock cycles is exactly what we are doing. (that's why we ditched windows)
The program is not for general release, so it doesn't matter that much - we have an old pentium just for the job. Nevertheless, the timing can be adjusted by the multiplying number, so it probably could be run on different computers. The critical part of the timing is the tracking speed and this was checked and adjusted using a frequency counter.
Ralph wrote:I would venture to say that you only need a very few actual numbers, certainly under 50 pairs of coordinates, to produce a very accurate acceleration/de-celaration curve.
I'm confused Ralph. The stepper motor we are using does 400 steps per revolution. 50 steps would give you an 8th of a turn (hardly going anywhere) My file has about 12500 numbers which equals approx 31 full revolutions - starting at approx. 1/2 a rev per sec, ramping up to about 5-6rps. The pulse width/timing is divided up as shown in my avatar graph.
It works perfect - nice and smooth - no sudden jumps.
Or am I misunderstanding what you are saying Ralph - I'm all for simplicity - Please elaborate.
markm wrote:One other thing you could do is to re-process your file to have fixed-length lines. Then you can SEEK one line back, or any number of lines either direction
Thanks markm, this sounds like it would work but I'm happy with the random access file method.
Cheers, Steve.