On Sunday 18 October 2020 22:21:11 Chris Albertson wrote:

> Gene,
>
> Read the first page of the data sheet.   It says near the end of the
> first page...
>
> *The speed of the motor can be controlled in all possible conditions
> by the
>
> > PWM up to kHz. In all cases, a low level state on the PWM pin will
> > turn off both the LSA and LSB switches. When PWM rises to a high
> > level, LSA or LSB turn on again depending on the input pin state.*
>
> What they are saying is that PWM acts like a master switch and when
> low it opens-circuits the entire h-bridge.  When PWM is high then
> whatever switches are turned on by INA and INB are as you'd expect.
> (Yes, they dropped the number of khz, a typo in the data sheet.)

So my thought to run it in mode 2 won't work, but the default mode 1 
will.  That puts a much brighter light on this. Yesterday I moved a 
bunch of stuff, but asking the 5i25 for a 2nd pwmgen will output it as 
pulse/dir thru the stock bob on the 5i25's p2 connector. Ditto for a 2nd 
encoder.

Using the unused gpio's on the 7i76 can be a puzzle as you have to go 
poking with a scope probe to find the signal you want, at the polarity 
you want.  There is no translation for the gpio's not used by your 
config.  And having that row of spindle stuff on TB4 winds up using only 
the enable because Jon's pwm-servo needs 12 volts to enable it. So I 
wind up using the pwm/dir signals directly from TB3. Just select the 
polarity you need.

> I've got a pile of these chips and this is exactly how they work  PWM
> controls the current in the motor and is effective speed control.   
> At about 10% PWM the motor starts to overcome its internal friction
> and starts to move at 100% the motor turns as if connected directly to
> a battery.
>
> An experiment you can try is to drive the VNH3 chip and some random
> motor you have using the same Arduino sketch linked fromPolulu's web
> site.  The sample ramps up and down the motor speed and reverse the
> direction and just keeps doing that.   Actually there is no reason to
> wire it up.  Just read the Code.   Or just trust that my pseudo-code
> below accurately describes the Arduino sketch
>
> # Ramp up the motor speed
> for j in range 0,,,400 {
>     output (PWM-pin, j)
>     delay(10 milliseconds)
> }
>
> The above is pretty much out of Polu's example code and make a motor
> spin slow then fast.
>
> If you have never used one of these h-bridge driver chips then get to
> know it outside of LCNC.  Try rubberbanding a pencil to the motor
> shaft and try and make it move like a windshield wiper blade using
> first principles, not connected to LCNC.  Just count encoder ticks and
> change directions.  A few GPIO pins on a Raspberry Pi or an Arduino
> and some wire is enough

Or 4 wires from the pwmgen.1 should do it, (gnd/pwm/dir-/dir+, with the 
dirs fed to enA and enB). +4 wires (power/ground/A/B) for the motors 
encoder, which I think is slow enough I won't have to bypass the opto 
junk on a SainSmart bob. I think. I've had to cut that bottle of cold 
molasses out before. I'll have to look at that bob, I may have already 
done that one.

dmesg says I am at least partially configured:
[521887.134683] hm2/hm2_5i25.0:     IO Pin 025 (P2-05): PWMGen #1, pin 
Out1 (Dir or Down) (Output)
[521887.134692] hm2/hm2_5i25.0:     IO Pin 026 (P2-06): PWMGen #1, pin 
Out0 (PWM or Up) (Output)
[521887.134699] hm2/hm2_5i25.0:     IO Pin 027 (P2-07): IOPort
[521887.134705] hm2/hm2_5i25.0:     IO Pin 028 (P2-08): IOPort
[521887.134712] hm2/hm2_5i25.0:     IO Pin 029 (P2-09): IOPort
[521887.134718] hm2/hm2_5i25.0:     IO Pin 030 (P2-10): IOPort
[521887.134726] hm2/hm2_5i25.0:     IO Pin 031 (P2-11): Encoder #1, pin 
Index (Input)
[521887.134734] hm2/hm2_5i25.0:     IO Pin 032 (P2-12): Encoder #1, pin B 
(Input)
[521887.134742] hm2/hm2_5i25.0:     IO Pin 033 (P2-13): Encoder #1, pin A 
(Input)


This conversation has put a much better light on this chip, thank you 
Chris.

One last Q since this pwmgen comes out of the 5i25 on p2, there is no 
complement to the dir signal available. Is one signal sufficient?

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