On Friday 10 July 2020 01:13:12 Peter C. Wallace wrote:

> On Thu, 9 Jul 2020, John Dammeyer wrote:
> > Date: Thu, 9 Jul 2020 22:02:31 -0700
> > From: John Dammeyer <jo...@autoartisans.com>
> > Reply-To: "Enhanced Machine Controller (EMC)"
> >     <emc-users@lists.sourceforge.net>
> > To: "'Enhanced Machine Controller (EMC)'"
> > <emc-users@lists.sourceforge.net> Subject: [Emc-users] Spindle
> > acceleration/decelleration
> >
> > My ini file these parameters.
> >
> > MAX_VELOCITY = 50.0
> > MAX_ACCELERATION = 300.0
> >
> > Setting MAX_ACCEL to 30 doesn't change the rate of change from 3000
> > RPM to 0.  Still goes from 10V to 0V in 80 mS.
> >
> > In the HAL file these set up the MESA for speed to RPM.  But I seem
> > to have missed an acceleration.
> >
> > # PWM gen signals/setup
> > # PWM signal pin config
> > setp   hm2_7i92.0.pwmgen.00.output-type  1
> > setp   hm2_7i92.0.pwmgen.00.scale  [SPINDLE_9]PWM_SCALE
> > setp   hm2_7i92.0.pwmgen.pwm_frequency 1000
> >
> > So far I haven't been able to get ramping working although one would
> > think the MESA could do this with a parameter. # load real time a
> > limit2 and a near with names so it is easier to follow loadrt limit2
> > names=spindle-ramp
> > loadrt near names=spindle-at-speed
> > etc...
> >
> > Is there a simple way to ramp a 0-10V and 10V to 0V so acceleration
> > is a bit slower?
>
> Yes, you have a start there, you need to put the limit2 component in
> the spindle speed commmand path and set the limit2 components maxv
> value to the desired RPM per second acceleration value.
>
This will impinge on rigid tapping because of the fixed accel limit.

So I take advantage of the stepper having max torque at zero speeds by 
using a limit3  which can set both max_accel and max_vel and by the 
value choices more closely simulate the sin-squared waveform.

This can make the turnaround times be done quicker but it is a bit 
complex to set up because linuxcnc itself makes no attempt to sequence 
the required reversal.
So my logic assumes a control which is a 4 quadrant controller, and 
sequences the turn around as follows:

on receiving the reversal of direction from motion, it is blocked, but 
the commanded speed is ramped to zero by switching a mux4 to zero the 
speed command by this limit3. A one shot is watching the spindle speed 
with just one of the signal inputs to the encoder, and when a nearly 
stopped condition is achieved by the oneshot timeing out, then the mux4 
is clocked again and the reverse is allowed to be sent on to the 
controller pid by way of this limit3 which now has to start from zero 
speed, ramping it back up to the commanded speed in the other direction.
All this takes place in a bit less than 400 milliseconds on my g0704, 
which may be spinning at 3k revs, but it places the slow accel in the z 
axis within its ability to properly track the reversal.

I also took advantage of the 2 switches tallying the gear shift knob 
position to feed a small drive to the pid when its not solidly in either 
gear, to spin the motor slowly so that the square faced nylon gears in 
the spindle can mesh without crashing as the spindle speed is reduced to 
about 20 rpms long before the gears have diss-engaged by turning the 
knob, and full speed is not restored, thru this limit3, until the other 
tally switch has closed indicating the gear is fully engaged.  So I can 
reach up and change speeds with no excitement/drama at 3k revs.

Spindle stopped, I must grab the spindle and turn it by hand to mesh the 
gears.  That has safety considerations to ones hand I'd druther not have 
to deal with.

This is done on just two of my 4 machines and abuses the motor but in 
several years it has not complained. My junk box parts motor psu can hit 
that 1 horse rated motor to around 2 hp, as its a 90 volt, 9.7 amp rated 
brushed pmdc motor, but the power supply can do around 20 amps at 125 
volts. I have one of Jon's pwm-servo amps being used as the spindle 
controller and its set to currant limit at around 17 amps. On a reverse 
it feeds the motor back into the supply to stop it, banging that 125 
supply up to about 160 volts, then uses that overcharge to accel the 
motor in the other direction.  Listening carefully, one can pick out the 
iron chirp as that current limit kicks in.

I am doing a similar sequence to reverse the motor on the sheldon, but 
theres no pid's there, the vfd itself is pretty stiff. But with a 40 lb 
chuck mounted, and clamped, the reversal is slower.

> > Thanks
> > John
> >
> >
> >
> >
> > _______________________________________________
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
>
> Peter Wallace
> Mesa Electronics
>
> (\__/)
> (='.'=) This is Bunny. Copy and paste bunny into your
> (")_(") signature to help him gain world domination.
>
>
>
> _______________________________________________
> 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)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to