Re: [Emc-users] more dc servo questions

2021-09-28 Thread Gene Heskett
On Tuesday 28 September 2021 13:43:54 John Figie wrote:

>   Gene,
>
> So It seems like you have verified that the PSU shutdown is not caused
> by a shoot through current in the H bridge and that is good.
> Now if the motor is running at 24V and you instantly reverse the power
> supply, the current going into the motor will not instantly reverse
> direction because of the motor inductance. But if the inertia is large
> compared to the inductance (large in terms of stored energy) then like
> you say, the current will soon get very large as you will have
> essentially 48V (24 from PSU and 24 from back EMF) across the winding,
> limited only by the resistance.
>
> Now I am working on making some torque mode drives for my lathe
> retrofit. But I would like to see if I can make a decent motor and
> drive simulation using LTSpice. I already have what I think is a
> reasonable motor model. I intend to share the simulation model once I
> am confident in it. It can also be used to show any benefit in true
> torque mode, where the current is the command input to the drive,
> rather than voltage mode - what I think you have. I have found that if
> a simulation can be set up and validated it gives much more insight
> into a particular problem - you can make changes quickly and you can
> measure things that would be otherwise very difficult.
>
> It would be cool if I could get more info about your motor and
> mechanics.
>
> Like:
>
> No Load Speed - maybe not feasible for you since you would need to
> take your machine apart.

My best estimate would still be a WAG.

> Nominal voltage and speed
24 volts, 100 watt rated, but I suspect from the heat rise that would be 
an ICAS rating. Service target is a chain driven estate driveway gate 
and one open/close wouldn't be anywhere near CCS.

> Stall current
Since the psu is a 300 watt model and doesn't crowbar at the limited 
accells I can use, I'll say a WAG at 10 to 12 amps. 

> Stall torque
unk, more than enough to turn the bs-1. Including I believe with a 
cutting load applied

> DC resistance

That I can get.

> Inductance

I have an esr meter that might report that, none of the several dvm's I 
have does inductance. 

> Inertia of rotor and worm - that one may be hard to find. but maybe it
> can be estimated by the mass, and diameter of the armature and
> connected load. The mass on the worm gear side will probably not be
> significant because of the high gear ratios.
>
> Regards,
>
> John

I'll get back with anything else I can measure but I've got some pill 
shopping to do yet today, scripts running out etc.

Thanks John.
>
>
>
>
> ___
> 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, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] more dc servo questions

2021-09-28 Thread John Figie
  Gene,

So It seems like you have verified that the PSU shutdown is not caused by a
shoot through current in the H bridge and that is good.
Now if the motor is running at 24V and you instantly reverse the power
supply, the current going into the motor will not instantly reverse
direction because of the motor inductance. But if the inertia is large
compared to the inductance (large in terms of stored energy) then like you
say, the current will soon get very large as you will have essentially 48V
(24 from PSU and 24 from back EMF) across the winding, limited only by the
resistance.

Now I am working on making some torque mode drives for my lathe retrofit.
But I would like to see if I can make a decent motor and drive simulation
using LTSpice. I already have what I think is a reasonable motor model. I
intend to share the simulation model once I am confident in it. It can also
be used to show any benefit in true torque mode, where the current is the
command input to the drive, rather than voltage mode - what I think you
have. I have found that if a simulation can be set up and validated it
gives much more insight into a particular problem - you can make changes
quickly and you can measure things that would be otherwise very difficult.

It would be cool if I could get more info about your motor and mechanics.

Like:

No Load Speed - maybe not feasible for you since you would need to take
your machine apart.
Nominal voltage and speed
Stall current
Stall torque
DC resistance
Inductance
Inertia of rotor and worm - that one may be hard to find. but maybe it can
be estimated by the mass, and diameter of the armature and connected load.
The mass on the worm gear side will probably not be significant because of
the high gear ratios.

Regards,

John



>
>

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


Re: [Emc-users] more dc servo questions

2021-09-22 Thread Chris Albertson
I included a simplified schematic of a dual h-bridge.   You can see that
the motor runs in one direction id Q1 and Q4 are open while Q2 nd Q3 are
closed.  Reverse this and the motor runs the other way.  But what if in
switching, the timming is "off" and for just a millisecond both Q1 and Q2
are open?   The power supply would "crowbar."

Q1, Q2, S3 and Q4 are controlled by LCNC software and the BOB.  It is
really easy to get the timming wrong.

The other thing is that with the diodes in place the motor leads will never
"conect backward" to the power supply.  Back EMF is contained. I assume
the controller board you have uses diodes like these, either discrete or
inside the half-bridge chips.  I just looked the data sheet. yes, those
diodes are on-chip.

Given the diodes, for o=your explanation to work, you must explain which
diodes are on and which are off and how this forms a loop through the power
supply.  It might be.  I'll not say "It is impossible because I personally
don't see how it can heppen."

Finally if all else fails, use a linear supply.  as long as the filter cap
voltage rating is very high it is bomb-proof.

[image: image7.png]



On Wed, Sep 22, 2021 at 1:41 PM Gene Heskett  wrote:

> On Wednesday 22 September 2021 13:42:00 John Figie wrote:
>
> > John Figie
> >
> >  But if it overshoots the
> >
> > > commanded position and goes into reverse to bring the motor back by
> > > more than a 1 or 2 % drive while the motor is still coasting fwd, it
> > > will crowbar the psu, getting it hot instantly, causeing the psu to
> > > do a shut down until it has cooled for 2 or 3 minutes. Even then, no
> > > heat in the BTS IC's.
> >
> > So if the motor is rotating forward and has enough inertia then when
> > you try to slow it or reverse
> > it it will become a generator and try to increase the output voltage
> > on the PSU. Is the
> > crowbar circuit in the PSU an overvoltage protection crowbar? If so,
> > then maybe that is the issue.
>
> I think, from what I have seen on the scope, that yes, its a generator,
> but with the bridge switched in the reversal, its the equ of hooking
> a -24 volt generator to the psu. Equals instant, many amps drawn
> crowbar. Up to that point the psu is running dead cold, but when it
> shuts down, the hot transistors in the psu are hot enough that the
> radiated heat says that corner of the psu is burn your hand hot, in
> milliseconds.  There is no damage, and normal operation is resumed if
> time to cool has been given and power is then cycled off & hack on. That
> FWIW, is a feature of F2 on all my machines. I have not hooked that up
> in hal, mainly because that would kill the power instantly, stopping the
> cooling fan, and extending the enforced stop from 2-3 minutes to around
> 10 minutes. On the scope, the dc has no up-spike, it just drops like a
> rock, taking around 10 micro-seconds to get down to 1 volt. That holds
> for several milliseconds while the psu is deciding to shut down from the
> short on its output.
>
> Could the BTS 7960 bridge itself actually turn into a short under those
> conditions?. It has a good sized heat sink that never has a detectable
> heat. With single digit milliohms of R when on, thats is not beyond
> imagining. A subtrate scr perhaps?
>
> There is a one paragraph description buried in technical gobbledegook in
> the manual.  And there is an INH input but driving it would take
> external full time logic in order to meet its reaction time.
>
> > Maybe you need some way to get rid of the stopping energy with a shunt
> > resistor and switch that activates
> > before the crowbar trips.
>
> Matches my thinking but I haven't pursued it into visualizing the logic
> to do it with. Said another way, I am a C.E.T., getting ancient and
> rusty but w/o enough data to make sense of it. And being a CET, I'd
> druther fix it with finesse, not by making a lot of heat dumping power
> brute force.
>
> > In industrial motion systems a shunt resistor and switch is used to
> > regulate the DC bus that feeds
> > all of the servo axis. This is not a precise voltage regulator, it
> > just turns on the shunt as the voltage gets
> > above a set limit and then turns off again as the voltage returns to a
> > lower limit.
> >
> I have thought of doing something like that for the spindle psu, which
> shoots well above the surge voltage rating of its filter caps when doing
> a spindle reverse, however its only for a few milliseconds before the
> controller uses that recovered energy to accelerate the spindle in the
> new direction, doing it for free, no noticable surge in the wall current
> draw at all, the surge is of such short duration that there is no
> detectable heating of the caps during the few milliseconds of the
> overvoltage duration.  And its been doing it for 5+ years with zero
> failures. From 3k revs fwd to 3k revs reverse is 350 to 400
> milliseconds.
>
> > Regards,
> >
> > John
> >
> Thanks John.
>
> Cheers, Gene Heskett
> --
> "There are four 

