Pokeys ethernet

More
01 Jun 2022 14:17 #244373 by zarfld
Replied by zarfld on topic Pokeys ethernet
Hi

axis are finally moving ...
there is both PositionMode and VelocityMode...

i can get pos-fb based on "CurrentPosition" (divided by [JOINT*] STEPSCALE)
DemandValues for both modes share the same variable "ReferencePositionSpeed"

so first i was using Position-Mode which worked quite well, but without of adjustement of velocity

then i also changed to velocity mode - where i first thought i would need additional encoders to provide velocityfeedback for each axis.
but havinf vel-cmd and pos-fb signals active this seems fine also - besides a small deviation in pos-fb<->pos-cmd in 4th decimal.

so in the end i tried to switch to position-mode for the last move to ensure that the pos-fb is exact to pos-fb. but then the move was not fluent anymore.

so i removed that. I think the PID that you mentioned would also need vel-fb from encoders, right?

i tried to ensure a constant loopfrequency by counting the number of loops done every second (using realtime-clock signals of pokeys), and based on that adjusting the duration used in usleep(sleepduration). i found that "Device load status" on pokeys device kept the lowest if we keep around 10Hz, and the maximum frequency which seemed somehow stable was around 40Hz.

 

->kbd48CNC observed some latency issues if it is connected using Pokeys57E and PoNet-extensionBoard. This does ius not observed if on Pokeys57CNC (and CAN-operation enabled)
Attachments:

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

More
02 Jun 2022 07:45 #244427 by andypugh
Replied by andypugh on topic Pokeys ethernet
I am not going to try to use the editor on a phone…

No, I don’t think you need encoders. You can use steps-actually-made back from the hardware as feedback.
The following user(s) said Thank You: zarfld

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

More
08 Aug 2022 20:24 #249369 by MATZE-ATZE-SCH
Replied by MATZE-ATZE-SCH on topic Pokeys
Hello,

I have now on the Pokeys 2 Potis for Spindel Override and Feed Override.
I want to change the potis to rotary encoders with push button,
to set the value to 100% with the push  button.
Have tried to connect the rotary switch to the Pokeys, but the update rate with 15Hz seems to slow to correctly
use a rotary switch with 20 impuls/rev.
If I turn the switch slow, it works fine, but at faster speed it get stock.
Is there a solution for this, to increase the update rate at 4 IOs of the Pokeys?
Have tried with the Pokeys Software to set the Inputs to Encoders, under Windows it works, but Linux seems to Ignore all settings.
In the 5th post in this Topic, the user "fixer" wrote:

yes, digital IO, HW encoder counters and analog inputs are supported in HAL component from first post. The board can also decode matrix keyboard and PWM outputs. It can also emulate USB HID keyboard and joystick buttons and pots.

Maybe I just dont need to use
"pokeys.0.in-XX" but another thing?

The Hardware I use is a  5i20, 7i37 and 7i33

Best regards
Marcel

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

More
09 Aug 2022 06:15 - 09 Aug 2022 08:44 #249380 by zarfld
Replied by zarfld on topic Pokeys - Counters
Hello Marcel,

you are right "pokeys.0.in-XX" will just provide a bit (true/false 0/1), for parametrized counters a different pin needs to be created which provides the counter-value already counted by pokeys. Otherwise you will be restricted to loopfrequency of your HAL-component.

in the component i have implemented it as shown below - but not tested yet (anyway MPG-CounterWheel and rotary encoders for axis are waiting for installation on my mill).

 
// pin name
pin out unsigned counter.#.value[55];

...

// read values
            if (dev->info.iDigitalCounters > 0)
            {
                if (PK_DigitalCounterGet(dev) == PK_OK)
                {
                    DigitalCounterGet = true;
                    loopPins = true;
                }
            }

// map values to pin
            for(i=0;i<info_PinCount-1;i++)
            {
...
                    if(dev->Pins[i].DigitalCounterAvailable)
                    {
                        counter_value(i) = dev->Pins[i].DigitalCounterValue;
                        //Pins_CounterOptions(i) = dev->Pins[i].CounterOptions;
                    }
...[/i][/i][/i]
            [i][i][i]}



i would be glad if you could give it a try, as during vacation i have no acces to my mill to check it by myself.[/i][/i][/i]
Last edit: 09 Aug 2022 08:44 by zarfld.
The following user(s) said Thank You: MATZE-ATZE-SCH

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

More
09 Aug 2022 08:35 #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
09 Aug 2022 08:40 - 09 Aug 2022 08:47 #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
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: 09 Aug 2022 08:47 by zarfld.

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

More
09 Aug 2022 10:48 #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
09 Aug 2022 10:55 - 09 Aug 2022 10:57 #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: 09 Aug 2022 10:57 by zarfld.
The following user(s) said Thank You: MATZE-ATZE-SCH

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

More
09 Aug 2022 11:32 #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
09 Aug 2022 16:32 #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.127 seconds
Powered by Kunena Forum