Question about easing - unexpected action #77
sjgcornish
started this conversation in
General
Replies: 1 comment
-
Your ESP32 Asymmetric easing example gives me something else to try. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. My application works thanks to your help apart from one point that puzzles be. I set the speed to 50000 and that is fine for controlling the steering servos. I added a button to move the servos back to 90 degrees with the idea of setting the speed back to 60 for this move back to 90 but what happens is unexpected. Moving from for example 45 degrees to 90 the motors follow the default easing algorithm at 60 however moving from say 135 to 90 the motors move at essentially full speed, i.e. the algorithm is ignored. More surprisingly... I have four motors the back pair are mounted the opposite to the front pair so full left is 0 degrees on one pair and 180 degrees for the other pair. When I send go to 90 degree command the one pair eases to 90 degrees and the other pair at full speed back to 90 AFTER the first pair get to 90. The call is
void setDirectionMap_Degrees(int degr, int speed){
.......
ServoEasing::ServoEasingNextPositionArray[0] = BLDegrees; //Back left
ServoEasing::ServoEasingNextPositionArray[1] = FLDegrees; //Front Left
ServoEasing::ServoEasingNextPositionArray[2] = BRDegrees; //Back right
ServoEasing::ServoEasingNextPositionArray[3] = FRDegrees; //Front Right
setEaseToForAllServosSynchronizeAndStartInterrupt(speed);
while (ServoEasing::areInterruptsActive()) {
delay(1);
yield();
}
}
.Where all the degrees at set to 90 so why do not all four move at the same time. They all move in sync when incrementing and decrementing the degrees with the same. I thought that my increment / decrement routine may be in conflict with the your code so i disabled it when the request to jump to 90 degrees was received but this made no difference.
I cannot think of any reason why the above code would not operate all for motors in sync. All moves are made through the same code above and I disabled all calls before using this same routing to move the motors to 90. I even tried bi-passing the routine and making the calls in-line with out the delay(1) and yield(0 with no effect.
Any thoughts would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions