Edge time not long enough

More
22 May 2019 05:15 #134548 by Nico2017
Hi all,
I was wondering if anyone had tried to use the edge hal component with a edge.0.out-width-ns parameter more than 3 seconds so more than 3000000000ns.

When I try longer values with setp edge.0.out-width-ns 3000000000, it seems to be still limited to 214783647ns and I am wondering if it is a memory issue of maximum time in ns coded over the hal memory capacity for a s32 or if it is related to a maximum number of thread that this comp can actually last. I obtained this value doing a halcmd show | grep edge and same thing with the halshow. I was actually surprised to find that the duration parameter was a s32 and not a float.

I am trying to do a buzzer which buzz for 3 seconds or more on the rising edge of an event but was surprised to find out that it was limited to a shorter duration. Any idea how to do that if the edge component duration is actually limited.

Thank you for your help,

Nicolas

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

More
22 May 2019 12:07 #134575 by BigJohnT
Replied by BigJohnT on topic Edge time not long enough
It would be easier to do that in classicladder.

The s32 integer has a usable range of -2,147,483,647 to +2,147,483,647.

linuxcnc.org/docs/devel/html/common/glossary.html

JT

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

More
22 May 2019 12:40 - 22 May 2019 12:43 #134577 by PCW
Replied by PCW on topic Edge time not long enough
A possible fix to edge would be to add a "use-ms" parameter that defaults to false
so the default behavior does not change but for longer times you set the "use-ms"
parameter true and specify the time in ms.
(so max time would be 68 years, that ought to be long enough...)
Last edit: 22 May 2019 12:43 by PCW. Reason: clarify

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

More
22 May 2019 15:46 #134586 by Todd Zuercher
The following user(s) said Thank You: Nico2017

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

More
23 May 2019 04:20 #134659 by Nico2017
Replied by Nico2017 on topic Edge time not long enough
Hi all,
thanks for your advice and ideas, oneshot actually does the work too, kind of forgot about it.

Nicolas

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

More
23 May 2019 19:02 #134735 by Todd Zuercher
They both do kind of the same sort of thing, but edge is intended for doing hi precision/fast timing that requires a base-thread, and oneshot is meant for longer duration stuff (like what you're trying to do) that can be processed in the servo-thread.

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

Time to create page: 0.088 seconds
Powered by Kunena Forum