Pokeys

More
08 Dec 2022 11:59 #258888 by rodw
Replied by rodw on topic Pokeys
So a pokeys turned up. I moved the mod we discovered to the .h file but it didn't compile. I left it there and put it in the .c file as well.
It compiled fine and I installed the latest comp file which supports encoders. (P10 one does not.)
I ran up an axis sim and edited the axis_mm.ini file to load a new hal file and added the setp for the serial number in there.
AThis refused to load with a pin not found error.
So in V2.9, you can set a pin in halshow. So I set the serial number in there and the alive pin started to flash so it was a win.
I am going to try setting a time delay for a few seconds off motion.enable and use a mux2 to set the serial number.
I am guessing the user environment is not loaded when we try and set the pin later in the load.
Is there any other ways to set a pin after the iserspace is loaded?
The following user(s) said Thank You: LAUSCH

Please Log in or Create an account to join the conversation.

More
08 Dec 2022 12:20 #258890 by zarfld
Replied by zarfld on topic Pokeys
Hi,

I also Sometimes get these Pin not found Errors, Putting that Code in postgui_call_list helped a Lot top reduce the occurance of this error.

Br
Dominik
The following user(s) said Thank You: LAUSCH

Please Log in or Create an account to join the conversation.

More
08 Dec 2022 16:22 - 08 Dec 2022 16:32 #258895 by rodw
Replied by rodw on topic Pokeys
I tried the post_gui hal file but it didn't help.
Perhaps you could set it in the component
Adding a default value to the pin should do it.
pin in unsigned devSerial = 12345;
Last edit: 08 Dec 2022 16:32 by rodw.
The following user(s) said Thank You: LAUSCH

Please Log in or Create an account to join the conversation.

More
08 Dec 2022 16:38 #258898 by zarfld
Replied by zarfld on topic Pokeys
Yes of course, that should work.
The following user(s) said Thank You: rodw, LAUSCH

Please Log in or Create an account to join the conversation.

More
18 Feb 2023 07:41 #264740 by LAUSCH
Replied by LAUSCH on topic Pokeys
Hi there,

I recently joined the club of Pokeys users as I want to retrofit a smaller lathe machine. First of all: thank you all for the great work, explanations and support within this thread. What you guys are doing is great! (I think there should be a donate button somewhere).

First I would like to start with my setup and how I installed the libraries:
  • Lenovo Think Centre M710q (which I also used for my CNC and which I think are great for that purpose)
  • LinuxCNC 2.8.4 Debian 10 Buster PREEMPT-RT
  • Pokeys 57CNC V2.0
I followed the instructions on Page 10 but using the Pokeyslibcomp and pokeyslib from zarfld instead (github.com/zarfld)
Everything runs without error, I can start LinuxCNC and the alive bit is blinking while the error bit is false. I can see all the Input and Outputs and numerous other features that were implemented. BUT if an input is triggered on the pokeys board there is no reaction within halshow. I can also set an output or relay by using setp and it goes without error within linux but pokeys is not reacting. The setup of the pins was done in advance in the windows software from pokeys.
The only error I am getting now is when starting gmocappy it tells me HAL: ERROR: duplicate component name 'pokeys' which i cannot figure out how to resolve.
Do you have any suggestions?

I performed following steps for installation as described on page 10:
Warning: Spoiler!
 
 

Please Log in or Create an account to join the conversation.

More
18 Feb 2023 16:38 #264760 by zarfld
Replied by zarfld on topic Pokeys
Hi,

i observed that problem also - usually directly after i compiled that component, or at the first attempt to start after reboot.
I assumed that this was caused by the lot of tries and different versions i tested and compiled on my machine. But as it did not occure on the second try, i did not invest a lot of time to investigate about the real reason.


I'm still not sure if this message means that "there is a second Component registered with the same name", or that theres already a component running somewhere in background.


