Mariss, the flowchart you provided... confuses the heck out of me. I think I can see how it could calculate velocity... but it seems /really/ over complicated for that... can you give me a little more detail about what the OUT = D or OUT = V or OUT = R commands actually do? Is that just a way of saying that it is returning the Distance to go or Velocity, or Remainder at that point? Or is that saying that the stepper should move forward that many steps at the current velocity?
In the mean time, I've done some trouble shooting and simulation on my code, which, of course, seems much simpler to me; but isn't that always the way of it? LOL...
https://docs.google.com/document/d/1...y4/edit?hl=en#
It's now producing very (very) simple output that seems to be correct to me. For example, in the case that X is the axis with the largest movement, and it is going from an initial position of 0,0,0 to 10,5,2, it produces a table like the following, where:
i = distance to go
sd = stopping distance, I thought this was going to be related to acceleration, but it seems to be working out to just be half of the distance to travel, so I'll probably change the way it is calculated.
xp,yp,zp = the positions of the three axis
xv = X Velocity, expressed as mS to wait between steps. At this point, these are just test values... working values would depend on the motors, hardware, etc...
ma = Maximum Acceleration, expressed as the number of mS to increase or decrease the delay between steps.
So you can see that the velocity is changed appropriately and the acceleration is nice and... curvy... with RAMP_ACCELERATION commented out, it does this:Code:i sd xp yp zp xv ma 10 0 0 0 0 200 20 9 1 1 0 0 180 40 8 2 2 1 0 140 60 7 3 3 1 1 80 40 6 4 4 2 1 40 20 5 5 5 2 1 20 0 4 5 6 3 1 20 20 3 5 7 3 1 40 40 2 5 8 4 2 80 60 1 5 9 4 2 140 40 0 5 10 5 2 180 20
Probably need to define ma as more than 20 in that mode...Code:i sd xp yp zp xv ma 10 0 0 0 0 200 20 9 1 1 0 0 180 20 8 2 2 1 0 160 20 7 3 3 1 1 140 20 6 4 4 2 1 120 20 5 5 5 2 1 100 20 4 5 6 3 1 120 20 3 5 7 3 1 140 20 2 5 8 4 2 160 20 1 5 9 4 2 180 20 0 5 10 5 2 200 20
I need to test further with longer and shorter movements, different values for the xv and ma (and sv = Starting velocity) parameters and then make it manage movements where the Y or Z axis is the largest movement.
It compiles to 722 words without ramp and 855 with ramping on a PIC 16F690 using the free HiTech C compiler. That is less than 20% of the code space, so adding a minimal parser to accept some sort of commands to send way-points and max velocities / accelerations shouldn't be impossible even on that little chip.
I'd really love to hear some feedback...


LinkBack URL
About LinkBacks




You probably have a google account that auto-cookies so you never see this screen...
