Re: [Emc-users] Edge detection in HAL

2016-04-24 Thread Rene Hopf
This component does exactly what you need.

http://linuxcnc.org/docs/html/man/man9/toggle2nist.9.html

Rene

> On 25 Apr 2016, at 03:22, sam sokolik  wrote:
> 
> Anything halui isn't realtime.  So it may be that you need a longer than 
> expect pulse to have halui 'see' it.
> 
> sam
> 
> On 04/24/2016 07:51 PM, Danny Miller wrote:
>> So I tried it and initially gave a very small number for the pulse
>> width, since it just issues a halui.program.run.
>> 
>> It didn't work.  I looked on halscope- input button and pulse were
>> correct, halui.program.run was pulsed.  But halui.program.is-running
>> remained low.
>> 
>> I ended up getting it to work by increasing the pulse width WAY up, to
>> like 10ms or 100ms.  If it goes on too long there's a danger it'll also
>> register inside the next mode.  e.g. a single press while running causes
>> a pause and since it's still registering as pressed, it could cause a
>> resume.
>> 
>> But the numbers did work.  It's working super-nice now.
>> 
>> I'm confused why halui.program.run needs a significant width.  I figured
>> it would register the command any time the command was asserted.
>> 
>> Danny
>> 
>> 
>> On 4/24/2016 2:07 AM, Philipp Burch wrote:
>>> Hi Danny!
>>> 
>>> On 24.04.2016 08:37, Danny Miller wrote:
 [...]
 
 So I need like an edge detector that provides only a pulse for one cycle
 when the button is pressed.  That seems simple enough, but I don't see
 any HAL construct which supports it.
 
 [...]
>>> There is an "edge" component, which should do just what you need:
>>> http://linuxcnc.org/docs/2.6/html/man/man9/edge.9.html
>>> 
>>> Bye,
>>> Philipp
>>> 
>>> 
>>> 
>>> --
>>> Find and fix application performance issues faster with Applications Manager
>>> Applications Manager provides deep performance insights into multiple tiers 
>>> of
>>> your business applications. It resolves application problems quickly and
>>> reduces your MTTR. Get your free trial!
>>> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>>> 
>>> 
>>> ___
>>> Emc-users mailing list
>>> Emc-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/emc-users
>> --
>> Find and fix application performance issues faster with Applications Manager
>> Applications Manager provides deep performance insights into multiple tiers 
>> of
>> your business applications. It resolves application problems quickly and
>> reduces your MTTR. Get your free trial!
>> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>> ___
>> Emc-users mailing list
>> Emc-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-users
>> 
> 
> 
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] _camon.ngc

2016-04-24 Thread Gene Heskett
Greetings;

Finally getting around to analyzing the camview stuffs to figure out, 
since there's zero docs from the .ru sites file containing any tutorial 
on how to use it, it appears that the cameras offsets from the camera 
view to the spindles centerpoint are to be contained in the #5211(X) and 
#5212(Y) variables, and used by _camon.ngc and _camoff.ngc, which I 
believe are the utils that move the machine such that in one "on" 
condition the machne (and the camera) are moved so that the camera is 
looking at where the tool is when on the "off" move state.  I can think 
of 2 ways to do this once the offsets have been determined.  I did that 
once, but of course have miss-placed my notes so once I know what I'm 
doing, I'll measure the offsets again.

Both ways are in the RS274_STARTUP_CODE sections of the main.ini file.
1:
G92,2   # make sure nothing is in effect
G92.1   # clear the whole G92 table
#5211=offset_for_x
#5212=offset_for_y

2:
G92.2   # make sure nothing is in effect
G92.1   # clear any trash in the table
G92 X offset_for_x Y offset_for_y

Which is the preferred method?, or did I leave something out?

Once the linuxcnc.vars file is set & saved, can I just use G92.2 to 
normalize, and G92.3 to bounce in and out of the offsets?

Then, as long as the rest of the code I run does not have a "G92 axes" or 
a G92.1 to clear that table, it sounds like I could set that with a text 
editor once and forget it, not worrying about the above 
RS274_STARTUP_CODE having to re-init it everytime LCNC is run.

