Pokeys
- Pamkkkkk
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
05 Jun 2020 15:51 #170262
by Pamkkkkk
Replied by Pamkkkkk on topic PoKeys HAL Driver
found another pokeys.com here
gist.github.com/KurtJacobson/10e4bbff7b2af4366496e876b107a506
A quick compare seems that only row 11 differs.
>> pin out bit alive;
Which pokeys.comp file is to use?
I am totally new to CNC stuff!
gist.github.com/KurtJacobson/10e4bbff7b2af4366496e876b107a506
A quick compare seems that only row 11 differs.
>> pin out bit alive;
Which pokeys.comp file is to use?
I am totally new to CNC stuff!
Please Log in or Create an account to join the conversation.
- charlieLedezma
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
19 Jul 2020 21:17 #175200
by charlieLedezma
Replied by charlieLedezma on topic PoKeys HAL Driver
Hi everyone, hi @andypugh, could you (or anyone) help me please ?. I'm retrofitting my bridgeport308 cnc machine, I bought a pokeys57cnc and read the whole post about it here, but I'm pretty confused.
I did the complete procedure wrote by you, but some questions arised up: is necessary change its port configurations from windows, using the Polabs software ? How can I use the dedicated motor ports (8 in total) ?
Could you share your code file configuration with me ?
In the pokey.comp, one piece of code said:
<<
pin out bit in-# [55];
pin out float ain-# [3];
pin out bit err;
pin in float analog-scale-# [3];
pin in unsigned devSerial;
pin out bit alive;
>>
The question about it was, the sentence: "pin in float [X] " became the port [X] in a input into the pokeys57cnc ?
Thanks in advance....!!
I did the complete procedure wrote by you, but some questions arised up: is necessary change its port configurations from windows, using the Polabs software ? How can I use the dedicated motor ports (8 in total) ?
Could you share your code file configuration with me ?
In the pokey.comp, one piece of code said:
<<
pin out bit in-# [55];
pin out float ain-# [3];
pin out bit err;
pin in float analog-scale-# [3];
pin in unsigned devSerial;
pin out bit alive;
>>
The question about it was, the sentence: "pin in float [X] " became the port [X] in a input into the pokeys57cnc ?
Thanks in advance....!!
Please Log in or Create an account to join the conversation.
- JR1050
- Offline
- Platinum Member
Less
More
- Posts: 450
- Thank you received: 33
21 Aug 2020 03:26 #178890
by JR1050
Replied by JR1050 on topic Pokeys-libusb-1.00-0-dev unavailable
A couple years ago I intalled this Pokeys patch and it all worked. When attemping to do it tonite, I got the following
zoey@zoey:~$ sudo apt-get install libusb-1.0-0-dev
[sudo] password for zoey:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libusb-1.0-0-dev
E: Couldn't find any package by regex 'libusb-1.0-0-dev'
zoey@zoey:~$
I changed the stanzas in the apt file to reflect the archives, like so
deb http.archive.debian.org/debian/ wheezy main contrib non-free
deb-src archive.debian.org/debian/ wheezy main contrib non-free
deb http.archive.debian.org/debian/ wheezy-updates main contrib non-free
deb-src archive.debian.org/debian/ wheezy-updates main contrib non-free
Is there anyway to install the libusb dev file? It appears to be unavilable. It seems available as a tarball, how would one install it and does it have to be ver 1.0-0-dev or can it be a later version? At this point with Wheezy being depreciated, what is the next best option? Thanks
zoey@zoey:~$ sudo apt-get install libusb-1.0-0-dev
[sudo] password for zoey:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libusb-1.0-0-dev
E: Couldn't find any package by regex 'libusb-1.0-0-dev'
zoey@zoey:~$
I changed the stanzas in the apt file to reflect the archives, like so
deb http.archive.debian.org/debian/ wheezy main contrib non-free
deb-src archive.debian.org/debian/ wheezy main contrib non-free
deb http.archive.debian.org/debian/ wheezy-updates main contrib non-free
deb-src archive.debian.org/debian/ wheezy-updates main contrib non-free
Is there anyway to install the libusb dev file? It appears to be unavilable. It seems available as a tarball, how would one install it and does it have to be ver 1.0-0-dev or can it be a later version? At this point with Wheezy being depreciated, what is the next best option? Thanks
Please Log in or Create an account to join the conversation.
- MATZE-ATZE-SCH
- Offline
- Senior Member
Less
More
- Posts: 51
- Thank you received: 6
29 Apr 2021 20:52 #207397
by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys
Hello,
I have LinuxCNC 2.8.0 on Debian 10 and try to install the Pokey57U.
I have followed the steps from Andy on page 10.
In the Halshow I see the Pins, but the pokey.0.alive isn´t blinking and the IN0 isn´t respnse to a switch I connected to the Pokey for testing.
Is this a error because LinuxCNC 2.8, or Debian 10?
In the Terminal with "lsusb" I see the connected Pokey.
Also the compile of pokey.comp seems correct...
Maybe an error with RW permission for the Pokey caused by Debian10?
Best regards
Marcel
I have LinuxCNC 2.8.0 on Debian 10 and try to install the Pokey57U.
I have followed the steps from Andy on page 10.
In the Halshow I see the Pins, but the pokey.0.alive isn´t blinking and the IN0 isn´t respnse to a switch I connected to the Pokey for testing.
Is this a error because LinuxCNC 2.8, or Debian 10?
In the Terminal with "lsusb" I see the connected Pokey.
Also the compile of pokey.comp seems correct...
Maybe an error with RW permission for the Pokey caused by Debian10?
Best regards
Marcel
Please Log in or Create an account to join the conversation.
- MATZE-ATZE-SCH
- Offline
- Senior Member
Less
More
- Posts: 51
- Thank you received: 6
30 Apr 2021 18:06 - 30 Apr 2021 18:13 #207473
by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys
Ok,
have tried the steps again,
now I get an error message when try to compile the pokeys.comp with "sudo halcompile --install pokeys.comp":
gcc -I/usr/include -I/usr/include/linuxcnc -URTAPI -U__MODULE__ -DULAPI -Os -o pokeys /tmp/tmpSkpKFD/pokeys.c -Wl,-rpath,/lib -L/lib -llinuxcnchal
/usr/bin/ld: /tmp/ccUQNzda.o: in function `writeI2C':
pokeys.c:(.text+0x436): undefined reference to `PK_I2CWriteStart'
/usr/bin/ld: pokeys.c:(.text+0x44d): undefined reference to `PK_I2CWriteStatusGet'
/usr/bin/ld: /tmp/ccUQNzda.o: in function `readI2C':
pokeys.c:(.text+0x49b): undefined reference to `PK_I2CWriteStart'
/usr/bin/ld: pokeys.c:(.text+0x4ab): undefined reference to `PK_I2CReadStart'
/usr/bin/ld: pokeys.c:(.text+0x4ce): undefined reference to `PK_I2CReadStatusGet'
/usr/bin/ld: /tmp/ccUQNzda.o: in function `main':
pokeys.c:(.text.startup+0x89): undefined reference to `PK_ConnectToDeviceWSerial'
/usr/bin/ld: pokeys.c:(.text.startup+0xa1): undefined reference to `PK_DigitalIOGet'
/usr/bin/ld: pokeys.c:(.text.startup+0xb5): undefined reference to `PK_AnalogIOGet'
/usr/bin/ld: pokeys.c:(.text.startup+0x275): undefined reference to `PK_DisconnectDevice'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2: pokeys] Fehler 1
Any sugestions?
EDIT: Sorry, my fault, have used the wrong .comp...
But still unable to get it to work
have tried the steps again,
now I get an error message when try to compile the pokeys.comp with "sudo halcompile --install pokeys.comp":
gcc -I/usr/include -I/usr/include/linuxcnc -URTAPI -U__MODULE__ -DULAPI -Os -o pokeys /tmp/tmpSkpKFD/pokeys.c -Wl,-rpath,/lib -L/lib -llinuxcnchal
/usr/bin/ld: /tmp/ccUQNzda.o: in function `writeI2C':
pokeys.c:(.text+0x436): undefined reference to `PK_I2CWriteStart'
/usr/bin/ld: pokeys.c:(.text+0x44d): undefined reference to `PK_I2CWriteStatusGet'
/usr/bin/ld: /tmp/ccUQNzda.o: in function `readI2C':
pokeys.c:(.text+0x49b): undefined reference to `PK_I2CWriteStart'
/usr/bin/ld: pokeys.c:(.text+0x4ab): undefined reference to `PK_I2CReadStart'
/usr/bin/ld: pokeys.c:(.text+0x4ce): undefined reference to `PK_I2CReadStatusGet'
/usr/bin/ld: /tmp/ccUQNzda.o: in function `main':
pokeys.c:(.text.startup+0x89): undefined reference to `PK_ConnectToDeviceWSerial'
/usr/bin/ld: pokeys.c:(.text.startup+0xa1): undefined reference to `PK_DigitalIOGet'
/usr/bin/ld: pokeys.c:(.text.startup+0xb5): undefined reference to `PK_AnalogIOGet'
/usr/bin/ld: pokeys.c:(.text.startup+0x275): undefined reference to `PK_DisconnectDevice'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2: pokeys] Fehler 1
Any sugestions?
EDIT: Sorry, my fault, have used the wrong .comp...
But still unable to get it to work
Last edit: 30 Apr 2021 18:13 by MATZE-ATZE-SCH.
Please Log in or Create an account to join the conversation.
- MATZE-ATZE-SCH
- Offline
- Senior Member
Less
More
- Posts: 51
- Thank you received: 6
30 Apr 2021 20:26 #207482
by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys
Hello,
I have now try a few thinks:
On a different HDD I have installed Debian 9 with Linuxcnc 2.7,
there it works.
Then I have upgrad LinuxCNC to 2.8,
there it worked also, the alive pin is blinking and the switch on in 1 is toggeling.
So I think it is no issue of Linuxcnc or the version of it,
I think it is an issue with the Debian 10?
Best regards
Marcel
I have now try a few thinks:
On a different HDD I have installed Debian 9 with Linuxcnc 2.7,
there it works.
Then I have upgrad LinuxCNC to 2.8,
there it worked also, the alive pin is blinking and the switch on in 1 is toggeling.
So I think it is no issue of Linuxcnc or the version of it,
I think it is an issue with the Debian 10?
Best regards
Marcel
Please Log in or Create an account to join the conversation.
- MATZE-ATZE-SCH
- Offline
- Senior Member
Less
More
- Posts: 51
- Thank you received: 6
30 Apr 2021 23:05 #207506
by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys
OK, finally I have got it to work!
I have set in the
90-usb-pokeys.rules
the Mode to 666
SUBSYSTEM=="usb", ATTRS{idVendor}=="1dc3", ATTRS{idProduct}=="1001", GROUP="plugdev", MODE="666"
Then, while LinuxCNC is running, I have unpluged and replugged the Pokey, and then it works, even when I replug it or restart the PC...
I have set in the
90-usb-pokeys.rules
the Mode to 666
SUBSYSTEM=="usb", ATTRS{idVendor}=="1dc3", ATTRS{idProduct}=="1001", GROUP="plugdev", MODE="666"
Then, while LinuxCNC is running, I have unpluged and replugged the Pokey, and then it works, even when I replug it or restart the PC...
The following user(s) said Thank You: andypugh, robins, LAUSCH
Please Log in or Create an account to join the conversation.
- mechoil
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 1
13 Jan 2022 21:04 - 13 Jan 2022 21:06 #231707
by mechoil
Replied by mechoil on topic Pokeys ethernet
Finally was able to make it work through ethernet (not tested with real hardware!)
Need to change line in pokeys.comp:
In my case network discovery didn't work, so i've changed this file:
Need to change line in pokeys.comp:
while(dev == NULL)dev = PK_ConnectToDeviceWSerial(12345, 5000); //waits for usb device
to
while(dev == NULL)dev = PK_ConnectToDeviceWSerial_UDP(12345, 5000); //waits for usb device
In my case network discovery didn't work, so i've changed this file:
diff --git a/PoKeysLibCoreSockets.c b/PoKeysLibCoreSockets.c
index 61f68fd..f6561eb 100644
--- a/PoKeysLibCoreSockets.c
+++ b/PoKeysLibCoreSockets.c
@@ -287,7 +287,7 @@ int32_t PK_SearchNetworkDevices(sPoKeysNetworkDeviceSummary * devices, uint32_t
// Send discovery request...
remoteEP.sin_family = AF_INET;
remoteEP.sin_port = htons(20055);
- remoteEP.sin_addr.s_addr = a; // inet_addr("255.255.255.255");
+ remoteEP.sin_addr.s_addr = inet_addr("255.255.255.255");
if (sendto(txSocket, SendBuf, BufLen, 0, (SOCKADDR *)&remoteEP, sizeof(remoteEP)) == -1)
{
Last edit: 13 Jan 2022 21:06 by mechoil. Reason: fix format
The following user(s) said Thank You: LAUSCH
Please Log in or Create an account to join the conversation.
- zarfld
- Offline
- Junior Member
Less
More
- Posts: 34
- Thank you received: 14
31 Mar 2022 15:45 - 31 Mar 2022 15:50 #238915
by zarfld
Replied by zarfld on topic Pokeys ethernet
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
to PEv2
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
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
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
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
Last edit: 31 Mar 2022 15:50 by zarfld. Reason: formating
The following user(s) said Thank You: LAUSCH
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23178
- Thank you received: 4866
31 Mar 2022 15:58 #238919
by andypugh
In that case all that is needed is a HAL pin to set the velocity command and another to feed back the current step counts.
Though reading through the register map, it might be that there is no velocity mode.
Replied by andypugh on topic Pokeys ethernet
A simpler way to do this might be to only support velocity mode from a position PID in the HAL. This is actually currently the preferred way to drive the Mesa stepgens as it better compensates for variations in thread timing.has anyone already tried to use the pulseengine directly?
i assume as a first step i would need to somehow translate the stepgen interface
In that case all that is needed is a HAL pin to set the velocity command and another to feed back the current step counts.
Though reading through the register map, it might be that there is no velocity mode.
The following user(s) said Thank You: zarfld, LAUSCH
Please Log in or Create an account to join the conversation.
Time to create page: 0.108 seconds