in your "performed following steps for installation" section i saw that you are using "github.com/zarfld/pokeyslib", pleasew don't use that one. This was just a try to workaround some problems that i had at that time, these issues have been reported to Matevz Bosnak (i think he works for PoLabs) and are solved in the meanwhile already.


i think it is better to use the "bitbucket.org/mbosnak/pokeyslib/src/master/" version, even if the differences may not relevant in the moment.

BR
Dominik
The following user(s) said Thank You: LAUSCH

Please Log in or Create an account to join the conversation.

More
18 Feb 2023 17:45 #264762 by LAUSCH
Replied by LAUSCH on topic Pokeys
Hi Dominik,

Thank you for the quick response. 
Is it okay to use your component github.com/zarfld/LinuxCnc_PokeysLibComp after installing the library from mbosnak?
And is halcompile sufficient for your component or do I need to use the pokeyslib.h file from zarfld / LinuxCnc_PokeysLibComp ?
Your component seems to be quite advanced and to implement all the features of the pokeys board which is why I want to use it.
Or is there any other comp-file which I am missing so far?

Cheers

Please Log in or Create an account to join the conversation.

More
18 Feb 2023 18:15 #264763 by zarfld
Replied by zarfld on topic Pokeys
Hi LAUSCH

the LinuxCNC_PokeysLibComp is based on the pokeyslib of MBosnak. This does provide its own pokeyslib.h (i think mine anyway was just a copy of it).

just to prevent further confusion i now removed my branch of pokeyslib which is obsolete anyway.

BR
Dominik
The following user(s) said Thank You: LAUSCH

Please Log in or Create an account to join the conversation.

More
18 Feb 2023 19:51 #264769 by LAUSCH
Replied by LAUSCH on topic Pokeys
Hi Dominik,

Thanks for the clarification. When I use your simple comp file from  page 14  it works and I can see the Inputs when 5V is applied on the board.
When I use the comp file from  github.com/zarfld/LinuxCnc_PokeysLibComp , which is much more complex I get the blinking alive bit, no error and see all the features of the board but when 5V is applied to the inputs there is nothing happening.
When I had a look to the comp file I found that two lines related to Input and Output are commented. When uncommenting them and re-compiling the inputs are working...
Is this comp file still a working copy or should it work as it is?
line 343: //pin out bit Pins.#.DigitalValueGet [55];
line 347: //pin in bit Pins.#.DigitalValueSet [55];

Please apologize for my lack in understanding. I still try to understand how the pokeys stuff is working. Up to now I only worked with linuxcnc ethercat which is also quite nice once established though much more expensive. 

Cheers
 

Please Log in or Create an account to join the conversation.

More
18 Feb 2023 20:37 #264772 by zarfld
Replied by zarfld on topic Pokeys
Hi,

no need to apologize. 

on these Channels i just changed the naming.

they are now named like

pokeys.[DevID].digin.[PinID].in bit State of the hardware input
pokeys.[DevID].digin.[PinID].in-not bit Inverted state of the input.

or 

pokeys.[DevID].digout.[PinID].out

if you just comment the these two lines then only the pins are being created

pokeys.[DevID].Pins.[PinID].DigitalValueGet
pokeys.[DevID].Pins.[PinID].DigitalValueSet

but the bit digitalIn or digital out are not read. (you would need to uncomment the lines 2319 and 2325 to get the digitalinputs updated)

if (DigitalIOGet = true) { if (dev->Pins.DigitalValueGet == 0) { //Pins_DigitalValueGet(i)=false; digin_in(i) = false; digin_in_not(i) = true; } else { //Pins_DigitalValueGet(i)=true; digin_in(i) = true; digin_in_not(i) = false; } }

but i would suggest just to use the newly named digital inputs in your HAL-File


(as the COMP was growing and complexity increased i tried to follow linuxcnc.org/docs/2.6/html/hal/canonical..._id_sec_canondigin_a , and hope my interpretation was right so far)

BR
Dominik

Please Log in or Create an account to join the conversation.

Time to create page: 0.180 seconds
Powered by Kunena Forum