@Notepad @Charlie this is the equation that uses the acceleration & velocity constants
float PhaseStep::CalculateCurrentFraction() noexcept
{
// Driver is in assisted open loop mode
// In this mode the PID terms are not used and the A and V terms are independent of the loop time.
constexpr float scalingFactor = 100.0;
constexpr float scalingFactorSqr = scalingFactor * scalingFactor;
PIDVTerm = mParams.speed * Kv * scalingFactor;
PIDATerm = mParams.acceleration * Ka * scalingFactorSqr;
PIDControlSignal = min<float>(fabsf(PIDVTerm) + fabsf(PIDATerm), 256.0);
currentFraction = holdCurrentFraction + (1.0 - holdCurrentFraction) * min<float>(PIDControlSignal * (1.0/256.0), 1.0);
if (reprap.GetDebugFlags(Module::Move).IsBitSet(MoveDebugFlags::PhaseStep))
{
debugPrintf("v=%f, a=%f, cf=%f\n", (double)(mParams.speed * scalingFactor), (double)(mParams.acceleration * scalingFactorSqr), (double)currentFraction);
}
return currentFraction;
}
The units, calculation, and tuning are almost identical to assisted open loop on the 1HCL board with the main difference being it does not have the encoder to warn about skipped steps (stall detect also does not work when phase stepping), and the Kp & Kd terms are not used.
In YAT make sure that you have enabled DTR
if you are running the latest firmware as the USB code was changed recently. I don't know if there are other difference connecting to the Duet on MacOS