Hi
i want to thank you for all the work and investigations done so far on this topic.i'm currently running a RasPi4 on latest build of LinuxCnc and added the pokeys.comp attached to this thread.
To contribute i'm currently extending that comp-file (
github.com/zarfld/LinuxCnc_PokeysLibComp.git
)
- i already use the info parametrized on the dev, to see if the Pin is used as DIN, DOUT or AIN
- it should work with both USB and NET devices (i could test with 57E only)
- RTC is being read
- to be able to use the pokeys PulseEngine instead of Dir/Pulse signals (due to limitations of updatefrequency ). as a sideeffect i can also use PEv2 channels for E-Stop,Enable,Limit
has anyone already tried to use the pulseengine directly?
i assume as a first step i would need to somehow translate the stepgen interface
Code:
setp stepgen.0.position-scale [JOINT_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
net xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb
to PEv2
Code:
int32_t CurrentPosition[8]; // Current position
int32_t PositionSetup[8]; // Position to be set as current position
int32_t ReferencePositionSpeed[8]; // Reference position or speed (position or pulses/s)
int8_t InvertAxisEnable[8]; // Invert axis enable signal
int32_t SoftLimitMaximum[8]; // Soft limit maximum position
int32_t SoftLimitMinimum[8]; // Soft limit minimum position
uint8_t HomingSpeed[8]; // Homing speed per axis (in %)
uint8_t HomingReturnSpeed[8]; // Homing return speed per axis (in % of the homing speed)
int32_t HomeOffsets[8]; // Home position offset
uint8_t HomingAlgorithm[8]; // Homing algorithm configuration
uint8_t FilterLimitMSwitch[8]; // Digital filter for limit- switch
uint8_t FilterLimitPSwitch[8]; // Digital filter for limit+ switch
uint8_t FilterHomeSwitch[8]; // Digital filter for home switch
int32_t ProbePosition[8]; // Position where probe detected change
int32_t ProbeMaxPosition[8]; // Maximum position to travel to until stopping and returning error
float MaxSpeed[8]; // Maximum axis speed (in pulses per ms)
float MaxAcceleration[8]; // Maximum axis acceleration (in pulses/ms/ms)
float MaxDecceleration[8]; // Maximum axis deceleration (in pulses/ms/ms)
int32_t MPGjogMultiplier[8]; // MPG jog multiplier value
uint8_t MPGjogEncoder[8]; // MPG jog encoder ID
uint8_t PinHomeSwitch[8]; // Home switch pin (0 for external dedicated input)
uint8_t PinLimitMSwitch[8]; // Limit- switch pin (0 for external dedicated input)
uint8_t PinLimitPSwitch[8]; // Limit+ switch pin (0 for external dedicated input)
uint8_t AxisEnableOutputPins[8]; // Axis enabled output pin (0 for external dedicated output)
uint32_t HomeBackOffDistance[8]; // Back-off distance after homing
uint16_t MPGjogDivider[8]; // Divider for the MPG jogging (enhanced encoder resolution)
uint8_t reserved[8]; // Motion buffer entries - moved further down...
uint8_t ReservedSafety[8];
uint8_t PulseEngineEnabled; // Pulse engine enabled status, also number of enabled axes
uint8_t PulseGeneratorType; // Pulse engine generator type (0: external, 1: internal 3ch)
uint8_t AxisEnabledStatesMask; // Bit-mapped states, where axis enabled and charge pump signals are active
uint8_t PulseEngineStateSetup; // Pulse engine new state configuration
uint8_t PulseEngineBufferSize; // Buffer size information...
uint8_t motionBufferEntriesAccepted;
uint8_t newMotionBufferEntries;
uint8_t HomingStartMaskSetup; // Bit-mapped axes indexes to be homed
uint8_t ProbeStartMaskSetup; // Bit-mapped axis indexes for probing
float ProbeSpeed; // Probe speed (ratio of the maximum speed)
uint16_t BacklashWidth[8]; // half of real backlash width
int16_t BacklashRegister[8]; // current value of the backlash register
uint8_t BacklashAcceleration[8]; // in pulses per ms^2
uint8_t BacklashCompensationEnabled;
uint8_t reserved_back[3];
these channels are available (1:1) already in the comp, but besides the pins i'm currently investigating on how to use them.
some parts might be just a kind of unitconversion [m/s] to [pulses per ms], others might be more complicated (eg. until now i did not find any good explanation how to use MotionBuffer correctly).
Any tips, hints suggestions are welcome.
BR
Dominik