We are creating a project, in one part, we want to move the hand in different positions, we want to keep the handle in same space in stead of same time period. Right now, the program does is set the same duration and wherever the destination so that the speed are out of control. SO is there a way to do that?
If I understand correctly, you are using the position controller and you would like to make movements of a certain constant velocity?
If that is your question, then yes you can make the position controller move at a constant velocity.
In the example code for the position controller the duration of the movement is relatively constant (though not perfectly). In order to make the movement have a constant velocity you will need to plan the trajectory differently. You will need a ramp up to your required velocity, constant speed, ramp down to zero. The general principal using Stateflow is:
1. Create a ramp up state.
x, y in the trajectory is previous x, y + new calculated position based on current velocity. Add to the current velocity.
When at the desired velocity move to the next state
2. Create a steady speed state
x, y in the trajectory is the previous x,y + new calculated position based on desired velocity. When you reach the threshold position to begin deceleration move to the next state.
3. x, y in the trajectory is previous x, y + new calculated position based on current velocity. Subtract from to the current velocity.
When the final position is reached you should be at zero velocity, stop movement.
Please let me know if that helps.
Do I change it in Create_Trajectory box?