Cannot make PWM work on MESA 7i96S

More
29 Jan 2023 20:58 #263185 by prochj51
Hi,

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.

Thanks
George 

File Attachment:

File Name: Alutex_pwm.hal
File Size:13 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
01 Feb 2023 13:30 #263438 by JT
I hope you mean you flashed the 7i96s with 7i96s_d.bin...

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.


JT

Please Log in or Create an account to join the conversation.

More
01 Feb 2023 15:38 #263448 by PCW
That's correct, standard 7I96S firmware (7i96s_d.bin) has only 1 PWM generator and its
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-)
Attachments:

Please Log in or Create an account to join the conversation.

More
02 Feb 2023 10:18 #263511 by prochj51
Perfect thanks. I would add it to support software file on your website.

Please Log in or Create an account to join the conversation.

More
02 Feb 2023 18:55 #263540 by PCW
Yes, I intend to, just have not gotten to it yet...

Please Log in or Create an account to join the conversation.

More
03 Feb 2023 17:08 - 03 Feb 2023 17:18 #263612 by motacosta
Hi all!  I have a doubt about the analog PWM output:I ran PNCconf with mesa 7i96s in a Sherline Chucker Lathe project (I'm completely new in Linuxcnc). I could set up the axis, spindle encoder and homing tests before wire up the control box. The current step is the spindle. If I understood correctly, the Analog output (default flash) needs to be powered with a DC signal and it will behave as a pot. That is why I could not measure any signal at Analog pins when turn on the spindle?I will replace the original Sherline DC spindle motor with an AC Servo in velocity mode. In this case, how to wire the 7i96s Analog output to the servo drive (pins 26 and 11)?

]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  

Last edit: 03 Feb 2023 17:18 by motacosta.

Please Log in or Create an account to join the conversation.

More
03 Feb 2023 20:21 - 03 Feb 2023 20:22 #263617 by PCW
Yes, the 7I96S analog output is a potentiometer replacement device
and supplies no power of its own. If the motor drive does not supply a
5V or 10V output for this purpose (most VFD drives do),  you must
supply an external 5 or 10V supply.
 
Last edit: 03 Feb 2023 20:22 by PCW.

Please Log in or Create an account to join the conversation.

More
26 May 2023 00:50 #272180 by Vector
Just in case this will help another wayward newb, because this thread comes up when one is searching to make heads-or-tails of a PWM power supply with a potentiometer or pot style control, where we want to wire it to the Mesa 7i96s and control spindle speed using LinuxCNC.

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

On/Off Control:
net spindle-enable => [HMOT](CARD0).outm.00.out-05


Hope that helps.
The following user(s) said Thank You: rodw, joshopoke

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.091 seconds
Powered by Kunena Forum