Am I even making sense here?

Thanks everybody.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Semi OT: Heidenhain incremental encoders

2016-04-24 Thread Leonardo Marsaglia
2016-04-24 23:06 GMT-03:00 Ken Strauss :

> Note that if you Google for the model number there are a number of people
> selling them. Is it possible that it is not a standard Heidenhain product
> but a special for an OEM who went bankrupt or cancelled the project and
> they
> are now being dumped?
>

Yes indeed, nothing appears. The person selling them says in the
description that they are two channel encoders. I asked him if this means
they only have A and B pulses, or if this means A, B and Z but with
differential outputs. He answered they are A, B and Z but I have no answer
about if they are differential (I asked him again about that and I'm still
waiting). Judging by the number of pins available on the connector is more
than likely that they are differential but I'm not sure off course.


-- 
*Leonardo Marsaglia*.
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Semi OT: Heidenhain incremental encoders

2016-04-24 Thread Ken Strauss
Note that if you Google for the model number there are a number of people
selling them. Is it possible that it is not a standard Heidenhain product
but a special for an OEM who went bankrupt or cancelled the project and they
are now being dumped?

> -Original Message-
> From: Leonardo Marsaglia [mailto:leonardomarsagli...@gmail.com]
> Sent: Sunday, April 24, 2016 9:47 PM
> To: Enhanced Machine Controller (EMC)
> Subject: Re: [Emc-users] Semi OT: Heidenhain incremental encoders
>
> 2016-04-23 19:14 GMT-03:00 andy pugh :
>
> > The description says that they are normal TTL output, and that he has
> > the pinout available.
> >
>
> Since I can't find any documentation I'm gonna ask him for the pinout so I
can
> decide. It's weird anyway that I can't find anything from heidenhain
directly.
>
>
> --
> *Leonardo Marsaglia*.
>

--
> Find and fix application performance issues faster with Applications
Manager
> Applications Manager provides deep performance insights into multiple
tiers
> of your business applications. It resolves application problems quickly
and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users



--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Semi OT: Heidenhain incremental encoders

2016-04-24 Thread Leonardo Marsaglia
2016-04-23 19:14 GMT-03:00 andy pugh :

> The description says that they are normal TTL output, and that he has
> the pinout available.
>

Since I can't find any documentation I'm gonna ask him for the pinout so I
can decide. It's weird anyway that I can't find anything from heidenhain
directly.


-- 
*Leonardo Marsaglia*.
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Edge detection in HAL

2016-04-24 Thread sam sokolik
Anything halui isn't realtime.  So it may be that you need a longer than 
expect pulse to have halui 'see' it.

sam

On 04/24/2016 07:51 PM, Danny Miller wrote:
> So I tried it and initially gave a very small number for the pulse
> width, since it just issues a halui.program.run.
>
> It didn't work.  I looked on halscope- input button and pulse were
> correct, halui.program.run was pulsed.  But halui.program.is-running
> remained low.
>
> I ended up getting it to work by increasing the pulse width WAY up, to
> like 10ms or 100ms.  If it goes on too long there's a danger it'll also
> register inside the next mode.  e.g. a single press while running causes
> a pause and since it's still registering as pressed, it could cause a
> resume.
>
> But the numbers did work.  It's working super-nice now.
>
> I'm confused why halui.program.run needs a significant width.  I figured
> it would register the command any time the command was asserted.
>
> Danny
>
>
> On 4/24/2016 2:07 AM, Philipp Burch wrote:
>> Hi Danny!
>>
>> On 24.04.2016 08:37, Danny Miller wrote:
>>> [...]
>>>
>>> So I need like an edge detector that provides only a pulse for one cycle
>>> when the button is pressed.  That seems simple enough, but I don't see
>>> any HAL construct which supports it.
>>>
>>> [...]
>> There is an "edge" component, which should do just what you need:
>> http://linuxcnc.org/docs/2.6/html/man/man9/edge.9.html
>>
>> Bye,
>> Philipp
>>
>>
>>
>> --
>> Find and fix application performance issues faster with Applications Manager
>> Applications Manager provides deep performance insights into multiple tiers 
>> of
>> your business applications. It resolves application problems quickly and
>> reduces your MTTR. Get your free trial!
>> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>>
>>
>> ___
>> Emc-users mailing list
>> Emc-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-users
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Edge detection in HAL