Re: [Emc-users] more dc servo questions

2021-09-22 Thread Gene Heskett
On Wednesday 22 September 2021 15:31:33 Chris Albertson wrote:

> SIn waves are there own derivatives and integrals, except for phase.  
> So a sine wave acceleration works if the gaol is a sine wive velocity
> curve. But I assume the goal here is maximum change in velocity. 
> You get that by running the motor is full reverse.
>
> I doubt we are seing back EMF because the worm cn not be back driven
> by a wheel.
>
> My guess about the root cause if the power supply current spike is a
> shoot-through in the double h-brige because the direction owas
> reserved instantly with no though to the gate driver rise and fall
> times. (I actualy hope it is this because the fix then is easy and can
> be done on software. If I'm wrong th fix is harder.
>
Not in the same servo cycle as whats presented to the pwmgen comes back 
out in 4 pulse lumps as its running at 4 kilohertz. To change direction 
can only be done on the next servo thread. However I have not seen it 
done in less than 2 servo cycles.

But lets ask Peter since its his pwmgen:

Could your fpga pwmgen in the 5i25, running in mode=2, reverse itself in 
the same servo loop?

> On Wed, Sep 22, 2021 at 11:51 AM dave engvall  
wrote:
> > Hi,
> >
> > Fully recognizing that nothing is impossible to the person that
> > doesn't have to make it work.  With that proviso I will open
> > mouth and insert foot. To wit: a sine for acceleration should give a
> > more gentle startup and approach to end point. Of course
> > implementation is left as an exercise for the student. ;-)
> > Now I'll shut up and go away.
> >
> > Dave
> >
> > On 9/22/21 11:28 AM, Chris Albertson wrote:
> > > So you are driving it with something like this?
> > > amazon.com/HiLetgo-BTS7960-Driver...
> > > <
> >
> > https://www.amazon.com/HiLetgo-BTS7960-Driver-Arduino-Current/dp/B00
> >WSN98DC/ref=asc_df_B00WSN98DC/?tag=hyprod-20=df0=1980
> >90929431==g=9099973595926304313==
> >vqmt==c===9031026=pla-40367
> >6040447=1
> >
> > > One possible mistake is if even for a short time the both enable
> > > inputs
> >
> > are
> >
> > > active you will get "shoot through" and short the power supply.   
> > > Can
> >
> > you
> >
> > > verify this NEVER haens using a scope or logic analyser?   Do
> > > not bother with a software "hal scope"  You need to look at that
> > > is actually
> >
> > on
> >
> > > the wires with a device that samples the actual metal pins.  Real
> > > pins
> >
> > have
> >
> > > riseand fall times and they can't intersect.
> > >
> > > I would also just use one PWM generator and connet it to both LPWM
> > > and RPWM.A safer why to handle L-EN and R_EN is to make 100%
> > > certain that they go through a state where BOTH ARE OFF.  Don't
> > > flip them instantly as there is a finite rise and decay time.
> > > There needs to be soome number of microseconds where both are off.
> > >
> > > I bet LCNC flips both L-EN and R_EN on eht same software cycle. 
> > > If so
> >
> > then
> >
> > > the supply is shorted via the controller board.
> > >
> > > There boards are cheap and another way to fix this is to used a
> > > boaed
> >
> > with
> >
> > > a "forward/Reverse" pin rather then two pins sothere is no chance
> > > of enabling both pins.
> > >
> > > Or using a "smart" controller with a serial interface where the
> > > speed and direction are sent as a digital command message.   Then
> > > the acceletaion
> >
> > and
> >
> > > such is handled by the controller.
> > >
> > > The sounds like an short in the h-bridge to me but I could be
> > > wrong.  You can test this with a digital scope. on the control
> > > pins.
> > >
> > > On Wed, Sep 22, 2021 at 10:21 AM Gene Heskett
> > > 
> >
> > wrote:
> > >> On Wednesday 22 September 2021 11:44:51 John Figie wrote:
> > >>> Gene,
> > >>>
> > >>> I would like to better understand your problem and have been
> > >>> thinking about this. I have some questions.
> > >>>
> > > I don't think the fact that there is a worm gear matters.  The
> > > problem, I bet is the large inertia of the system.
> > >>>
> > >>> Hmm I am not sure about the inertia. I think if you have a large
> > >>> gear reduction then the inertia reflected across the gears
> > >>> should appear low from the motors point of view.
> > >>>
> > > Aside from proper tuning of the PID gains you could change the
> > > system to use a nested or "cascade" PID.  THis allows the
> > > velocity setpoint to be controlled by the position error
> > > see the section "cascade" in the wiki article
> > > https://en.wikipedia.org/wiki/PID_controller
> > >
> > > I think you want a very fast loop i=for the inner PID.  LIkely
> > > it wouldbe in external hardwarelike a microcontroller or FPGA.
> > > (does MESA
> > 
> >  do
> > 
> > > the PID algorithm in the FPGA?  It should.)
> > >
> > >
> > >
> > > On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett
> > > 
> > 
> >  wrote:
> > >> Greetings all;
> > >> As most of 

Re: [Emc-users] more dc servo questions

2021-09-22 Thread Gene Heskett
On Wednesday 22 September 2021 14:48:55 dave engvall wrote:

> Hi,
>
> Fully recognizing that nothing is impossible to the person that
> doesn't have to make it work.  With that proviso I will open
> mouth and insert foot. To wit: a sine for acceleration should give a
> more gentle startup and approach to end point. Of course
> implementation is left as an exercise for the student. ;-)

Which will probably involve a limit3. ISTR I've already got one in there.

> Now I'll shut up and go away.
>
> Dave
>
Chuckle. Thanks Dave.

> On 9/22/21 11:28 AM, Chris Albertson wrote:
> > So you are driving it with something like this?
> > amazon.com/HiLetgo-BTS7960-Driver...
> >  >0WSN98DC/ref=asc_df_B00WSN98DC/?tag=hyprod-20=df0=198
> >090929431==g=9099973595926304313==&
> >hvqmt==c===9031026=pla-4036
> >76040447=1>
> >
> > One possible mistake is if even for a short time the both enable
> > inputs are active you will get "shoot through" and short the power
> > supply.Can you verify this NEVER haens using a scope or
> > logic analyser?   Do not bother with a software "hal scope"  You
> > need to look at that is actually on the wires with a device that
> > samples the actual metal pins.  Real pins have riseand fall times
> > and they can't intersect.
> >
> > I would also just use one PWM generator and connet it to both LPWM
> > and RPWM.A safer why to handle L-EN and R_EN is to make 100%
> > certain that they go through a state where BOTH ARE OFF.  Don't flip
> > them instantly as there is a finite rise and decay time. There needs
> > to be soome number of microseconds where both are off.
> >
> > I bet LCNC flips both L-EN and R_EN on eht same software cycle.  If
> > so then the supply is shorted via the controller board.
> >
> > There boards are cheap and another way to fix this is to used a
> > boaed with a "forward/Reverse" pin rather then two pins sothere is
> > no chance of enabling both pins.
> >
> > Or using a "smart" controller with a serial interface where the
> > speed and direction are sent as a digital command message.   Then
> > the acceletaion and such is handled by the controller.
> >
> > The sounds like an short in the h-bridge to me but I could be wrong.
> >  You can test this with a digital scope. on the control pins.
> >
> > On Wed, Sep 22, 2021 at 10:21 AM Gene Heskett  
wrote:
> >> On Wednesday 22 September 2021 11:44:51 John Figie wrote:
> >>> Gene,
> >>>
> >>> I would like to better understand your problem and have been
> >>> thinking about this. I have some questions.
> >>>
> > I don't think the fact that there is a worm gear matters.  The
> > problem, I bet is the large inertia of the system.
> >>>
> >>> Hmm I am not sure about the inertia. I think if you have a large
> >>> gear reduction then the inertia reflected across the gears should
> >>> appear low from the motors point of view.
> >>>
> > Aside from proper tuning of the PID gains you could change the
> > system to use a nested or "cascade" PID.  THis allows the
> > velocity setpoint to be controlled by the position error
> > see the section "cascade" in the wiki article
> > https://en.wikipedia.org/wiki/PID_controller
> >
> > I think you want a very fast loop i=for the inner PID.  LIkely
> > it wouldbe in external hardwarelike a microcontroller or FPGA.
> > (does MESA
> 
>  do
> 
> > the PID algorithm in the FPGA?  It should.)
> >
> >
> >
> > On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett
> > 
> 
>  wrote:
> >> Greetings all;
> >> As most of you know, I built a servo from scratch for a BS-1.
> >>>
> >>> BS-1? What is this? Is this like a Grizzly BS-1 dividing head? Did
> >>> you mount the servo motor to this?
> >>
> >> Not a grizzly, a Chinese clone.
> >>
> >> But I am not at all happy with its performance.
> >> It is a motor with a worm output, driving the worm of the bs-1.
> >> And it has an A/B quad encoder in it.
> >>>
> >>> So you have a 2 worm gear reduction. Where in this system is the
> >>> encoder mounted?
> >>
> >> On the rear of the motor.
> >>
> >>> What are the encoder counts per rev of the encoder?
> >>
> >> DNK, no index in it.  So I measured the encoder for 100 turns of
> >> the BS-1 as verified by the home switch, divided that by 36 to
> >> get a count per degree scale value. Thats about 666.something per
> >> degree of the BS-1
> >>
> >>> What are the motor characteristics?
> >>
> >> Brushed PMDC, rated a 100 watts, 24 volts. Intended to run estate
> >> gates by chain drive similar to garage door openers. I assume its
> >> OEM controller has a homing switch, and counts encoder pulses to
> >> open so many pulses when the approaching driver punches his access
> >> button.
> >>
> >> But I must rather severely limit its run speed because the PID
> >> doesn't see the null coming near fast enough to slow it and
> >> stop a 

Re: [Emc-users] more dc servo questions

2021-09-22 Thread Gene Heskett
On Wednesday 22 September 2021 14:28:40 Chris Albertson wrote:

> So you are driving it with something like this?
> amazon.com/HiLetgo-BTS7960-Driver...
> SN98DC/ref=asc_df_B00WSN98DC/?tag=hyprod-20=df0=1980909
>29431==g=9099973595926304313===
>=c===9031026=pla-403676040447
>=1>

Precisely. In mode 2 for what you want below, there is a setable deadband 
so both inputs are never on at the same time.

> One possible mistake is if even for a short time the both enable
> inputs are active you will get "shoot through" and short the power
> supply.Can you verify this NEVER haens using a scope or logic
> analyser?

The best sampling scope on the planet at the moment has not found both 
signals high at the same time.

> Do not bother with a software "hal scope"  You need to 
> look at that is actually on the wires with a device that samples the
> actual metal pins.  Real pins have riseand fall times and they can't
> intersect.
>
> I would also just use one PWM generator and connet it to both LPWM and
> RPWM.

Mode 2 does that.

> A safer why to handle L-EN and R_EN is to make 100% certain 
> that they go through a state where BOTH ARE OFF.  Don't flip them
> instantly as there is a finite rise and decay time. There needs to be
> soome number of microseconds where both are off.
>
That is the case. I could post pix but John K. won't let me.

> I bet LCNC flips both L-EN and R_EN on eht same software cycle.  If so
> then the supply is shorted via the controller board.

Not that I've caught with a $3400 350 megasample scope.

> There boards are cheap and another way to fix this is to used a boaed
> with a "forward/Reverse" pin rather then two pins sothere is no chance
> of enabling both pins.
>
> Or using a "smart" controller with a serial interface where the speed
> and direction are sent as a digital command message.   Then the
> acceletaion and such is handled by the controller.

Link?

> The sounds like an short in the h-bridge to me but I could be wrong. 
> You can test this with a digital scope. on the control pins.
>
> On Wed, Sep 22, 2021 at 10:21 AM Gene Heskett  
wrote:
> > On Wednesday 22 September 2021 11:44:51 John Figie wrote:
> > > Gene,
> > >
> > > I would like to better understand your problem and have been
> > > thinking about this. I have some questions.
> > >
> > > > > I don't think the fact that there is a worm gear matters.  The
> > > > > problem, I bet is the large inertia of the system.
> > >
> > > Hmm I am not sure about the inertia. I think if you have a large
> > > gear reduction then the inertia reflected across the gears should
> > > appear low from the motors point of view.
> > >
> > > > > Aside from proper tuning of the PID gains you could change the
> > > > > system to use a nested or "cascade" PID.  THis allows the
> > > > > velocity setpoint to be controlled by the position error
> > > > > see the section "cascade" in the wiki article
> > > > > https://en.wikipedia.org/wiki/PID_controller
> > > > >
> > > > > I think you want a very fast loop i=for the inner PID.  LIkely
> > > > > it wouldbe in external hardwarelike a microcontroller or FPGA.
> > > > > (does MESA
> > > >
> > > > do
> > > >
> > > > > the PID algorithm in the FPGA?  It should.)
> > > > >
> > > > >
> > > > >
> > > > > On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett
> > > > > 
> > > >
> > > > wrote:
> > > > >> Greetings all;
> > > > >> As most of you know, I built a servo from scratch for a BS-1.
> > >
> > > BS-1? What is this? Is this like a Grizzly BS-1 dividing head? Did
> > > you mount the servo motor to this?
> >
> > Not a grizzly, a Chinese clone.
> >
> > > > >> But I am not at all happy with its performance.
> > > > >> It is a motor with a worm output, driving the worm of the
> > > > >> bs-1. And it has an A/B quad encoder in it.
> > >
> > > So you have a 2 worm gear reduction. Where in this system is the
> > > encoder mounted?
> >
> > On the rear of the motor.
> >
> > > What are the encoder counts per rev of the encoder?
> >
> > DNK, no index in it.  So I measured the encoder for 100 turns of the
> > BS-1 as verified by the home switch, divided that by 36 to get a
> > count per degree scale value. Thats about 666.something per degree
> > of the BS-1
> >
> > > What are the motor characteristics?
> >
> > Brushed PMDC, rated a 100 watts, 24 volts. Intended to run estate
> > gates by chain drive similar to garage door openers. I assume its
> > OEM controller has a homing switch, and counts encoder pulses to
> > open so many pulses when the approaching driver punches his access
> > button.
> >
> > > > >> But I must rather severely limit its run speed because the
> > > > >> PID doesn't see the null coming near fast enough to slow it
> > > > >> and stop a couple
> > >
> > > When you say null coming what do you mean? Is this the point where
> > > the desired position is reached according to the motion planner in
> > > LinuxCNC?
> >
> > Yes. 

