Works really nice now. 20 usecs base period => 50 kHz, 25 kHz pulse freq.
This commit is contained in:
@@ -146,7 +146,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// For the example
|
// For the example
|
||||||
#define BASE_PERIOD 40000
|
#define BASE_PERIOD 20000
|
||||||
#define SERVO_PERIOD 2000000
|
#define SERVO_PERIOD 2000000
|
||||||
#define JOINT_X_STEPGEN_MAXACCEL 0.0
|
#define JOINT_X_STEPGEN_MAXACCEL 0.0
|
||||||
#define JOINT_Z_STEPGEN_MAXACCEL 0.0
|
#define JOINT_Z_STEPGEN_MAXACCEL 0.0
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ void setup(void)
|
|||||||
baseTimer = new HardwareTimer(TIM11); // The base period timer
|
baseTimer = new HardwareTimer(TIM11); // The base period timer
|
||||||
uint32_t usecs = BASE_PERIOD / sync0CycleTime;
|
uint32_t usecs = BASE_PERIOD / sync0CycleTime;
|
||||||
// setFrequencyAdjustedMicrosSeconds(baseTimer, usecs);
|
// setFrequencyAdjustedMicrosSeconds(baseTimer, usecs);
|
||||||
baseTimer->setOverflow(35, MICROSEC_FORMAT);
|
baseTimer->setOverflow(BASE_PERIOD / 1000, MICROSEC_FORMAT);
|
||||||
baseTimer->attachInterrupt(basePeriodCB);
|
baseTimer->attachInterrupt(basePeriodCB);
|
||||||
|
|
||||||
syncTimer = new HardwareTimer(TIM3); // The Linuxcnc servo period sync timer
|
syncTimer = new HardwareTimer(TIM3); // The Linuxcnc servo period sync timer
|
||||||
|
|||||||
Reference in New Issue
Block a user