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 <dengv...@charter.net> 
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&linkCode=df0&hvadid=1980
> >90929431&hvpos=&hvnetw=g&hvrand=9099973595926304313&hvpone=&hvptwo=&h
> >vqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9031026&hvtargid=pla-40367
> >6040447&psc=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 happppens 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
> > > <ghesk...@shentel.net>
> >
> > 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
> > >>>>> <ghesk...@shentel.net>
> > >>>>
> > >>>> 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 360000 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 <http://geneslinuxbox.net:6309/gene>
> > >>
> > >>
> > >> _______________________________________________
> > >> 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


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