Hi,
  Thanks for that, tit's basically the same config as mine except I was using 
named instances, i've just tried doing it the same as below with numbered 
components but it still behaves the same.

Can I ask what platform your running on (BBB or PC)?

Python is a black art to me, but i’ve done some probing with hal meter, and 
it’s the lowpass.0.out pin that is going to nan and then sticking so it looks 
like an issue in the lowpass component - I’ll checkout the source code and have 
a dig around the source code for that as I suspect it’s an platform related 
issue (I’m running on an BBB).

Thanks
  Russell

On 4 Jan 2017, at 09:14, [email protected] wrote:

> For what it is worth, this is a snippet from my configs as to how I do the 
> same on my lathe (the other components are used elsewhere)
> 
> # **** Use ACTUAL spindle velocity from spindle encoder
> # **** spindle-velocity is signed so we use absolute component to remove sign
> # **** ACTUAL velocity is in RPS not RPM so we scale it.
> 
> addf scale.1 servo-thread
> addf scale.2 servo-thread
> addf abs.1 servo-thread
> addf abs.2 servo-thread
> loadrt lowpass count=1
> addf lowpass.0 servo-thread
> setp lowpass.0.gain 0.01
> ##########################################################################################
> # Display spindle speed in pyvcp bar
> ##########################################################################################
> setp scale.1.gain 60.0 #convert velocity per sec into rpm
> net spindle-velocity => lowpass.0.in
> net filtered-spindle-velocity <= lowpass.0.out => abs.1.in
> net absolute-spindle-velocity <= abs.1.out => scale.1.in
> net scaled-spindle-velocity <= scale.1.out  => pyvcp.spindle-speed
> 
> I do not use spindle-at-speed.
> 
> It is an absolute pain unless you have a high mass spindle or an actual 
> physical encoder rather than just an index pulse from a pickup.
> The fudge factor you have to program in to prevent program pauses due to 
> speed fluctuations, makes it irrelevant.
> 
> I just command a 4 second pause after M3, which is enough to get to speed and 
> stabilise on my machine.
> 
> regards
> 
> On 04/01/17 08:48, Russell Gower wrote:
>> Hi Marius,
>>   The examples in the documentation (all be it the upstream documentation, 
>> but I didn’t think we would have diverged much in this area) had it at 0.01 
>> as do all the example configs i’ve found whilst googling - I have also tried 
>> setting it to 1.0 which  had the same out come.
>> 
>> Regards
>>   Russell
>> 
>> On 4 Jan 2017, at 06:31, Marius Alksnys <[email protected]> wrote:
>> 
>>> Isn't your lowpass gain higher than 1 ?
>>> 
>>> 01/03/2017 09:31 PM, Russell Gower rašė:
>>>> Hi,
>>>>  I wonder if someone could help me diagnose an issue I have with trying
>>>> to use a low pass filter to stabilise the pyvcp spindle speed display in
>>>> Axis, I got the idea from
>>>> here http://linuxcnc.org/docs/html/examples/spindle.html
>>>> 
>>>> With the low pass filter in place the speed is displayed for a few
>>>> seconds then goes to “nan” and the following is output on the terminal I
>>>> launched machinekit from
>>>> 
>>>> Exception in Tkinter callback
>>>> Traceback (most recent call last):
>>>>  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1437, in __call__
>>>>    return self.func(*args)
>>>>  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 498, in callit
>>>>    func(*args)
>>>>  File "/usr/lib/python2.7/dist-packages/vcpparse.py", line 154, in updater
>>>>    a.update(pycomp)
>>>>  File "/usr/lib/python2.7/dist-packages/pyvcp_widgets.py", line 1219,
>>>> in update
>>>>    end, self.bh-1)
>>>>  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2205, in coords
>>>>    self.tk.call((self._w, 'coords') + args)))
>>>> ValueError: could not convert string to float: floating
>>>> 
>>>> If I remove the lowpass filter then the speed is displayed fine (apart
>>>> from the jitter).
>>>> 
>>>> My config files can be found here
>>>> https://github.com/russellgower/Lathe-Config.git
>>>> 
>>>> Thanks
>>>>  Russell
>>>> 
>>> -- 
>>> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
>>> https://github.com/machinekit
>>> --- You received this message because you are subscribed to the Google 
>>> Groups "Machinekit" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [email protected].
>>> Visit this group at https://groups.google.com/group/machinekit.
>>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
> https://github.com/machinekit
> --- You received this message because you are subscribed to the Google Groups 
> "Machinekit" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> Visit this group at https://groups.google.com/group/machinekit.
> For more options, visit https://groups.google.com/d/optout.

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to