The correct execution of an S-curve profile requires that the movement time fits inside a long variable. This conditions is verified by EasyMotion Studio when the “S-curve Profiles” dialogue is closed.
Based on the values set in the “S-curve Profiles” dialogue, EasyMotion Studio computes the TJERK, T2 and T4 parameters and checks if (2xTJERK+T2+T4)x(TJERK+T2)xTJERK < 2^(32-1).
If the condition is met, the motion profile is considered valid and the TML code is generated. Otherwise (if the result is greater than 2.147.483.648) the following error message is generated: “JERK is too small, or ACCELERATION is too big“.
The TJERK, T2 and T4 parameters are computed using the algorithm below.
1. TJERK = CACC/JERK
Remarks:
– CACC (acceleration rate) and JERK are provided by the user in the “S-curve Profiles” dialogue
– the TJERK is always rounded to the closest integer number (i.e. TJERK = 3.223 will be rounded to TJERK = 3)
2. Tthe JERK is recomputed based on the rounded TJERK value: JERK = CACC/TJERK
Remark: The JERK will always be less or equal to the JERK given by the user.
3. If CACC > CPOS / (2 x TJERK^2) then T2=0; acc = CPOS / (2 x TJERK^2); spd = acc x TJERK;
3.1 If spd > CSPD then T4 = CPOS / CSPD – (2 x TJERK);
3.2 If spd <= CSPD then T4 = 0;
4. If CACC <= CPOS / (2 x TJERK^2) then:
4.1. If CPSD < CACC x TJERK then T2 = 0 and T4 = CPOS / CSPD – (2 x TJERK)
4.2. If CSPD >= CACC x TJERK then:
4.2.1 If CSPD > sqrt(CACC^2 x TJERK^2 + 4xCACC*CPOS)/2 – (CACC x TJERK)/2 then T2 = [sqrt(CACC^2 x TJERK^2 + 4xCACC*CPOS)/2 – (CACC x TJERK)/2]/CACC – TJERK; T4 = 0
4.2.2 If CSPD <= sqrt(CACC^2 x TJERK^2 + 4xCACC*CPOS)/2 – (CACC x TJERK)/2 then T2 = (CSPD/CACC) – TJERK; T4 = (CPOS/CSPD) – 2xTJERK – T2;
Remarks:
– in the procedure above, all parameters are expressed in drive internal units (encoder counts for position, encoder counts/sampling for speed, encoder counts/sampling2 for acceleration and encoder counts/sampling3 for the jerk).
– in the relations above, CACC represents the acceleration rate, CSPD the slew speed and CPOS the position increment / position to reach. All these parameters are set (by the user) in the “S-curve Profiles” dialogue.