Stepping Code - Minor Speedup #40
Replies: 2 comments 4 replies
-
Sounds good. In reality, we don't really need to do hardly any multiplications. We can just add to the currentAngle like usual (needed for correction and PID), but we can also add to the currentStep, allowing the complete cutout of a good amount of equations. However, we still need to use a int32_t for the currentStep, as the steps and angle can sometimes go negative, depending on where the motor was powered on. I'll add this later today |
Beta Was this translation helpful? Give feedback.
-
Floating point operations are usually slower than integers. |
Beta Was this translation helpful? Give feedback.
-
1/32
Let's look at the stepping code from low to up.
So we can use integer calculations instead of float.
Beta Was this translation helpful? Give feedback.
All reactions