the bresenham-algorithm is for cartesian XY-axles. The synchronisation is done through
one loop
that creates the setp-signals for both motors.
as an easy to follow example if you have a slope of 0,5.
This means every two steps in X you do one step in Y.
one step x
onestep x and one step y
one step x
one step x and one step y
...
so in programming this would be
for (int i = 1; i < = 100; i++
stepx(); //with each iteration do a X-step
if ( i % 2 == 0) { // only if division by 2 has remainder zero
stepY // do a Y-Step
}
}
bresenham calculates the slope. The axle that has the bigger value becomes the leading axle because more step-pulses must be created and the slower axle just creates a step if adding a fraction goes across the next digit before the comma
example for slope 0,25
y = 0,25 one step X
y = 0,5 one step X
y = 0,75 one step X
y = 1,0 one step X y-digit goes up before decimal-point => one step Y
y = 1,25 one step X
y = 1,5 one step X
y = 1,75 one step X
y = 2,0 one step X y-digit goes up before decimal-point => one step Y
....
If you have a slope bigger than 1 example slope 3
Y becomes the leading axle
x = 0,33 one step Y
x = 0,67 one step Y
x = 1,00 one step Y digit before decimal poit goes up => one step X
x = 1,33 one step Y
x = 1,67 one step Y
x = 2,00 one step Y digit before decimal poit goes up => one step X
...
that is the way bresenham works.
Now you have a very different mechanical system.
If you don't have a ready to use project there is no way around doing the calculations from cartesian xy-coordinates to changing toothbelt-lengths
Learning this will be a real great exercise how learning at university works.
Starting at a really low knowledge-level learning basics on the subject, proceeding further and further.
A part with try and error a part with tests and analysing the results.
This process includes to ask all kinds of epxerts:
- books
- articels
- online-ressources
- experts for motion-control
- forum-users
you can take time to work it out. There is no timelimit like in an examination
you can ask all kinds of experts etc.
And this way you will make it work and you will be well prepared to the learning style of universities where others will do the first steps when arriving at the university.
You should click the "solved" button again to make the thread unsolved. As it is not yet solved
or start a new thread with a different title.
best regards Stefan