2016-04-24 Thread Danny Miller
So I tried it and initially gave a very small number for the pulse 
width, since it just issues a halui.program.run.

It didn't work.  I looked on halscope- input button and pulse were 
correct, halui.program.run was pulsed.  But halui.program.is-running 
remained low.

I ended up getting it to work by increasing the pulse width WAY up, to 
like 10ms or 100ms.  If it goes on too long there's a danger it'll also 
register inside the next mode.  e.g. a single press while running causes 
a pause and since it's still registering as pressed, it could cause a 
resume.

But the numbers did work.  It's working super-nice now.

I'm confused why halui.program.run needs a significant width.  I figured 
it would register the command any time the command was asserted.

Danny


On 4/24/2016 2:07 AM, Philipp Burch wrote:
> Hi Danny!
>
> On 24.04.2016 08:37, Danny Miller wrote:
>> [...]
>>
>> So I need like an edge detector that provides only a pulse for one cycle
>> when the button is pressed.  That seems simple enough, but I don't see
>> any HAL construct which supports it.
>>
>> [...]
> There is an "edge" component, which should do just what you need:
> http://linuxcnc.org/docs/2.6/html/man/man9/edge.9.html
>
> Bye,
> Philipp
>
>
>
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread andy pugh
On 24 April 2016 at 23:53, Jon Elson  wrote:
> Well, you can always go into the XML file and edit it.

Absolutely, and I have.
It's something I should have thought to try weeks ago, to be honest.

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread Jon Elson
On 04/24/2016 02:16 PM, John Thornton wrote:
> So it is a Glade bug and that does not surprise me a bit.
>
> 0.1499
>
> So Glade is doing some kind of floating point conversion of the text for
> some strange reason...
>
>
Well, you can always go into the XML file and edit it.  It 
won't change until the next time you open it in Glade and 
save it.

Jon

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Edge detection in HAL

2016-04-24 Thread andy pugh
On 24 April 2016 at 18:53, Danny Miller  wrote:
> I don't see any HAL component for this.  What's it take for me to write
> a new HAL component?  What language are those in?

The code is C, but there is a pre-precessor that works on files in a
specific format to do most of the work.
http://linuxcnc.org/docs/2.7/html/hal/comp.html

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread andy pugh
On 24 April 2016 at 20:18, Philipp Burch  wrote:
> if you consider the implementation, then no. When you enter the value
> (in text form), then it is converted to a floating point number and
> stored that way. Why? Because that is how the Spinbox operates
> internally.


The number in question is actually entered in the adjustment data for
the spinbox, in the Glade editor, not in the spinbox itself.

However, what you are describing is clearly what is happening. It
means that sometimes if you click a spinbox back to zero you don't get
zero, you get a very small number in exponential notation.
If that number gets set as a parameter to G-code then you get a very
strange error message.

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread Philipp Burch
Hi,

On 24.04.2016 15:50, andy pugh wrote:
> On 24 April 2016 at 13:47, Philipp Burch  wrote:
>> It's not actually strange, that's just the behaviour of floating point
>> numbers.
> 
> Well, yes and no.
> 
> My entry in the Glade UI is an a textual form. The version that
> appears in the .ui file is also in a textual form.
> I think it is reasonable to expect the two to match.
> 

if you consider the implementation, then no. When you enter the value
(in text form), then it is converted to a floating point number and
stored that way. Why? Because that is how the Spinbox operates
internally. It does not care about text, it only cares about numbers.
When you save the UI file, this number happens to be converted into a
string again because it is a textual file format (XML), but this text
does have nothing to do with what you entered originally. If Glade would
support a binary output format, then there would most likely not be a
textual representation of this number at all.

