Pokeys

More
09 Aug 2022 16:47 - 09 Aug 2022 17:17 #249412 by zarfld
Replied by zarfld on topic Pokeys - Encoders
Based on the message it seems to me that theres to less memory. But as in my system IT euns on an Raspberry Pi 4 (4gb) i cannot qite believe that. (Maybe there IS a way to Reserve more memory for Realtime Part)

Anyway i think the way to go is to reduce Code, especially removing Pins which are Not needed. I might have some time later today to Check thar
Last edit: 09 Aug 2022 17:17 by zarfld.

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

More
09 Aug 2022 17:09 #249414 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys - Encoders
I dont think it can be too less memory, too, I use a normal PC with 8GB RAM...
If you could check this would be nice. The pokeys.comp I use is the file that Andy posted on page 10.
I don´t understand very much of this code, but maybe you can copy/paste the needet things in the .comp file from andy?

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

More
09 Aug 2022 19:25 - 10 Aug 2022 19:28 #249420 by zarfld
Replied by zarfld on topic Pokeys - Encoders
Hi,

i did a quick merge with my implementation - could you please give it a try? 
pins are named like "pokeys.0.encoder.1.count" 

BR
Dominik 


****Edit****
removed attachment as it does not seem to work as expected

- with added debugging-pin "deb"
0 ... connect fails (check if 'devSerial' matches to your device)
3 ... PK_DigitalIOGet(dev) fails
5 ... PK_AnalogIOGet(dev) fails
12 ... PK_EncoderValuesGet(dev) fails
other values indicate last executed action 
Last edit: 10 Aug 2022 19:28 by zarfld.

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

More
09 Aug 2022 19:53 - 09 Aug 2022 20:27 #249426 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys - Encoders
Hello Dominik,

the compiling had worked without error.
Also in Linuxcnc in Halshow I see the new Pins.
But the "alive" pin is not on, I dont get the signals from the input through linuxcnc...
Also the "error" pin is on...

Best regards and thanks for your help,
Marcel
Last edit: 09 Aug 2022 20:27 by MATZE-ATZE-SCH.

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

More
10 Aug 2022 13:01 #249449 by zarfld
Replied by zarfld on topic Pokeys - Encoders
please note updated COMP file in my previous code
The following user(s) said Thank You: MATZE-ATZE-SCH

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

More
10 Aug 2022 13:12 #249450 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys - Encoders
Thank you, i will give it a try after work

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

More
10 Aug 2022 16:49 #249456 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys - Encoders
Hello Dominik,

have try it out, but without sucess...
Compiling without errors,
the pins are visible in halshow.
but the .alive isn´t blinking.
Also the .err is not on.
in the .deb is a 0.

Best regards
Marcel

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

More
10 Aug 2022 17:45 #249464 by zarfld
Replied by zarfld on topic Pokeys - Encoders
so it seems that there is an problem to connect

thats the sequence of code:
        deb=0;
        while(dev == NULL)dev = PK_ConnectToDeviceWSerial(devSerial, 2000);  //waits for usb device
    
    
        alive=1; 
        deb=1;
        err=0;

theres not much between setting deb 0 an 1. And as this section is still similar to the one found at page 10, we should get it to work with some simple checks.

- the command used expects the pokeys connected via USB
- the other thing is to check the value of "devSerial" (which is kind of the address to ensure that the right device is connected)- this should match the serialnumber of your pokeys device (you may set it in HALConfiguration and/or HAL-File using "setp pokeys.0.devSerial [pokeys serial]")
- it hink you already checked if it's powered on
- besides that you might doublecheck instructions in forum.linuxcnc.org/24-hal-components/298...rnet?start=90#162953

BR
Dominik
 

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

More
10 Aug 2022 18:24 #249467 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys - Encoders
Hey Dominik,

-Pokey is connected via USB, yes
-dev-Serial is correct, set in hal with setp pokeys.0.devSerial 12345
-power is on, the red and green light are on on pokeys.
-done all the steps again...

If I compile the pokeys.comp from page 10, everything runs as it should, beside of the potis.
the alive is blinking, the err pin is off.

Then I close Linuxcnc and compile your pokeys.comp.
no error, see the pins in Linuxcnc, but no alive and deb = 0

If then I close Linuxcnc, compile the pokeys.comp from page 10, and start linuxcnc, everythink works just fine...

I don´t know what to do... :/

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

More
10 Aug 2022 19:26 - 10 Aug 2022 19:27 #249471 by zarfld
Replied by zarfld on topic Pokeys - Encoders
Hi,
yes trying the original file of page10 is a good idea - to ensure that the system is basically working.

anyway i managed to access my system remotely and tried to reproduce the problem - on my raspberry having a dummy config it seems to work - but as the deb=13 it seems that it is periodically disconnecting
 
i can hradly see the alive-flag flashing on "HAL Konfiguration" page - i assume because of display latency due to remote connectionbut in HAL-Osziliskope you can see the values changing. 

So i reverted that part of DigitalIO and AnalogIO to be similar as on page10 compiled and - this time - tested if the code runs
(anyway still no encoders connected as i'm not there)
 

File Attachment:

File Name: pokeys_202...0-2.comp
File Size:2 KB

 

hope that's similar on your system




 
Attachments:
Last edit: 10 Aug 2022 19:27 by zarfld.
The following user(s) said Thank You: MATZE-ATZE-SCH

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

Time to create page: 0.180 seconds
Powered by Kunena Forum