Thanks Darrel,
The interrupt rate varies depending on application but up to 2.5kHz.
I guess by 'the division' you mean V_Max / A_Max ? Or do you mean Distance/2 (I don't think so since the reminder will either be 0 or 1)?
So, in the previous, non ideal example I'd get 100//15 = 10.
From there I don't quite follow... If I keep adding 10 to a BYTE variable it'll overflow on the 26th tick which is right at the very end of the profile in that previous example, that can't be right. On the other hand, for the acceleration step:
Code:
Accumulator = Accumulator + Reminder
If Accumulator >= A_Max THEN
Accumulator = Accumulator - A_Max
Velocity = Velocity + 1
END IF
Is that in line with what you're thinking?
I need to sleep on this I think. Thanks again!
/Henrik.
Bookmarks