I need to do a couple of things. For one the AC Servo makes a lot of electrical noise. The frame of the motor is connected to earth through power line ground. But my bench setup has the control side 5V not isolated from the 'PC' side (optos are kind of useless here) and although the Pi4 doesn't appear to have any trouble the scope shows a pretty noisy encoder signal.
===================== HAL code =================== Second is some of the HAL parameters and reducing to 0.003 makes the display more stable. # Use ACTUAL spindle velocity from spindle encoder # spindle-velocity bounces around so we filter it with lowpass # spindle-velocity is signed so we use absolute component to remove sign # ACTUAL velocity is in RPS not RPM so we scale it. setp scale.spindle.gain 60 setp lowpass.spindle.gain 0.003 net spindle-vel-fb-rps => scale.spindle.in net spindle-fb-rpm scale.spindle.out => abs.spindle.in net spindle-fb-rpm-abs abs.spindle.out => lowpass.spindle.in net spindle-fb-rpm-abs-filtered lowpass.spindle.out ===================== end HAL code =================== But I'm still using the original signal for at speed and the LED never comes on nor does it know it's at speed. I should probably be filtering the RPS rather than RPM I think? ===================== HAL code =================== net spindle-vel-fb-rps => spindle-near-speed.in1 net spindle-ramped => spindle-near-speed.in2 # ---Setup spindle at speed signals--- # the output from spindle-near-speed 'near' component is sent to spindle.0.at-speed # and when this is true motion will start. The LED in the pyvcp-panel.xml is renamed to be a LED. net spindle-near-speed-led <= spindle-near-speed.out => spindle.0.at-speed ===================== end HAL code =================== John > -----Original Message----- > From: andy pugh [mailto:bodge...@gmail.com] > Sent: June-19-21 2:48 AM > To: Enhanced Machine Controller (EMC) > Subject: Re: [Emc-users] Machining question > > On Sat, 19 Jun 2021 at 07:11, John Dammeyer <jo...@autoartisans.com> wrote: > > > > I'm finding the AXIS Spindle speed oscillates about +/- 5 RPM. I thought > > that I was filtering it. > > It generally needs to be filtered, but it is possible you are > filtering it, but not enough to get a steady reading. > > For whatever reason encoder velocity does always seem to be a bit > noisy, despite the counters using timetamped edges and all the other > tricks that might help. > > -- > 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, 1912 > > > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users