> This behaviour appears to lead to a problem where zero is not exactly
> represented in the output from the spinbox, despite the value in the
> spinbox being displayed as zero.
> (and FP certainly can represent zero exactly)
> 

This problem is not linked to the representation in text form, it is an
inherent problem of FP calculations:

>>> x=.15+.15+.15-.45
>>> x
-5.551115123125783e-17

The spinbox displays this as zero only because it is rounding. This is a
bit counterintuitive, it is usually a bad idea to round during
calculations. In this case, it might actually improve the result if we'd
rounded on the way. I'd still not recommend it, though. In my opinion,
rounding should be the task of whatever entity comes last in the
calculations and is responsible for displaying (NOT storing) the value.
In our case here, that would be the G-Code generator at the end. So,
instead of

>>> print('X' + str(x))
X-5.55111512313e-17

better use

>>> print('X%.6f' % (x,))
X-0.00

The signed zero is not really useful, but this should not make the
interpreter cough.

Cheers,
Philipp



signature.asc
Description: OpenPGP digital signature
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread andy pugh
On 24 April 2016 at 15:54, John Thornton  wrote:
> I just made a small panel and got this.

>  1

Try an increment of 0.15

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Edge detection in HAL

2016-04-24 Thread Danny Miller
It's not a mechanical switch connection.  The XHC pendant has a wireless 
keyboard interface chip inside it.  That is correctly debounced already, 
your PC keyboard does not require a debounce driver installed on the PC 
side to filter keypresses- that's done on the HW side.  It really has to 
be, it's difficult to do a correct debounce after traveling through a 
packet-based wireless interface.  I did put it on HALScope and no matter 
how you press that button, you get a single nice clean press.

BTW, I wanted to say- the "debounce" HAL component does not seem correct 
to me.  It requires a signal to be stable for N cycles before the output 
takes the new value.  That's a undesirable delay, and can fail to 
register quick presses.

Rarely do you want that.  Rather, you designate the actuation level- say 
that's "high".  It responds to that immediately, makes the output high, 
and starts the debounce1 interval.  Within the debounce1 interval, the 
output will remain high regardless of what the input does.

When the debounce1 interval ends, it waits for the input to be low.  
Whether it's already low at the end of the debounce1 interval or has to 
wait for it, when it reads as low, it immediately turns its output low 
but there is a second low-to-high debounce2 interval which may be of a 
different length of time, during which time it ignores changes in the 
input.  At the end of the debounce2 interval, it is reset and waiting 
for the next high level on the input.

If the input is already high at the end of debounce2, that registers as 
a new press.  So it turns the output high and begins debounce1 period.

There are cases where you DO want to ignore short noise pulses. That's 
for noise.  But switch bounce is NOT regular noise.  In general you want 
to respond to switch signals immediately, you just don't want to 
register the spurious off/on/off/on bouncing of a switch as it actuates 
as additional commands.

Some momentary-on switches DO bounce as they're released.  It's 
typically not nearly as long but still you don't want to register it.  
And not all switches are momentary-on.  That is, you could have an NC 
switch with a pullup resistor.  It is normally low and when actuated it 
goes high, which is the same active-high input. However, it will bounce 
very little when the pressed but bounce much longer when released.  So 
the debounce intervals need to be configured independently.

I don't see any HAL component for this.  What's it take for me to write 
a new HAL component?  What language are those in?

Would probably follow the "filter//in group//" organization of 
debounce.  It would need the active level provided as a parameter, and 
the debounceOn/debounceOff as two different parameters.  Or, probably 
makes more sense to have debounceRising/debounceFalling so the whole 
perspective doesn't turn upside down when we change the active level.

Danny