Re: [Emc-users] more dc servo questions

2021-09-22 Thread Gene Heskett
On Wednesday 22 September 2021 13:42:00 John Figie wrote:

> John Figie
>
>  But if it overshoots the
>
> > commanded position and goes into reverse to bring the motor back by
> > more than a 1 or 2 % drive while the motor is still coasting fwd, it
> > will crowbar the psu, getting it hot instantly, causeing the psu to
> > do a shut down until it has cooled for 2 or 3 minutes. Even then, no
> > heat in the BTS IC's.
>
> So if the motor is rotating forward and has enough inertia then when
> you try to slow it or reverse
> it it will become a generator and try to increase the output voltage
> on the PSU. Is the
> crowbar circuit in the PSU an overvoltage protection crowbar? If so,
> then maybe that is the issue.

I think, from what I have seen on the scope, that yes, its a generator, 
but with the bridge switched in the reversal, its the equ of hooking 
a -24 volt generator to the psu. Equals instant, many amps drawn 
crowbar. Up to that point the psu is running dead cold, but when it 
shuts down, the hot transistors in the psu are hot enough that the 
radiated heat says that corner of the psu is burn your hand hot, in 
milliseconds.  There is no damage, and normal operation is resumed if 
time to cool has been given and power is then cycled off & hack on. That 
FWIW, is a feature of F2 on all my machines. I have not hooked that up 
in hal, mainly because that would kill the power instantly, stopping the 
cooling fan, and extending the enforced stop from 2-3 minutes to around 
10 minutes. On the scope, the dc has no up-spike, it just drops like a 
rock, taking around 10 micro-seconds to get down to 1 volt. That holds 
for several milliseconds while the psu is deciding to shut down from the 
short on its output.

Could the BTS 7960 bridge itself actually turn into a short under those 
conditions?. It has a good sized heat sink that never has a detectable 
heat. With single digit milliohms of R when on, thats is not beyond 
imagining. A subtrate scr perhaps? 

There is a one paragraph description buried in technical gobbledegook in 
the manual.  And there is an INH input but driving it would take 
external full time logic in order to meet its reaction time.
 
> Maybe you need some way to get rid of the stopping energy with a shunt
> resistor and switch that activates
> before the crowbar trips.

Matches my thinking but I haven't pursued it into visualizing the logic 
to do it with. Said another way, I am a C.E.T., getting ancient and 
rusty but w/o enough data to make sense of it. And being a CET, I'd 
druther fix it with finesse, not by making a lot of heat dumping power 
brute force.

> In industrial motion systems a shunt resistor and switch is used to
> regulate the DC bus that feeds
> all of the servo axis. This is not a precise voltage regulator, it
> just turns on the shunt as the voltage gets
> above a set limit and then turns off again as the voltage returns to a
> lower limit.
>
I have thought of doing something like that for the spindle psu, which 
shoots well above the surge voltage rating of its filter caps when doing 
a spindle reverse, however its only for a few milliseconds before the 
controller uses that recovered energy to accelerate the spindle in the 
new direction, doing it for free, no noticable surge in the wall current 
draw at all, the surge is of such short duration that there is no 
detectable heating of the caps during the few milliseconds of the 
overvoltage duration.  And its been doing it for 5+ years with zero 
failures. From 3k revs fwd to 3k revs reverse is 350 to 400 
milliseconds.

> Regards,
>
> John
>
Thanks John.

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 


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


Re: [Emc-users] more dc servo questions

2021-09-22 Thread Chris Albertson
SIn waves are there own derivatives and integrals, except for phase.   So a
sine wave acceleration works if the gaol is a sine wive velocity curve.
 But I assume the goal here is maximum change in velocity.  You get
that by running the motor is full reverse.

I doubt we are seing back EMF because the worm cn not be back driven by a
wheel.

My guess about the root cause if the power supply current spike is a
shoot-through in the double h-brige because the direction owas
reserved instantly with no though to the gate driver rise and fall times.
(I actualy hope it is this because the fix then is easy and can be done on
software. If I'm wrong th fix is harder.

On Wed, Sep 22, 2021 at 11:51 AM dave engvall  wrote:

> Hi,
>
> Fully recognizing that nothing is impossible to the person that doesn't
> have to make it work.  With that proviso I will open
> mouth and insert foot. To wit: a sine for acceleration should give a
> more gentle startup and approach to end point. Of course implementation
> is left as an exercise for the student. ;-)
> Now I'll shut up and go away.
>
> Dave
>
> On 9/22/21 11:28 AM, Chris Albertson wrote:
> > So you are driving it with something like this?
> > amazon.com/HiLetgo-BTS7960-Driver...
> > <
> https://www.amazon.com/HiLetgo-BTS7960-Driver-Arduino-Current/dp/B00WSN98DC/ref=asc_df_B00WSN98DC/?tag=hyprod-20=df0=198090929431==g=9099973595926304313c===9031026=pla-403676040447=1
> >
> >
> > One possible mistake is if even for a short time the both enable inputs
> are
> > active you will get "shoot through" and short the power supply.Can
> you
> > verify this NEVER haens using a scope or logic analyser?   Do not
> > bother with a software "hal scope"  You need to look at that is actually
> on
> > the wires with a device that samples the actual metal pins.  Real pins
> have
> > riseand fall times and they can't intersect.
> >
> > I would also just use one PWM generator and connet it to both LPWM and
> > RPWM.A safer why to handle L-EN and R_EN is to make 100% certain that
> > they go through a state where BOTH ARE OFF.  Don't flip them instantly as
> > there is a finite rise and decay time. There needs to be soome number of
> > microseconds where both are off.
> >
> > I bet LCNC flips both L-EN and R_EN on eht same software cycle.  If so
> then
> > the supply is shorted via the controller board.
> >
> > There boards are cheap and another way to fix this is to used a boaed
> with
> > a "forward/Reverse" pin rather then two pins sothere is no chance of
> > enabling both pins.
> >
> > Or using a "smart" controller with a serial interface where the speed and
> > direction are sent as a digital command message.   Then the acceletaion
> and
> > such is handled by the controller.
> >
> > The sounds like an short in the h-bridge to me but I could be wrong.  You
> > can test this with a digital scope. on the control pins.
> >
> > On Wed, Sep 22, 2021 at 10:21 AM Gene Heskett 
> wrote:
> >
> >> On Wednesday 22 September 2021 11:44:51 John Figie wrote:
> >>
> >>> Gene,
> >>>
> >>> I would like to better understand your problem and have been thinking
> >>> about this. I have some questions.
> >>>
> > I don't think the fact that there is a worm gear matters.  The
> > problem, I bet is the large inertia of the system.
> >>> Hmm I am not sure about the inertia. I think if you have a large gear
> >>> reduction then the inertia reflected across the gears should appear
> >>> low from the motors point of view.
> >>>
> > Aside from proper tuning of the PID gains you could change the
> > system to use a nested or "cascade" PID.  THis allows the velocity
> > setpoint to be controlled by the position error
> > see the section "cascade" in the wiki article
> > https://en.wikipedia.org/wiki/PID_controller
> >
> > I think you want a very fast loop i=for the inner PID.  LIkely it
> > wouldbe in external hardwarelike a microcontroller or FPGA.
> > (does MESA
>  do
> 
> > the PID algorithm in the FPGA?  It should.)
> >
> >
> >
> > On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett
> > 
>  wrote:
> >> Greetings all;
> >> As most of you know, I built a servo from scratch for a BS-1.
> >>> BS-1? What is this? Is this like a Grizzly BS-1 dividing head? Did you
> >>> mount the servo motor to this?
> >> Not a grizzly, a Chinese clone.
> >>
> >> But I am not at all happy with its performance.
> >> It is a motor with a worm output, driving the worm of the bs-1.
> >> And it has an A/B quad encoder in it.
> >>> So you have a 2 worm gear reduction. Where in this system is the
> >>> encoder mounted?
> >> On the rear of the motor.
> >>
> >>> What are the encoder counts per rev of the encoder?
> >> DNK, no index in it.  So I measured the encoder for 100 turns of the
> BS-1
> >> as verified by the home switch, divided that by 36 to get a count
> >> per degree scale value. Thats about 666.something per degree of the 

