Pokeys_homecomp EncoderSearch / Encoder Arm Topic: Pos_Fb Following errors

More
4 years 2 months ago #249382 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys
Hello zarfld,

Okay, will give it a try.
What is The Pin Name?
Instead of „pokeys.0.in-XX“
„pokeys.0.Counter-XX“? So of i define in the pokeys Software pin 37 as A1 and pin 38 as B1,
I asume in linux i need to use „pokeys.0.Counter-01“?

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 #249383 by zarfld
Replied by zarfld on topic Pokeys - Encoders
.. i just found - my mistake - i was talking about counters not encoders ...

but the issue is quite similar, besides the fact that on pins the inputs for Channel A&B are parametrized.

pokeys provide 25 nomal encoders + 3 FastEncoders. There is also one ultrafast-encoder (but i'm not sure if one of the normal encoder-channels get nominated as ultrafast, or if we can access this value on a seperate channel).

there is also a possibility to nominate one of these encoders as MPGJogEncoder in PulseEngine. Anyway i assume there will be some interferences between PulseEngineV2 and LinuxCnc, as i did not test it yet i cannot say if this can be used properly on a LinuxCnc-mill.


for normal encoders my implementations uses the following:


// pin names
Code:
pin out s32 encoder.#.count[29]; pin out float encoder.#.position[29]; pin out float encoder.#.velocity[29]; pin in bit encoder.#.reset[29]; pin in bit encoder.#.index-enable[29]; param rw float encoder.#.scale[29]  "The scale factor used to convert counts to position units. It is in “counts per position unit”"; ...             if (dev->info.iBasicEncoderCount)             { // read encodervalues                 if (PK_EncoderValuesGet(dev) == PK_OK)                 {                     EncoderValuesGet = true; //map values to pins                     for (i = 0; i < dev->info.iBasicEncoderCount; i++)                     {                         encoder_count(i)=dev->Encoders[i].encoderValue;                     }                     if (dev->info.iUltraFastEncoders)                     {                         for (i = dev->info.iBasicEncoderCount; i < (dev->info.iBasicEncoderCount + dev->info.iUltraFastEncoders); i++)                         {                             encoder_count(i) = dev->Encoders[i].encoderValue;                         }                     }                     /*if (dev->info.iFastEncoders)                     {                         for (i = dev->info.iBasicEncoderCount+ dev->info.iUltraFastEncoders; i < (dev->info.iBasicEncoderCount + dev->info.iUltraFastEncoders + dev->info.iFastEncoders ); i++)                         {                             encoder_value(i) = dev->Encoders[i].encoderValue;                         }                     }*/                 }             }  [/i][/i][/i]
Last edit: 4 years 2 months ago by zarfld.

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

More
4 years 2 months ago #249387 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys - Encoders
Have you allready tried it with this code?
This code i paste in the Code from Andy in the first page, or?

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

More
4 years 2 months ago - 4 years 2 months ago #249389 by zarfld
Replied by zarfld on topic Pokeys - Encoders
i have not connected my encoders yet so it is not tested/confirmad to run

in my case it compiles and seems running in my pokeys.comp you can fin it there:
github.com/zarfld/LinuxCnc_PokeysLibComp

the usage used here can also be found in the pokeys examples, just need to be translated to match HAL

in my comments above i just reduced to the parts relevant for Encoders seperated by "..."
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 #249390 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys - Encoders
Ok, thank you!
Just 4 hours at work, then i can try it out :D

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

More
4 years 2 months ago #249410 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys - Encoders
Have tried to compile the pokeys.comp, without error.
but when i start linuxcnc, i get some error:

Warning: Spoiler!


Any sugestions?

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

Time to create page: 0.147 seconds
Powered by Kunena Forum