On Sun, 25 Oct 2020, Gene Heskett wrote:

Date: Sun, 25 Oct 2020 23:54:34 -0400
From: Gene Heskett <ghesk...@shentel.net>
Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
To: emc-developers@lists.sourceforge.net
Subject: Re: [Emc-developers] pwmgen, mesa version, man page is?

On Sunday 25 October 2020 22:51:15 Peter C. Wallace wrote:

On Sun, 25 Oct 2020, Gene Heskett wrote:
Date: Sun, 25 Oct 2020 21:50:25 -0400
From: Gene Heskett <ghesk...@shentel.net>
Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
To: EMC developers <emc-developers@lists.sourceforge.net>
Subject: [Emc-developers] pwmgen, mesa version, man page is?

Greetings all;

Some confusion about useing the mesa pwmgens in a 5i25 with the
5i25_7i76_1px2d.bit file loaded.  this bitfile fails to wire up the
dir output, but is as close to driveing a stock bob on p2 as there
is.

I dont think this is the case, Both PWMgens have direction outputs

If my tracing is correct, pwmgen.01's dir s/b on the std bob at Zdir,
adjacent to its output on Zstep from the pwmgen.01.  Its dir is nowhere
to be found that I can find. pwmgen.00 s/b step/dir4 in both polarities.
These may be working but I'm haveing a hard time correlating the mouse
clicks to check both and hold a meter or scope probe at the same time.

I just tried the 7i76_1px2d pinfile source code on a 7I92
and it works as expected:

setting PWM 00 or 01 to a 0.5 value results in a 50 % duty cycle waveform with DIR low

setting PWM 00 or 01 to -0.5 value results in a 50 % duty cycle waveform with DIR high




In order to use both pwmgens, I have added and ABS module for each
pwmgen, feeding it the pwmgen.xx.value, and using the sign bit
output in place of the missing pwmgen.01 mode=1 DIR line. But
because I needed both polarities to control the H-bridge, something
I can get out of pwmgen.00, I've swapped the spindle duties to
pwmgen.01 which only needs one dir signal, and put the A axis on
pwmgen.00 where I can get the complimentary DIRs out of TB3 on the
7i76D.

IF pwmgen.00 drives all 4 pins of stepgen4, which it should, I'll have
the signals I need to drive the olimex boards dir inputs. But I cannot
find the DIR from pwmgen.01 anyplace on the bob, hence the abs.S.sign
module.

It almost works. I can run the spindle either direction but it runs
it slightly rough because the pwm output is in groups of pulses,
making perhaps 20 pulses, then stopping for a few milliseconds, then
making another group of pulses. Looking at the encoder output with a
real scope, the speed variation is nearly 50% while averaging the
requested 100 revs.

I thought  my encoder was going out but its still tightly coupled to
the motor shaft, so there isn't any slippage unless its internal,
and I have about made up my mind to obtain another encoder.

Until I started up wireing up that car seat H-bridge from olymex to
drive the A axis as a servo. That motors encoder is wired up in hal,
but is not yet connected to the bobs inputs 1,2,3 for encoder.01's
IDX,encA,encB.  The IDX will be a switch on the BS-1, used for a
home switch, not wired up yet because the motor is yt to be mounte.

So there is not any A feedback.  For testing, pid.A.FF0 is 1, the
remaining pid inputs are all zero'd.

So theoreticly pid.A.output is straight thru from the [] keys.  The
cobbled up abs.A.sign works, giving a plus DIR signal to which ever
side of the top half of H-bridge you want the motor to run, while
the bottom half is pulsed by the pwm. And it switches the stepgen#3
outputs at exactly 0.00000 at the pwmgen.00.value just like I
expected.

But the pulses from that pwmgen.00 are coming out in groups, then
silence, basicly acting quite like the other pwmgen.01 now driving
the spindle rather noisily.

It sounds a bit like you have the wrong PWM mode set or a hardware
issue

mode 1 for both.

The PWM generator is described  in the hostmot2 manual page

Aha, the one place I've not looked recently.  And the first thing I note
is that the separate read and write of gpio isn't needed. So I took
those out.  And now the spindle only runs the first time, running wide
open ignoreing any further run commands until LCNC has been restarted.

I'll rescope the boot module and pwmgen outputs tomorrow first thing.

I'm stumped. The DC supplies running the cards are solid at 5.1 and
12.05 for field power.



Has anyone a clue what I might be fighting with? The FUNCTION's
shown in the man page I assume do not exist for the mesa versions,
so there are no addf lines for them.  Should there be?
There are these addf's first:
addf    hm2_5i25.0.read_gpio    servo-thread
addf    hm2_5i25.0.read         servo-thread
couple more pages of addf's
# and finally, update machine
addf   hm2_5i25.0.write_gpio    servo-thread
addf   hm2_5i25.0.write         servo-thread

I do note that hm2_5i25.0.dpll.phase-error-us is dancing wildly,
over about a +-50 range, much wilder than the other 2 machines that
have that pin in the halmeter menu. They are only showing a +-1 or 2
dance.
Removing the gpio read/writes did not seem to effect the above noisy
signal.  I wonder it the bios in that Dell uses Spread Spectrum?  Can
that screw it up? It sure screws up my portable phones until I've put
10-15 feet between them and that old Dell.

Thank you Peter.

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 <http://geneslinuxbox.net:6309/gene>


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

Peter Wallace
Mesa Electronics

(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.



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


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-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Peter Wallace
Mesa Electronics

(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.



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

Reply via email to