Re: [Emc-users] more dc servo questions

2021-09-22 Thread dave engvall

Hi,

Fully recognizing that nothing is impossible to the person that doesn't 
have to make it work.  With that proviso I will open
mouth and insert foot. To wit: a sine for acceleration should give a 
more gentle startup and approach to end point. Of course implementation 
is left as an exercise for the student. ;-)

Now I'll shut up and go away.

Dave

On 9/22/21 11:28 AM, Chris Albertson wrote:

So you are driving it with something like this?
amazon.com/HiLetgo-BTS7960-Driver...


One possible mistake is if even for a short time the both enable inputs are
active you will get "shoot through" and short the power supply.Can you
verify this NEVER haens using a scope or logic analyser?   Do not
bother with a software "hal scope"  You need to look at that is actually on
the wires with a device that samples the actual metal pins.  Real pins have
riseand fall times and they can't intersect.

I would also just use one PWM generator and connet it to both LPWM and
RPWM.A safer why to handle L-EN and R_EN is to make 100% certain that
they go through a state where BOTH ARE OFF.  Don't flip them instantly as
there is a finite rise and decay time. There needs to be soome number of
microseconds where both are off.

I bet LCNC flips both L-EN and R_EN on eht same software cycle.  If so then
the supply is shorted via the controller board.

There boards are cheap and another way to fix this is to used a boaed with
a "forward/Reverse" pin rather then two pins sothere is no chance of
enabling both pins.

Or using a "smart" controller with a serial interface where the speed and
direction are sent as a digital command message.   Then the acceletaion and
such is handled by the controller.

The sounds like an short in the h-bridge to me but I could be wrong.  You
can test this with a digital scope. on the control pins.

On Wed, Sep 22, 2021 at 10:21 AM Gene Heskett  wrote:


On Wednesday 22 September 2021 11:44:51 John Figie wrote:


Gene,

I would like to better understand your problem and have been thinking
about this. I have some questions.


I don't think the fact that there is a worm gear matters.  The
problem, I bet is the large inertia of the system.

Hmm I am not sure about the inertia. I think if you have a large gear
reduction then the inertia reflected across the gears should appear
low from the motors point of view.


Aside from proper tuning of the PID gains you could change the
system to use a nested or "cascade" PID.  THis allows the velocity
setpoint to be controlled by the position error
see the section "cascade" in the wiki article
https://en.wikipedia.org/wiki/PID_controller

I think you want a very fast loop i=for the inner PID.  LIkely it
wouldbe in external hardwarelike a microcontroller or FPGA.
(does MESA

do


the PID algorithm in the FPGA?  It should.)



On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett


wrote:

Greetings all;
As most of you know, I built a servo from scratch for a BS-1.

BS-1? What is this? Is this like a Grizzly BS-1 dividing head? Did you
mount the servo motor to this?

Not a grizzly, a Chinese clone.


But I am not at all happy with its performance.
It is a motor with a worm output, driving the worm of the bs-1.
And it has an A/B quad encoder in it.

So you have a 2 worm gear reduction. Where in this system is the
encoder mounted?

On the rear of the motor.


What are the encoder counts per rev of the encoder?

DNK, no index in it.  So I measured the encoder for 100 turns of the BS-1
as verified by the home switch, divided that by 36 to get a count
per degree scale value. Thats about 666.something per degree of the BS-1


What are the motor characteristics?

Brushed PMDC, rated a 100 watts, 24 volts. Intended to run estate gates
by chain drive similar to garage door openers. I assume its OEM
controller has a homing switch, and counts encoder pulses to open so
many pulses when the approaching driver punches his access button.


But I must rather severely limit its run speed because the PID
doesn't see the null coming near fast enough to slow it and stop
a couple

When you say null coming what do you mean? Is this the point where the
desired position is reached according to the motion planner in
LinuxCNC?

Yes. I'd assume so. Motion has its own version.

Null in this context is when the encoder output equals commanded
position.


arcseconds early. I can't allow it to use reverse to stop as the
motor seems to be a near short circuit then, crowbarring the
power supply,

How do you prevent the PWM from reversing the voltage on the motor? Is
the motor driven from a PWM in only one polarity? How is the PWM and
the switches arranged?

Control is by a LCNC PID, fed by the lcnc encoders position output
feeding the PID feedback, with a pwmgen running in mode 2 where it has
two pulse width 

Re: [Emc-users] more dc servo questions

2021-09-22 Thread Chris Albertson
So you are driving it with something like this?
amazon.com/HiLetgo-BTS7960-Driver...


One possible mistake is if even for a short time the both enable inputs are
active you will get "shoot through" and short the power supply.Can you
verify this NEVER haens using a scope or logic analyser?   Do not
bother with a software "hal scope"  You need to look at that is actually on
the wires with a device that samples the actual metal pins.  Real pins have
riseand fall times and they can't intersect.

I would also just use one PWM generator and connet it to both LPWM and
RPWM.A safer why to handle L-EN and R_EN is to make 100% certain that
they go through a state where BOTH ARE OFF.  Don't flip them instantly as
there is a finite rise and decay time. There needs to be soome number of
microseconds where both are off.

I bet LCNC flips both L-EN and R_EN on eht same software cycle.  If so then
the supply is shorted via the controller board.

There boards are cheap and another way to fix this is to used a boaed with
a "forward/Reverse" pin rather then two pins sothere is no chance of
enabling both pins.

Or using a "smart" controller with a serial interface where the speed and
direction are sent as a digital command message.   Then the acceletaion and
such is handled by the controller.

The sounds like an short in the h-bridge to me but I could be wrong.  You
can test this with a digital scope. on the control pins.

On Wed, Sep 22, 2021 at 10:21 AM Gene Heskett  wrote:

