Pokeys_homecomp EncoderSearch / Encoder Arm Topic: Pos_Fb Following errors

More
4 years 2 months ago #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
4 years 2 months ago #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:
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
4 years 2 months ago #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
4 years 2 months ago - 4 years 2 months ago #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:1.75 KB

 

hope that's similar on your system




 
Last edit: 4 years 2 months ago by zarfld.
The following user(s) said Thank You: MATZE-ATZE-SCH

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

More
4 years 2 months ago #249472 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys
It seems to work!!! image missing /media/kunena/emoticons/laughing.png
The . alive is blinking,
.in-1 works also, the .deb is counting up and restarts every time...
.ain-0 with a poti works also...
and the counter works!!!
 

Big thank to you, Dominik!
Friday I set up a second encoder, I will tell you if all works!

Best regards
Marcel

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

More
4 years 2 months ago - 4 years 2 months ago #249476 by zarfld
Replied by zarfld on topic Pokeys
Hi Matze,

I'm glad to hear that.

do you think we might need to extend that as described in chapter "4.5 Encoder" of www.linuxcnc.org/docs/2.2/HAL_User_Manual.pdf ?

calculating "postion" using parameter "scale" should be a short one.

i can imagine that at some point "reset" might be needed, there is a PK_EncoderValuesSet() which we could use to reset the counter to 0 on pokeys for that task.

for "index-enable" i think it will be not that easy to get the next-pulse directly, maybe i just use the next loop when "counter"-value changed. (as a workaround)

for velocity we would also need to get timers involved which might get a bit complicated, but nut sure if it will be needed at this time.

(i anyway planned to do that on my pokeys.comp on github)

BR
dominik

****** edit ***********
 
 

File Attachment:

File Name: pokeys_202...-11.comp
File Size:2.55 KB

(please note: when doing reset with current pokeyslib it's not yet possible to write/reset single encoder values to device - so i might expect issues depending if some encoders moved between ReadEncoders&WriteEncoders)
 
Last edit: 4 years 2 months ago by zarfld.

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

Time to create page: 0.069 seconds
Powered by Kunena Forum