On 4/24/2016 6:08 AM, Gene Heskett wrote:
> On Sunday 24 April 2016 03:49:15 Danny Miller wrote:
>
>> Perfect!  Thanks!
>>
>> Danny
> I would go one step farther in terms of noise proofing it, and put a
> debounce module in front of the edge module, with its debounce set for 2
> or 3 so that a random noise spike would not normally last long enough to
> allow it thru to the edge module.  If its in the servo-thread, and the
> servo-thread is running at the 1 millisecond default, that would still
> only be a 3 millisecond lag, but it might save you some surprises.
>
> Remember also, that in time critical operations, that the order of
> execution IS the order of the addf list section in your hal file(s).
> That can be used in reverse to advantage for certain functions, such as
> filtering an A/B/X encoders quadrature errors by doing a running average
> of the last 4 edges to go by.  This, when applied to the spindle
> encoders output, allows higher Pgain in the spindle PID, stiffening the
> speed vs load considerably on those machines that I have spindle
> encoders in.
>
>> On 4/24/2016 2:07 AM, Philipp Burch wrote:
>>> Hi Danny!
>>>
>>> On 24.04.2016 08:37, Danny Miller wrote:
 [...]

 So I need like an edge detector that provides only a pulse for one
 cycle when the button is pressed.  That seems simple enough, but I
 don't see any HAL construct which supports it.

 [...]
>>> There is an "edge" component, which should do just what you need:
>>> http://linuxcnc.org/docs/2.6/html/man/man9/edge.9.html
>>>
>>> Bye,
>>> Philipp
>>>
>>>
>>>
>>> 
>>> -- Find and fix application performance issues faster with
>>> Applications Manager Applications Manager provides deep performance
>>> insights into multiple tiers of your business applications. It
>>> resolves application problems quickly and reduces your MTTR. Get
>>> your free trial!
>>> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>>>
>>>
>>> ___
>>> 

Re: [Emc-users] Excedrin headache of a near infinite number

2016-04-24 Thread Jon Elson
On 04/24/2016 06:22 AM, John Thornton wrote:
> Wow that is a lot of work Jon... ended up with a nice machine.
>
>
Um, I guess you are referring to my post on my Sheldon 
lathe.  Yes, it took a lot longer than I planned on!  But, I 
got a truly toolroom precision grade machine, and it is awesome.

Jon

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread John Thornton
I just made a small panel and got this.




   
   
 100
 1
 10
   
   
 False
 
   
 True
 True
 adjustment1
   
 
   



On 4/24/2016 8:50 AM, andy pugh wrote:
> On 24 April 2016 at 13:47, Philipp Burch  wrote:
>> It's not actually strange, that's just the behaviour of floating point
>> numbers.
> Well, yes and no.
>
> My entry in the Glade UI is an a textual form. The version that
> appears in the .ui file is also in a textual form.
> I think it is reasonable to expect the two to match.
>
> This behaviour appears to lead to a problem where zero is not exactly
> represented in the output from the spinbox, despite the value in the
> spinbox being displayed as zero.
> (and FP certainly can represent zero exactly)
>


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread John Thornton
That does sound like a problem with Glade, are you using Glade 3.16.1 
(the new one)?

JT

On 4/24/2016 8:50 AM, andy pugh wrote:
> On 24 April 2016 at 13:47, Philipp Burch  wrote:
>> It's not actually strange, that's just the behaviour of floating point
>> numbers.
> Well, yes and no.
>
> My entry in the Glade UI is an a textual form. The version that
> appears in the .ui file is also in a textual form.
> I think it is reasonable to expect the two to match.
>
> This behaviour appears to lead to a problem where zero is not exactly
> represented in the output from the spinbox, despite the value in the
> spinbox being displayed as zero.
> (and FP certainly can represent zero exactly)
>


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread andy pugh
On 24 April 2016 at 13:47, Philipp Burch  wrote:
> It's not actually strange, that's just the behaviour of floating point
> numbers.

Well, yes and no.

My entry in the Glade UI is an a textual form. The version that
appears in the .ui file is also in a textual form.
I think it is reasonable to expect the two to match.

This behaviour appears to lead to a problem where zero is not exactly
represented in the output from the spinbox, despite the value in the
spinbox being displayed as zero.
(and FP certainly can represent zero exactly)

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Question on DM860 stepper drivers

2016-04-24 Thread claude
It's mostly the same firmware on the full range (I use a lot of the DM422).

the protuner utilities work with all model (a bunch of different 
program, one per model)