> On Wednesday 22 September 2021 11:44:51 John Figie wrote:
>
> > Gene,
> >
> > I would like to better understand your problem and have been thinking
> > about this. I have some questions.
> >
> > > > I don't think the fact that there is a worm gear matters.  The
> > > > problem, I bet is the large inertia of the system.
> >
> > Hmm I am not sure about the inertia. I think if you have a large gear
> > reduction then the inertia reflected across the gears should appear
> > low from the motors point of view.
> >
> > > > Aside from proper tuning of the PID gains you could change the
> > > > system to use a nested or "cascade" PID.  THis allows the velocity
> > > > setpoint to be controlled by the position error
> > > > see the section "cascade" in the wiki article
> > > > https://en.wikipedia.org/wiki/PID_controller
> > > >
> > > > I think you want a very fast loop i=for the inner PID.  LIkely it
> > > > wouldbe in external hardwarelike a microcontroller or FPGA.
> > > > (does MESA
> > >
> > > do
> > >
> > > > the PID algorithm in the FPGA?  It should.)
> > > >
> > > >
> > > >
> > > > On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett
> > > > 
> > >
> > > wrote:
> > > >> Greetings all;
> > > >> As most of you know, I built a servo from scratch for a BS-1.
> >
> > BS-1? What is this? Is this like a Grizzly BS-1 dividing head? Did you
> > mount the servo motor to this?
>
> Not a grizzly, a Chinese clone.
>
> > > >> But I am not at all happy with its performance.
> > > >> It is a motor with a worm output, driving the worm of the bs-1.
> > > >> And it has an A/B quad encoder in it.
> >
> > So you have a 2 worm gear reduction. Where in this system is the
> > encoder mounted?
>
> On the rear of the motor.
>
> > What are the encoder counts per rev of the encoder?
>
> DNK, no index in it.  So I measured the encoder for 100 turns of the BS-1
> as verified by the home switch, divided that by 36 to get a count
> per degree scale value. Thats about 666.something per degree of the BS-1
>
> > What are the motor characteristics?
>
> Brushed PMDC, rated a 100 watts, 24 volts. Intended to run estate gates
> by chain drive similar to garage door openers. I assume its OEM
> controller has a homing switch, and counts encoder pulses to open so
> many pulses when the approaching driver punches his access button.
>
> > > >> But I must rather severely limit its run speed because the PID
> > > >> doesn't see the null coming near fast enough to slow it and stop
> > > >> a couple
> >
> > When you say null coming what do you mean? Is this the point where the
> > desired position is reached according to the motion planner in
> > LinuxCNC?
>
> Yes. I'd assume so. Motion has its own version.
>
> Null in this context is when the encoder output equals commanded
> position.
>
> > > >> arcseconds early. I can't allow it to use reverse to stop as the
> > > >> motor seems to be a near short circuit then, crowbarring the
> > > >> power supply,
> >
> > How do you prevent the PWM from reversing the voltage on the motor? Is
> > the motor driven from a PWM in only one polarity? How is the PWM and
> > the switches arranged?
>
> Control is by a LCNC PID, fed by the lcnc encoders position output
> feeding the PID feedback, with a pwmgen running in mode 2 where it has
> two pulse width modulated outputs, 

Re: [Emc-users] more dc servo questions

2021-09-22 Thread John Figie
John Figie

 But if it overshoots the
> commanded position and goes into reverse to bring the motor back by more
> than a 1 or 2 % drive while the motor is still coasting fwd, it will
> crowbar the psu, getting it hot instantly, causeing the psu to do a shut
> down until it has cooled for 2 or 3 minutes. Even then, no heat in the
> BTS IC's.
>

So if the motor is rotating forward and has enough inertia then when you
try to slow it or reverse
it it will become a generator and try to increase the output voltage on the
PSU. Is the
crowbar circuit in the PSU an overvoltage protection crowbar? If so, then
maybe that is the issue.
Maybe you need some way to get rid of the stopping energy with a shunt
resistor and switch that activates
before the crowbar trips.

In industrial motion systems a shunt resistor and switch is used to
regulate the DC bus that feeds
all of the servo axis. This is not a precise voltage regulator, it just
turns on the shunt as the voltage gets
above a set limit and then turns off again as the voltage returns to a
lower limit.

Regards,

John

>
> ___
> 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


Re: [Emc-users] more dc servo questions

2021-09-22 Thread Gene Heskett
On Wednesday 22 September 2021 11:44:51 John Figie wrote:

> Gene,
>
> I would like to better understand your problem and have been thinking
> about this. I have some questions.
>
> > > I don't think the fact that there is a worm gear matters.  The
> > > problem, I bet is the large inertia of the system.
>
> Hmm I am not sure about the inertia. I think if you have a large gear
> reduction then the inertia reflected across the gears should appear
> low from the motors point of view.
>
> > > Aside from proper tuning of the PID gains you could change the
> > > system to use a nested or "cascade" PID.  THis allows the velocity
> > > setpoint to be controlled by the position error
> > > see the section "cascade" in the wiki article
> > > https://en.wikipedia.org/wiki/PID_controller
> > >
> > > I think you want a very fast loop i=for the inner PID.  LIkely it
> > > wouldbe in external hardwarelike a microcontroller or FPGA.  
> > > (does MESA
> >
> > do
> >
> > > the PID algorithm in the FPGA?  It should.)
> > >
> > >
> > >
> > > On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett
> > > 
> >
> > wrote:
> > >> Greetings all;
> > >> As most of you know, I built a servo from scratch for a BS-1.
>
> BS-1? What is this? Is this like a Grizzly BS-1 dividing head? Did you
> mount the servo motor to this?

Not a grizzly, a Chinese clone. 

> > >> But I am not at all happy with its performance.
> > >> It is a motor with a worm output, driving the worm of the bs-1.
> > >> And it has an A/B quad encoder in it.
>
> So you have a 2 worm gear reduction. Where in this system is the
> encoder mounted?

On the rear of the motor.

> What are the encoder counts per rev of the encoder? 

DNK, no index in it.  So I measured the encoder for 100 turns of the BS-1 
as verified by the home switch, divided that by 36 to get a count 
per degree scale value. Thats about 666.something per degree of the BS-1

> What are the motor characteristics?

Brushed PMDC, rated a 100 watts, 24 volts. Intended to run estate gates 
by chain drive similar to garage door openers. I assume its OEM 
controller has a homing switch, and counts encoder pulses to open so 
many pulses when the approaching driver punches his access button.

> > >> But I must rather severely limit its run speed because the PID
> > >> doesn't see the null coming near fast enough to slow it and stop
> > >> a couple
>
> When you say null coming what do you mean? Is this the point where the
> desired position is reached according to the motion planner in
> LinuxCNC?

Yes. I'd assume so. Motion has its own version.

Null in this context is when the encoder output equals commanded 
position.

> > >> arcseconds early. I can't allow it to use reverse to stop as the
> > >> motor seems to be a near short circuit then, crowbarring the
> > >> power supply,
>
> How do you prevent the PWM from reversing the voltage on the motor? Is
> the motor driven from a PWM in only one polarity? How is the PWM and
> the switches arranged?

Control is by a LCNC PID, fed by the lcnc encoders position output 
feeding the PID feedback, with a pwmgen running in mode 2 where it has 
two pulse width modulated outputs, one fwd, one reverse, which are fed 
to a BTS 7960 board containing 2 of the Infineon half bridges for a full 
bridge control. This IC is rated at 45 volts, 43 amps. Fed by a 24 volt 
supply good for nearly 20 amps, intended for automotive seat position 
controls, it runs this motor with zero heating. But if it overshoots the 
commanded position and goes into reverse to bring the motor back by more 
than a 1 or 2 % drive while the motor is still coasting fwd, it will 
crowbar the psu, getting it hot instantly, causeing the psu to do a shut 
down until it has cooled for 2 or 3 minutes. Even then, no heat in the 
BTS IC's.

