Cannot make PWM work on MESA 7i96S
I succesfully flash 7i96_d.bin file to Mesa 7i96S. I think I correctly configure the hafile, so I should see voltage change when I turn on PWM, on TB2 (STEP/DIR4 slot), but I cannot detect any change with Voltmeter. I turn the laser by M64 to digital pin.
No error from linuxcnc and halshow correctly shows the pwmgen.enable is true.
I measured voltage between STEP- and GND, also tried with STEP+ and GND. But no change. I set value to 1. So with Scale 1 I would expect 100percent cycle so the voltage should be 5V and 0V when disabled.
Hal file attached.
File Attachment:File Name: Alutex_pwm.hal
File Size:13 KB
PWM is on the spindle.
ANALOG SPINDLE INTERFACE
The 7I96S provides one analog output for spindle control. The analog output is a
isolated potentiometer replacement type device. It functions like a potentiometer with
SPINDLE+ being one end of the potentiometer, SPINDLE OUT being the wiper and
SPINDLE- being the other end. The voltage on SPINDLE OUT can be set to any voltage
between SPINDLE- and SPINDLE+. Polarity and voltage range must always be observed
for proper operation. The voltage supplied between SPINDLE+ and SPINDLE- must be
between 5VDC an 18VDC with SPINDLE + always being more positive than SPINDLE-.
Because the analog output is isolated, bipolar output is possible, for example with
SPINDLE+ connected to 5V and SPINDLE- connected to -5V, a +-5V analog output range
is created. In this case the spindle PWM must be offset so that 50% of full scale is output
when a 0V output is required. Note that if bipolar output is used, the output will be forced
to SPINDLE- at startup.
The analog output is driven by a FPGA PWM output (normally PWM 0). Optimum
PWM frequency is 10-20 KHz but frequencies from 5 KHz to 50 KHz are acceptable, lower
frequencies will have higher output ripple and higher frequencies will have worse linearity.
wired to the analog output on TB2.
Here is 7I96S firmware with 2 PWMGens:
File Attachment:File Name: 7i96s_2pwmd.zip
File Size:250 KB
(PWMGen 0 is wired to the analog output as usual and PWMGen 1 is wired to STEP4+/STEP4-)
]JT post=263438 userid=32471I hope you mean you flashed the 7i96s with 7i96s_d.bin...PWM is on the spindle.
ANALOG SPINDLE INTERFACEThe 7I96S provides one analog output for spindle control. The analog output is aisolated potentiometer replacement type device. It functions like a potentiometer withSPINDLE being one end of the potentiometer, SPINDLE OUT being the wiper andSPINDLE- being the other end. The voltage on SPINDLE OUT can be set to any voltagebetween SPINDLE- and SPINDLE . Polarity and voltage range must always be observedfor proper operation. The voltage supplied between SPINDLE and SPINDLE- must bebetween 5VDC an 18VDC with SPINDLE always being more positive than SPINDLE-.Because the analog output is isolated, bipolar output is possible, for example withSPINDLE connected to 5V and SPINDLE- connected to -5V, a -5V analog output rangeis created. In this case the spindle PWM must be offset so that 50% of full scale is outputwhen a 0V output is required. Note that if bipolar output is used, the output will be forcedto SPINDLE- at startup.The analog output is driven by a FPGA PWM output (normally PWM 0). OptimumPWM frequency is 10-20 KHz but frequencies from 5 KHz to 50 KHz are acceptable, lowerfrequencies will have higher output ripple and higher frequencies will have worse linearity.JT
In my case, a cheap PSU for a cheap spindle has a three wire connection for the potentiometer. If you put your voltmeter on those, you can determine which one is ground, which one is 10V (approximate) and which one is the variable "signal" output of 0-10V depending on how you crank your potentiometer. Hopefully there is also a on/off switch, which in my case (cheap PSU, remember) was a wire screwed between two terminals marked on/off (so, as shipped, always on).
If this is basically what you are looking at, then read on:
To wire it to the Mesa 7i96s:
For speed control:
On the TB2 Connector grouping, nearest to the "TB2" label, is the grouping of 4 analog outs for spindle control.
Wire the 0V to Terminal 22 = Spindle - , marked on the board as "SPIN-"
Wire the Signal to Terminal 23 = Spindle Out, marked on the board as "SPINOUT"
Wire the 10V to Terminal 24 = Spindle +, marked on the board as "SPIN+"
For on/off control: (which is a good safety feature, I recommend this)
On the TB3 Connector grouping, nearest to the "TB3" label, are outputs. Numbers 4A & 4B, as well as 5A & 5B are means to close a switch. Ie, when you turn these on, they close a switch, if you turn them off, the switch opens. However, you cannot run much current through them. Yyou can substitute both 4A/4B below for 5A/5B.)
Wire one of the On/Off terminals through a 1/4 amp fuse to Terminal 23 = "OUT5A"
Wire the other one of the On/Off terminals to Terminal 24 = "OUT5B"
Then in the Pncconf wizard: (Note that this was on LinuxCNC ver 2.9.0~pre)
Once you've navigated through the wizard to the Mesa card page, there will be a page that has several tabs for the different connector groupings on the Mesa 7i96s card.
For speed control:
On the TB1/TB2 page, it can be confusing, but the option is the right-hand-lower Num0: change "Unused PWM Gen" to "Spindle PWM" with the default option of "PWM GEN-P.
For On/Off control:
On the TB3 page, find the right-column "outputs" and change Num 05 from Not Used to Spindle > Spindle Enable.
The actual .hal code that does the linuxcnc signals to Mesa Wiring is:
(Note for newbs, this code is for understanding how what is written in the .hal file affects what is signalling to the hardware: this is not sufficient to get a working setup, because there are software internal connections that have to be made as well. The pncconf wizard is nearly essential for getting it all done.)
For speed control:
setp [HMOT](CARD0).pwmgen.00.output-type 1 setp [HMOT](CARD0).pwmgen.00.scale [SPINDLE_0]OUTPUT_SCALE net spindle-vel-cmd-rpm => [HMOT](CARD0).pwmgen.00.value net spindle-enable => [HMOT](CARD0).pwmgen.00.enable
net spindle-enable => [HMOT](CARD0).outm.00.out-05
Hope that helps.