The autotune (S4 dip switch) only tune current loop (PI), but most of my 
test showed way too aggressive tuning, making this unsuitable.



On 20.04.2016 19:42, Todd Zuercher wrote:
> Gene,
>
> I think he is referring to "Auto Tune" function that is activated by toggling 
> DIP switch #4
> (see the bottom of page 8)
> http://www.americanmotiontech.com/upload/Manuals/DM860m.pdf
>
> No, idea what it does or how. (no experience with these drives.)
>

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread Karl Jacobs
Great, you got the physics almost right, Gene, except you should have 
said hydrogen *nucleus* aka proton. A hydrogen *atom* is way larger than 
this, about 32E-12 meters, although quantum physics means you can't 
really tell. And was it in G21 or G20?
Cheers,
Karl
Am 24.04.2016 um 14:14 schrieb Gene Heskett:
> On Sunday 24 April 2016 08:05:22 John Thornton wrote:
>
>> >what a crazy step increment, where is that at?
>> >
>> >JT
> One could go from ridiculous to sublime and ask which side of a up quark
> from a hydrogen atom is to be adjusted or cut away? Busted math
> someplace for sure.  Probably in python...
>

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread Philipp Burch
Hi Andy!

On 24.04.2016 14:17, andy pugh wrote:
> On 24 April 2016 at 13:05, John Thornton  wrote:
>> what a crazy step increment, where is that at?
> 
> 
> These are what end up in the .ui file even though sensible numbers are
> entered in the Glade editor.
> However, many numbers have come out correctly. It's a bit strange.
> 

It's not actually strange, that's just the behaviour of floating point
numbers. If printed without rounding, such results are not uncommon. You
can try this in a console:

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 0.05+0.1
0.15002

0.15 can't be exactly represented as a binary fraction (just like 1/3
can't be exactly represented in either decimal or binary). Those
artifacts are usually rounded away, though:

>>> str(0.05+0.1)
'0.15'

So it just depends on how the value is printed. That glade stores the
number in full precision is absolutely sensible, but they should not go
out to the interpreter like this, if it can't handle numbers in
exponential format.

Bye,
Philipp



signature.asc
Description: OpenPGP digital signature
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread andy pugh
On 24 April 2016 at 13:05, John Thornton  wrote:
> what a crazy step increment, where is that at?


These are what end up in the .ui file even though sensible numbers are
entered in the Glade editor.
However, many numbers have come out correctly. It's a bit strange.

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread Gene Heskett
On Sunday 24 April 2016 08:05:22 John Thornton wrote:

> what a crazy step increment, where is that at?
>
> JT

One could go from ridiculous to sublime and ask which side of a up quark 
from a hydrogen atom is to be adjusted or cut away? Busted math 
someplace for sure.  Probably in python...

> On 4/24/2016 6:48 AM, andy pugh wrote:
> > On 24 April 2016 at 12:36, andy pugh  wrote:
> >> I think this might be what is making my life difficult too.
> >
> > Yes, this fits with the problem I was talking about here:
> > https://sourceforge.net/p/emc/mailman/message/34998497/
> >
> > And my problem matches the funny bits of the glade file
> >
> >
> >  -90
> >  90
> >  0.20001
> >  10
> >  10
> >
> >
> >
> >  0.14999
> >  3
> >  0.050003
> >  10
> >  10
> >
>
> --
> Find and fix application performance issues faster with
> Applications Manager Applications Manager provides deep performance
> insights into multiple tiers of your business applications. It
> resolves application problems quickly and reduces your MTTR. Get your
> free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread John Thornton
what a crazy step increment, where is that at?

JT

On 4/24/2016 6:48 AM, andy pugh wrote:
> On 24 April 2016 at 12:36, andy pugh  wrote:
>
>> I think this might be what is making my life difficult too.
> Yes, this fits with the problem I was talking about here:
> https://sourceforge.net/p/emc/mailman/message/34998497/
>
> And my problem matches the funny bits of the glade file
>
>
>  -90
>  90
>  0.20001
>  10
>  10
>
>
>
>  0.14999
>  3
>  0.050003
>  10
>  10
>
>
>


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread andy pugh
On 24 April 2016 at 12:36, andy pugh  wrote:

> I think this might be what is making my life difficult too.

Yes, this fits with the problem I was talking about here:
https://sourceforge.net/p/emc/mailman/message/34998497/

And my problem matches the funny bits of the glade file

  
-90
90
0.20001
10
10
  

  
0.14999
3
0.050003
10
10
  


-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread andy pugh
On 24 April 2016 at 11:48, Marius Alksnys  wrote:
> I wanted to report a bug, prepared a glade file, and only when I looked at
> it with text viewer I found:
> 1.000279396772

I think this might be what is making my life difficult too.

This is probably the cause of the rather cryptic "unknown operator
beginning with E" error that can happen if Python tries to send a
command like MDI G1 X 1.234E-15

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Excedrin headache of a near infinite number

2016-04-24 Thread John Thornton
Wow that is a lot of work Jon... ended up with a nice machine.

JT

On 4/23/2016 11:15 PM, Jon Elson wrote:
> On 04/23/2016 10:44 PM, Gene Heskett wrote:
>> On Saturday 23 April 2016 19:49:52 andy pugh wrote:
>>
>>> On 24 April 2016 at 00:28, Gene Heskett  wrote:
 but the number bears minus zero resemblance to what I see in the
 DRO.
>>> That's normal, unless you are displaying machine coordinates.
>> How do I make that the default display?  It wants to display relative
>> until I change it.  Is that something in the gcode preamble I have
>> screwed up?
>>
>>
> I think you can switch between machine and part systems with
> either @ or #.  (I rarely use these, so I have forgotten.)
> You generally never use machine coordinates except when
> setting up limit and home switches.
> You set the relative, or part, coordinates with the
> touch-off button in Axis after measuring/aligning to the
> workpiece.
>
> Jon
>
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] glade (HAL)spinbutton issue or accident?

2016-04-24 Thread Marius Alksnys
I wanted to report a bug, prepared a glade file, and only when I looked 
at it with text viewer I found:

1.000279396772

It was driving me nuts!
I know how to fix this, but don't know how such number appeared here.

You can test the behavior of the spinbutton by running
gladevcp_demo hsb.glade (attached)
then
watch -n 0.2 halcmd show pin

then by using Mouse Wheel scroll up to 8 then down to 7 and less. Note 
the values:


Owner   Type  Dir Value  Name
  1224  float OUT 7  hsb.spb-tool-number-f
  1224  s32   OUT 6  hsb.spb-tool-number-s


I made a workaround - used -f instead of -s until I found this tiny 
extra on the step_increment..


hsb.glade
Description: application/glade
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Edge detection in HAL

2016-04-24 Thread Gene Heskett
On Sunday 24 April 2016 03:49:15 Danny Miller wrote:

> Perfect!  Thanks!
>
> Danny

I would go one step farther in terms of noise proofing it, and put a 
debounce module in front of the edge module, with its debounce set for 2 
or 3 so that a random noise spike would not normally last long enough to 
allow it thru to the edge module.  If its in the servo-thread, and the 
servo-thread is running at the 1 millisecond default, that would still 
only be a 3 millisecond lag, but it might save you some surprises.

Remember also, that in time critical operations, that the order of 
execution IS the order of the addf list section in your hal file(s). 
That can be used in reverse to advantage for certain functions, such as 
filtering an A/B/X encoders quadrature errors by doing a running average 
of the last 4 edges to go by.  This, when applied to the spindle 
encoders output, allows higher Pgain in the spindle PID, stiffening the 
speed vs load considerably on those machines that I have spindle 
encoders in.