The net result is that I must limit its cuising speed and accelleration 
in order for it to coast to a stop using its own friction while avoiding 
the use of reverse to stop, usually a quite small fraction of a degree 
early.  And that is about 10 to 15% of the speed it can move with the 
full 24 volts applied.

> Regards,
>
> John Figie
>
> ___
> 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 


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


Re: [Emc-users] more dc servo questions

2021-09-22 Thread Chris Albertson
On Wed, Sep 22, 2021 at 8:49 AM John Figie  wrote:

> Gene,
>
> I would like to better understand your problem and have been thinking about
> this. I have some questions.
>
>
> > >
> > > I don't think the fact that there is a worm gear matters.  The
> problem, I
> > > bet is the large inertia of the system.
> >
> Hmm I am not sure about the inertia. I think if you have a large gear
> reduction then the inertia reflected across the gears should appear low
> from the motors point of view.
>

An ideal gear reduction is a torque multipliers lets say a 4:1 system.  But
X/4 is still large if X is large and small if X is small.   THe mass in the
system still maters.

>
>
> >
> So you have a 2 worm gear reduction. Where in this system is the encoder
> mounted? What are the encoder counts per rev of the encoder?
> What are the motor characteristics?
>

I also suspect this is the root of the problem.It might be misdesigned.

That said, while I know how to calculate forces in a perfect system (like a
belt reduction) I'm stumped when it comes to worm gears because they are
asymetric in that they can not be back driven due to friction.  I don't
know how to calculate the load on the motor when the motor is opposing
ditection of movment.  There might be (?) large frictional loads.   We also
don't know how the driver electronics works.

>
> Chris Albertson
Redondo Beach, California

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


Re: [Emc-users] more dc servo questions

2021-09-22 Thread John Figie
Gene,

I would like to better understand your problem and have been thinking about
this. I have some questions.


> >
> > I don't think the fact that there is a worm gear matters.  The problem, I
> > bet is the large inertia of the system.
>
Hmm I am not sure about the inertia. I think if you have a large gear
reduction then the inertia reflected across the gears should appear low
from the motors point of view.

> >
> > Aside from proper tuning of the PID gains you could change the system to
> > use a nested or "cascade" PID.  THis allows the velocity setpoint to be
> > controlled by the position error
> > see the section "cascade" in the wiki article
> > https://en.wikipedia.org/wiki/PID_controller
> >
> > I think you want a very fast loop i=for the inner PID.  LIkely it
> > wouldbe in external hardwarelike a microcontroller or FPGA.   (does MESA
> do
> > the PID algorithm in the FPGA?  It should.)
> >
> >
> >
> > On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett 
> wrote:
> >
> >> Greetings all;
> >> As most of you know, I built a servo from scratch for a BS-1.
>
BS-1? What is this? Is this like a Grizzly BS-1 dividing head? Did you
mount the servo motor to this?

> >>
> >> But I am not at all happy with its performance.
> >> It is a motor with a worm output, driving the worm of the bs-1. And it
> >> has an A/B quad encoder in it.
>
So you have a 2 worm gear reduction. Where in this system is the encoder
mounted? What are the encoder counts per rev of the encoder?
What are the motor characteristics?

>>
> >> But I must rather severely limit its run speed because the PID doesn't
> >> see the null coming near fast enough to slow it and stop a couple
>

When you say null coming what do you mean? Is this the point where the
desired position is reached according to the motion planner in LinuxCNC?


> >> arcseconds early. I can't allow it to use reverse to stop as the motor
> >> seems to be a near short circuit then, crowbarring the power supply,
>

How do you prevent the PWM from reversing the voltage on the motor? Is the
motor driven from a PWM in only one polarity? How is the PWM and the
switches arranged?


Regards,

John Figie

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


Re: [Emc-users] more dc servo questions

2021-09-20 Thread Chris Albertson
Every time I have implemented PID based motor control the PID loop runs on
a low-cost microcontroller and then the main computer sends the PID a
series of set-points.   Micros work well as most of them nowadays have
hardware quadrature decoders and can handle over a million lines per
second.  The $4 Raspberry Pi Pico is at least an order of magnitude faster
than needed for this use case.   You don't need an FPGA as a $4 micro is
already overkill.

That said, LCNC just uses very powerful computers so it should be able to
run nested PID loops.  If you make velocity (*velocity*, not acceleration
or motor current) a function of the position error then the motor wil slow
down as it gets closer.

There is also likely a good way to use feed forward with just a single PID
loop.





On Mon, Sep 20, 2021 at 9:05 AM dave engvall  wrote:

> Hi all,
> To the best of my knowledge any version of the lcnc pid is in software.
> OTOH mesa does offer SOFTDMC which does run in/on mesa fpga products.
> However, that breaks the core concept of multiple vendors and real ease
> of user modification of the software although there are a few in this group
> that could fiddle the code for an fpga. In addition softdmc needs all
> the support written to wrap around it; interp, task, etc. Years ago I
> head a rumor tht someone had tried to do it and abandoned the effort. If
> I recall correctly it does offer something besides trap accel, controls
> jerk and runs on a 50 us clock.
> The manual is available online.
> Dave
>
> On 9/19/21 5:12 PM, Chris Albertson wrote:
> > Is the PID controller running on the PC under LCNC or is this an external
> > PID controller you built?
> >
> > What are the numbers, the loop period, motor speed and numer of encoder
> > lines. and so on?
> >
> > I don't think the fact that there is a worm gear matters.  The problem, I
> > bet is the large inertia of the system.
> >
> > Aside from proper tuning of the PID gains you could change the system to
> > use a nested or "cascade" PID.  THis allows the velocity setpoint to be
> > controlled by the position error
> > see the section "cascade" in the wiki article
> > https://en.wikipedia.org/wiki/PID_controller
> >
> > I think you want a very fast loop i=for the inner PID.  LIkely it
> > wouldbe in external hardwarelike a microcontroller or FPGA.   (does MESA
> do
> > the PID algorithm in the FPGA?  It should.)
> >
> >
> >
> > On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett 
> wrote:
> >
> >> Greetings all;
> >> As most of you know, I built a servo from scratch for a BS-1.
> >>
> >> But I am not at all happy with its performance.
> >> It is a motor with a worm output, driving the worm of the bs-1. And it
> >> has an A/B quad encoder in it.
> >>
> >> But I must rather severely limit its run speed because the PID doesn't
> >> see the null coming near fast enough to slow it and stop a couple
> >> arcseconds early. I can't allow it to use reverse to stop as the motor
> >> seems to be a near short circuit then, crowbarring the power supply,
> >> causing a 2 to 3 minute dead time for the 450 watt psu to cool, so I
> >> must limit its speed to disallow its use of reverse to accomplish the
> >> stop.  With 2 worms in series the scale for a 360 degree full turn is of
> >> coarse huge.  If it could be throttled to a gradual stop by anticipating
> >> the coming null, I could probably run it 2 to 4x faster for a cruising
> >> speed.
> >>
> >> So my question is, which of the pid inputs would if raised, better
> >> anticipate the approaching null, slowing it over the last 5 angular
> >> minutes of a turn, ideally to a stop within an arc-second of the command
> >> from the gcode?
> >>
> >> Thanks all.
> >>
> >> 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 
> >>
> >>
> >> ___
> >> 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
>


-- 

Chris Albertson
Redondo Beach, California

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


Re: [Emc-users] more dc servo questions

2021-09-20 Thread dave engvall

