After test in lathe. Basically ok, always use real Tstartf, not 1/n

This commit is contained in:
Hakan Bastedt
2024-03-08 09:00:55 +01:00
parent 94d68adbb1
commit 31be067dea
2 changed files with 3 additions and 4 deletions

View File

@@ -68,12 +68,11 @@ uint32_t StepGen2::handleStepper(uint64_t irqTime)
}
void StepGen2::startTimerCB()
{
startTimer->pause(); // Once is enough.
digitalWrite(dirPin, nSteps > 0 ? HIGH : LOW);
digitalWrite(dirPin, nSteps < 0 ? HIGH : LOW);
// There will be a short break here for t2 usecs, in the future.
timerPulseSteps = abs(nSteps);
pulseTimer->setMode(pulseTimerChan, TIMER_OUTPUT_COMPARE_PWM1, stepPin);
pulseTimer->setMode(pulseTimerChan, TIMER_OUTPUT_COMPARE_PWM2, stepPin);
pulseTimer->setOverflow(timerFrequency, HERTZ_FORMAT);
pulseTimer->setCaptureCompare(pulseTimerChan, 5, MICROSEC_COMPARE_FORMAT); // 5 usecs
pulseTimer->resume();

View File

@@ -41,7 +41,7 @@ extend32to64 longTime;
void cb_set_outputs(void) // Master outputs gets here, slave inputs, first operation
{
Encoder1.setLatch(Obj.IndexLatchEnable);
Encoder1.setScale(500);
Encoder1.setScale(2000);
// Step2.reqPos(Obj.CommandedPosition2);
// Step2.setScale(Obj.StepsPerMM2);