LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

More
1 year 3 months ago #331685 by epineh
I've been playing with the WLED plugin, got a string of 5 led's working for various things, that is really cool.

I thought I'd try add a blink function to one of them. I see that only the WLED_Expansion allows me to assign an LED from another plugin, but when I try I get the compile error

Procedural assignment to a non register "LED_BLUE" is not permitted.

Any idea what I'm doing wrong

Please Log in to join the conversation.

More
1 year 3 months ago #331758 by Tim Bee
Dear meister:

When I tested the encoder plugin I found that the indicated position seemed to be the number of revolutions. When the encoder rotated one revolution, the position increased by one number. I was sure that my scale configuration was correct because the rpm displayed the correct value. I let the motor run at 100rpm and the encoder plugin displayed about 100rpm. My encoder came from the simulated encoder of the servo motor driver.
 

Attachment not found


 

Please Log in to join the conversation.

More
1 year 3 months ago #331759 by meister
@epineh please add you config

@Tim Bee

you need to use rio.enc0.position, this is the floating point value.

there is no raw value without scale calculation, but if you really need one, i will check to add it

Please Log in to join the conversation.

More
1 year 3 months ago #331761 by Tim Bee
@meister

I'm sorry, i miss the rio.enc0.position pin ^_^

Tim

Please Log in to join the conversation.

More
1 year 3 months ago #331810 by epineh
I've attached the config, this is a basic test setup, axis setups work. With the WLED expansion plugin loaded it will compile/flash/run LinuxCNC no issues, but when I add a Blink plugin, and tie it to the WLED0 blue LED it won't compile.

Cheers.
Russell.

 

Attachment not found

Please Log in to join the conversation.

More
1 year 3 months ago #331811 by meister
ok, found the bug, sorry, is fixed in main and dev

Please Log in to join the conversation.

More
1 year 3 months ago #331837 by epineh
Awesome thank you, I'll update and check that out tonight. 

I don't want to push my luck but would it be possible to have a dual timer plugin? It would be for lube pumps mainly, so generally they turn on when the machine starts, run for 10 seconds then off, and turn on for 10 seconds every 20 minutes after that. 

I guess the blink could be modified for longer frequency but both the on and off time needs to be adjustable.

Cheers.
Russell.

Please Log in to join the conversation.

More
1 year 3 months ago #331849 by meister
i will add a new plugin named 'interval' or so.
then you can configure the on-time and the interval-time via gui/hal

Please Log in to join the conversation.

More
1 year 3 months ago #331850 by meister
in dev branch and untested (only via testbench):

github.com/multigcs/riocore/blob/dev/rio...s/interval/README.md

little config example 10 seconds on / interval 20 minutes default
Code:
        {             "type": "interval",             "pins": {                 "out": {                     "pin": "PIN:69"                 }             },             "uid": "interval0",             "signals": {                 "enable": {                     "display": {                         "title": "Pump-Active",                         "section": "status"                     },                     "net": "halui.machine.is-on"                 },                 "ontime": {                     "display": {                         "title": "Pump-OnTime (s)",                         "initval": 10.0,                         "min": 5.0,                         "max": 20.0,                         "section": "status"                     }                 },                 "interval": {                     "display": {                         "title": "Pump-Interval (s)",                         "initval": 1200.0,                         "min": 600.0,                         "max": 1800.0,                         "section": "status"                     }                 }             }         }

looks like this:
 

Attachment not found



and the onTime can be adjust between 5 and 20 seconds / interval between 600 and 1800 seconds (10 - 30 minutes)

 

Please Log in to join the conversation.

More
1 year 3 months ago #331851 by meister
a little tip on what you can do with the wled's to display the status:
Code:
        {             "type": "wled",             "pins": {                 "data": {                     "pin": "WLED:DATA"                 }             },             "signals": {                 "0_green": {                     "net": "(!halui.mode.is-auto and !axisui.error) or halui.program.is-paused"                 },                 "0_red": {                     "net": "axisui.error"                 },                 "0_blue": {                     "net": "halui.mode.is-auto"                 }             },             "uid": "wled0"         },

 

Please Log in to join the conversation.

Time to create page: 0.460 seconds
Powered by Kunena Forum