Hi all,
To the best of my knowledge any version of the lcnc pid is in software. 
OTOH mesa does offer SOFTDMC which does run in/on mesa fpga products.
However, that breaks the core concept of multiple vendors and real ease 
of user modification of the software although there are a few in this group
that could fiddle the code for an fpga. In addition softdmc needs all 
the support written to wrap around it; interp, task, etc. Years ago I 
head a rumor tht someone had tried to do it and abandoned the effort. If 
I recall correctly it does offer something besides trap accel, controls 
jerk and runs on a 50 us clock.

The manual is available online.
Dave

On 9/19/21 5:12 PM, Chris Albertson wrote:

Is the PID controller running on the PC under LCNC or is this an external
PID controller you built?

What are the numbers, the loop period, motor speed and numer of encoder
lines. and so on?

I don't think the fact that there is a worm gear matters.  The problem, I
bet is the large inertia of the system.

Aside from proper tuning of the PID gains you could change the system to
use a nested or "cascade" PID.  THis allows the velocity setpoint to be
controlled by the position error
see the section "cascade" in the wiki article
https://en.wikipedia.org/wiki/PID_controller

I think you want a very fast loop i=for the inner PID.  LIkely it
wouldbe in external hardwarelike a microcontroller or FPGA.   (does MESA do
the PID algorithm in the FPGA?  It should.)



On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett  wrote:


Greetings all;
As most of you know, I built a servo from scratch for a BS-1.

But I am not at all happy with its performance.
It is a motor with a worm output, driving the worm of the bs-1. And it
has an A/B quad encoder in it.

But I must rather severely limit its run speed because the PID doesn't
see the null coming near fast enough to slow it and stop a couple
arcseconds early. I can't allow it to use reverse to stop as the motor
seems to be a near short circuit then, crowbarring the power supply,
causing a 2 to 3 minute dead time for the 450 watt psu to cool, so I
must limit its speed to disallow its use of reverse to accomplish the
stop.  With 2 worms in series the scale for a 360 degree full turn is of
coarse huge.  If it could be throttled to a gradual stop by anticipating
the coming null, I could probably run it 2 to 4x faster for a cruising
speed.

So my question is, which of the pid inputs would if raised, better
anticipate the approaching null, slowing it over the last 5 angular
minutes of a turn, ideally to a stop within an arc-second of the command
from the gcode?

Thanks all.

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 


___
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


Re: [Emc-users] more dc servo questions

2021-09-19 Thread Gene Heskett
On Sunday 19 September 2021 20:12:01 Chris Albertson wrote:

> Is the PID controller running on the PC under LCNC or is this an
> external PID controller you built?
>
The pid is the stock lcnc pid,

> What are the numbers, the loop period, motor speed and numer of
> encoder lines. and so on?

from the .ini file:
#
# Axis A
#
[AXIS_A]
MAX_VELOCITY= 30.000
MAX_ACCELERATION= 1500.00

[JOINT_3]
TYPE= ANGULAR
HOME= 0.0
HOME_SEQUENCE   = 3
HOME_SEARCH_VEL = 9.0
HOME_LATCH_VEL  = -1.0
HOME_FINAL_VEL  = 30
HOME_OFFSET = 4.498500
VOLATILE_HOME   = 1
FERROR  = 0.50
MIN_FERROR  = 0.25
MAX_VELOCITY= 30.000
MAX_ACCELERATION= 1500.00
P   = 6000
I   = 1.700
D   = 0.7500
FF0 = 0
FF1 = 21.5
FF2 = 0.55
BIAS= 0
DEADBAND= 0.00015
BACKLASH= .1
MAX_OUTPUT  = 900.
SERVO_SCALE = 666.7
PWMGEN_TYPE = 2

Loop period is stock, 1 kilohertz. I've tried up to 4k, but it didn't 
help
> I don't think the fact that there is a worm gear matters.  The
> problem, I bet is the large inertia of the system.

Thats my assessment too. Throw in a bit of worm friction and it stops, 
still spitting out .1% to 1% drive, not enough to actually entice it to 
move once stopped.

> Aside from proper tuning of the PID gains you could change the system
> to use a nested or "cascade" PID.  THis allows the velocity setpoint
> to be controlled by the position error
> see the section "cascade" in the wiki article
> https://en.wikipedia.org/wiki/PID_controller

I looked at that 6 months ago, and quickly got lost.

> I think you want a very fast loop i=for the inner PID.  LIkely it
> wouldbe in external hardwarelike a microcontroller or FPGA.   (does
> MESA do the PID algorithm in the FPGA?  It should.)

But it doesn't that I know of.

Thanks Chris.

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 


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


Re: [Emc-users] more dc servo questions

2021-09-19 Thread Chris Albertson
Is the PID controller running on the PC under LCNC or is this an external
PID controller you built?

What are the numbers, the loop period, motor speed and numer of encoder
lines. and so on?

I don't think the fact that there is a worm gear matters.  The problem, I
bet is the large inertia of the system.

Aside from proper tuning of the PID gains you could change the system to
use a nested or "cascade" PID.  THis allows the velocity setpoint to be
controlled by the position error
see the section "cascade" in the wiki article
https://en.wikipedia.org/wiki/PID_controller

I think you want a very fast loop i=for the inner PID.  LIkely it
wouldbe in external hardwarelike a microcontroller or FPGA.   (does MESA do
the PID algorithm in the FPGA?  It should.)



On Sun, Sep 19, 2021 at 3:39 PM Gene Heskett  wrote:

> Greetings all;
> As most of you know, I built a servo from scratch for a BS-1.
>
> But I am not at all happy with its performance.
> It is a motor with a worm output, driving the worm of the bs-1. And it
> has an A/B quad encoder in it.
>
> But I must rather severely limit its run speed because the PID doesn't
> see the null coming near fast enough to slow it and stop a couple
> arcseconds early. I can't allow it to use reverse to stop as the motor
> seems to be a near short circuit then, crowbarring the power supply,
> causing a 2 to 3 minute dead time for the 450 watt psu to cool, so I
> must limit its speed to disallow its use of reverse to accomplish the
> stop.  With 2 worms in series the scale for a 360 degree full turn is of
> coarse huge.  If it could be throttled to a gradual stop by anticipating
> the coming null, I could probably run it 2 to 4x faster for a cruising
> speed.
>
> So my question is, which of the pid inputs would if raised, better
> anticipate the approaching null, slowing it over the last 5 angular
> minutes of a turn, ideally to a stop within an arc-second of the command
> from the gcode?
>
> Thanks all.
>
> 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 
>
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>


-- 

Chris Albertson
Redondo Beach, California

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


[Emc-users] more dc servo questions

2021-09-19 Thread Gene Heskett
Greetings all;
As most of you know, I built a servo from scratch for a BS-1.

But I am not at all happy with its performance.
It is a motor with a worm output, driving the worm of the bs-1. And it 
has an A/B quad encoder in it.

But I must rather severely limit its run speed because the PID doesn't 
see the null coming near fast enough to slow it and stop a couple 
arcseconds early. I can't allow it to use reverse to stop as the motor 
seems to be a near short circuit then, crowbarring the power supply, 
causing a 2 to 3 minute dead time for the 450 watt psu to cool, so I 
must limit its speed to disallow its use of reverse to accomplish the 
stop.  With 2 worms in series the scale for a 360 degree full turn is of 
coarse huge.  If it could be throttled to a gradual stop by anticipating 
the coming null, I could probably run it 2 to 4x faster for a cruising 
speed.

So my question is, which of the pid inputs would if raised, better 
anticipate the approaching null, slowing it over the last 5 angular 
minutes of a turn, ideally to a stop within an arc-second of the command 
from the gcode?

Thanks all.

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 


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