> On 4/24/2016 2:07 AM, Philipp Burch wrote:
> > Hi Danny!
> >
> > On 24.04.2016 08:37, Danny Miller wrote:
> >> [...]
> >>
> >> So I need like an edge detector that provides only a pulse for one
> >> cycle when the button is pressed.  That seems simple enough, but I
> >> don't see any HAL construct which supports it.
> >>
> >> [...]
> >
> > There is an "edge" component, which should do just what you need:
> > http://linuxcnc.org/docs/2.6/html/man/man9/edge.9.html
> >
> > Bye,
> > Philipp
> >
> >
> >
> > 
> >-- Find and fix application performance issues faster with
> > Applications Manager Applications Manager provides deep performance
> > insights into multiple tiers of your business applications. It
> > resolves application problems quickly and reduces your MTTR. Get
> > your free trial!
> > https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> >
> >
> > ___
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
>
> --
> Find and fix application performance issues faster with
> Applications Manager Applications Manager provides deep performance
> insights into multiple tiers of your business applications. It
> resolves application problems quickly and reduces your MTTR. Get your
> free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Time estimates

2016-04-24 Thread Danny Miller
Vectric Aspire has one, I know.  It's useless.  It will take much longer 
to 3d carve, but it's anybody's guess how much longer.  More to the 
point, you can't experiment with the effects of tuning acceleration and 
path tolerance- so it's of no help at all for tuning.

Danny

On 4/24/2016 12:41 AM, Dave Cole wrote:
> On 4/23/2016 2:44 PM, Danny Miller wrote:
>> It should not be done in CAM software.  That's just not possible.
> http://support.vectric.com/aspire-questions/item/how-to-get-estimate-of-machining-time
>
> I can't think of a cam system that doesn't have a time estimate function.
> How accurate they are is a different issue.
>
> Dave
>
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Edge detection in HAL

2016-04-24 Thread Danny Miller
Perfect!  Thanks!

Danny

On 4/24/2016 2:07 AM, Philipp Burch wrote:
> Hi Danny!
>
> On 24.04.2016 08:37, Danny Miller wrote:
>> [...]
>>
>> So I need like an edge detector that provides only a pulse for one cycle
>> when the button is pressed.  That seems simple enough, but I don't see
>> any HAL construct which supports it.
>>
>> [...]
> There is an "edge" component, which should do just what you need:
> http://linuxcnc.org/docs/2.6/html/man/man9/edge.9.html
>
> Bye,
> Philipp
>
>
>
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Edge detection in HAL

2016-04-24 Thread Philipp Burch
Hi Danny!

On 24.04.2016 08:37, Danny Miller wrote:
> [...]
> 
> So I need like an edge detector that provides only a pulse for one cycle 
> when the button is pressed.  That seems simple enough, but I don't see 
> any HAL construct which supports it.
> 
> [...]

There is an "edge" component, which should do just what you need:
http://linuxcnc.org/docs/2.6/html/man/man9/edge.9.html

Bye,
Philipp



signature.asc
Description: OpenPGP digital signature
--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] Edge detection in HAL

2016-04-24 Thread Danny Miller
I have the XHC-HB04 MPG, with a combined Run/Pause/Resume button, which 
I find to be a smart layout.  Stop is a different button.

I set this up with, basically:
1.  halui.program.run = button & is_idle
2. halui.program.pause = button & is_running
3.  halui.program.resume = button & is_paused

This gave a stuttering where it started but might end up paused.  I 
thought I had a debouncing problem, but of course not-  the .run command 
happens quickly, then the is_running condition is true, so it issues 
.pause, then it's paused so it issues .resume, all with the same button 
press.  So it's stuck alternating pause/resume/pause/resume for as long 
as the button is pressed. Duh!

I have the same problem with Spindle On/Off.  Unless you try to "ninja" 
the button real super fast, it sets the spindle on-off-on-off-on-off and 
the state it ends up in is random.

So I need like an edge detector that provides only a pulse for one cycle 
when the button is pressed.  That seems simple enough, but I don't see 
any HAL construct which supports it.

I could do this:
http://www.allaboutcircuits.com/textbook/digital/chpt-10/edge-triggered-latches-flip-flops/

By using a Debounce as a delay element, "NOT" to invert the debounce 
output, and AND them together for a leading edge pulse.

That's technically correct, it should work, but I feel there must be a 
more direct solution that I'm missing and coming up with something 
convoluted and ridiculous.   Thoughts?

Danny


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users