After test in lathe. Basically ok, always use real Tstartf, not 1/n
This commit is contained in:
@@ -68,12 +68,11 @@ uint32_t StepGen2::handleStepper(uint64_t irqTime)
|
|||||||
}
|
}
|
||||||
void StepGen2::startTimerCB()
|
void StepGen2::startTimerCB()
|
||||||
{
|
{
|
||||||
|
|
||||||
startTimer->pause(); // Once is enough.
|
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.
|
// There will be a short break here for t2 usecs, in the future.
|
||||||
timerPulseSteps = abs(nSteps);
|
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->setOverflow(timerFrequency, HERTZ_FORMAT);
|
||||||
pulseTimer->setCaptureCompare(pulseTimerChan, 5, MICROSEC_COMPARE_FORMAT); // 5 usecs
|
pulseTimer->setCaptureCompare(pulseTimerChan, 5, MICROSEC_COMPARE_FORMAT); // 5 usecs
|
||||||
pulseTimer->resume();
|
pulseTimer->resume();
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ extend32to64 longTime;
|
|||||||
void cb_set_outputs(void) // Master outputs gets here, slave inputs, first operation
|
void cb_set_outputs(void) // Master outputs gets here, slave inputs, first operation
|
||||||
{
|
{
|
||||||
Encoder1.setLatch(Obj.IndexLatchEnable);
|
Encoder1.setLatch(Obj.IndexLatchEnable);
|
||||||
Encoder1.setScale(500);
|
Encoder1.setScale(2000);
|
||||||
|
|
||||||
// Step2.reqPos(Obj.CommandedPosition2);
|
// Step2.reqPos(Obj.CommandedPosition2);
|
||||||
// Step2.setScale(Obj.StepsPerMM2);
|
// Step2.setScale(Obj.StepsPerMM2);
|
||||||
|
|||||||
Reference in New Issue
Block a user