[Solved] Mesa 7i96 Spindle PWM

  • dubstar_04
  • dubstar_04's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
04 Jul 2025 12:01 - 06 Jul 2025 09:35 #331228 by dubstar_04
[Solved] Mesa 7i96 Spindle PWM was created by dubstar_04
I'm converting a lathe to run LinuxCNC, everything is working but the spindle.

I have flashed firmware: 7i96d_1pwm

Mesa flash output:
mesaflash --device 7i96 --addr 10.10.10.10 --readhmid

Configuration Name: HOSTMOT2

General configuration information:

  BoardName : MESA7I96
  FPGA Size: 9 KGates
  FPGA Pins: 144
  Number of IO Ports: 3
  Width of one I/O port: 17
  Clock Low frequency: 100.0000 MHz
  Clock High frequency: 200.0000 MHz
  IDROM Type: 3
  Instance Stride 0: 4
  Instance Stride 1: 64
  Register Stride 0: 256
  Register Stride 1: 256

Modules in configuration:

  Module: DPLL
  There are 1 of DPLL in configuration
  Version: 0
  Registers: 7
  BaseAddress: 7000
  ClockFrequency: 100.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: WatchDog
  There are 1 of WatchDog in configuration
  Version: 0
  Registers: 3
  BaseAddress: 0C00
  ClockFrequency: 100.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: IOPort
  There are 3 of IOPort in configuration
  Version: 0
  Registers: 5
  BaseAddress: 1000
  ClockFrequency: 100.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: PWM
  There are 1 of PWM in configuration
  Version: 0
  Registers: 5
  BaseAddress: 4100
  ClockFrequency: 200.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: StepGen
  There are 4 of StepGen in configuration
  Version: 2
  Registers: 10
  BaseAddress: 2000
  ClockFrequency: 100.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: QCount
  There are 1 of QCount in configuration
  Version: 2
  Registers: 5
  BaseAddress: 3000
  ClockFrequency: 100.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: SSerial
  There are 1 of SSerial in configuration
  Version: 0
  Registers: 6
  BaseAddress: 5B00
  ClockFrequency: 100.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 64 bytes

  Module: SSR
  There are 1 of SSR in configuration
  Version: 0
  Registers: 2
  BaseAddress: 7D00
  ClockFrequency: 100.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

  Module: LED
  There are 1 of LED in configuration
  Version: 0
  Registers: 1
  BaseAddress: 0200
  ClockFrequency: 100.000 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

Configuration pin-out:

IO Connections for TB3 -> 7I96_0
Pin#                  I/O   Pri. func    Sec. func        Chan     Sec. Pin func   Sec. Pin Dir

TB3-1                   0   IOPort       None           
TB3-2                   1   IOPort       None           
TB3-3                   2   IOPort       None           
TB3-4                   3   IOPort       None           
TB3-5                   4   IOPort       None           
TB3-6                   5   IOPort       None           
TB3-7                   6   IOPort       None           
TB3-8                   7   IOPort       None           
TB3-9                   8   IOPort       None           
TB3-10                  9   IOPort       None           
TB3-11                 10   IOPort       None           
TB3-13,14              11   IOPort       SSR              0        Out-00          (Out)
TB3-15,16              12   IOPort       SSR              0        Out-01          (Out)
TB3-17,18              13   IOPort       SSR              0        Out-02          (Out)
TB3-19,20              14   IOPort       SSR              0        Out-03          (Out)
TB3-21,22              15   IOPort       SSR              0        Out-04          (Out)
TB3-23,24              16   IOPort       SSR              0        Out-05          (Out)

IO Connections for TB1/TB2 -> 7I96_1
Pin#                  I/O   Pri. func    Sec. func        Chan     Sec. Pin func   Sec. Pin Dir

TB1-2,3                17   IOPort       StepGen          0        Step/Table1     (Out)
TB1-4,5                18   IOPort       StepGen          0        Dir/Table2      (Out)
TB1-8,9                19   IOPort       StepGen          1        Step/Table1     (Out)
TB1-10,11              20   IOPort       StepGen          1        Dir/Table2      (Out)
TB1-14,15              21   IOPort       StepGen          2        Step/Table1     (Out)
TB1-16,17              22   IOPort       StepGen          2        Dir/Table2      (Out)
TB1-20,21              23   IOPort       StepGen          3        Step/Table1     (Out)
TB1-22,23              24   IOPort       StepGen          3        Dir/Table2      (Out)
TB2-2,3                25   IOPort       PWM              0        PWM             (Out)
TB2-4,5                26   IOPort       PWM              0        Dir             (Out)
TB2-7,8                27   IOPort       QCount           0        Quad-A          (In)
TB2-10,11              28   IOPort       QCount           0        Quad-B          (In)
TB2-13,14              29   IOPort       QCount           0        Quad-IDX        (In)
TB2-16,17              30   IOPort       SSerial          0        RXData0         (In)
TB2-18,19              31   IOPort       SSerial          0        TXData0         (Out)
Internal-TXEn          32   IOPort       SSerial          0        TXEn0           (Out)
Internal               33   IOPort       SSR              0        AC Ref          (Out)

IO Connections for P1 -> 7I96_2
Pin#                  I/O   Pri. func    Sec. func        Chan     Sec. Pin func   Sec. Pin Dir

P1-01/DB25-01          34   IOPort       None           
P1-02/DB25-14          35   IOPort       None           
P1-03/DB25-02          36   IOPort       None           
P1-04/DB25-15          37   IOPort       None           
P1-05/DB25-03          38   IOPort       None           
P1-06/DB25-16          39   IOPort       None           
P1-07/DB25-04          40   IOPort       None           
P1-08/DB25-17          41   IOPort       None           
P1-09/DB25-05          42   IOPort       None           
P1-11/DB25-06          43   IOPort       None           
P1-13/DB25-07          44   IOPort       None           
P1-15/DB25-08          45   IOPort       None           
P1-17/DB25-09          46   IOPort       None           
P1-19/DB25-10          47   IOPort       None           
P1-21/DB25-11          48   IOPort       None           
P1-23/DB25-12          49   IOPort       None           
P1-25/DB25-13          50   IOPort       None          



Connections:
Pin TB2-1 -> GND
Pin TB2-3 > PWM+

I'm not getting anything out of pwm to analog boards. I have tried 5 different convertor boards with the same result. Before I invest in a scope or a new mesa board can anyone spot anything wrong with the config?

Thank you,
Dan
Attachments:
Last edit: 06 Jul 2025 09:35 by dubstar_04.

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

More
04 Jul 2025 16:16 #331249 by PCW
Replied by PCW on topic Mesa 7i96 Spindle PWM
When LinuxCNC is running and you have the spindle on and set to say 1/2 speed.
what does:

halcmd show all spin*

report?

Also, you can get an idea of PWM operation independent of any add-on cards
with just a voltmeter, as the voltmeter will read the average voltage which will
be proportional to the PWM duty cycle.

 
The following user(s) said Thank You: dubstar_04

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

  • dubstar_04
  • dubstar_04's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
04 Jul 2025 16:53 #331251 by dubstar_04
Replied by dubstar_04 on topic Mesa 7i96 Spindle PWM
Hi PCW,

Thank you for the quick response.

halcmd show all spin*
Loaded HAL Components:
ID      Type  Name                                            PID   State

Component Pins:
Owner   Type  Dir         Value  Name
    29  bit   IN          FALSE  spindle.0.amp-fault-in
    29  bit   IN           TRUE  spindle.0.at-speed <== spindle-at-speed
    29  bit   OUT         FALSE  spindle.0.brake ==> spindle-brake
    29  bit   OUT          TRUE  spindle.0.forward ==> spindle-cw
    29  bit   I/O         FALSE  spindle.0.index-enable <=> spindle-index-enable
    29  bit   IN          FALSE  spindle.0.inhibit
    29  bit   IN          FALSE  spindle.0.is-oriented
    29  bit   OUT         FALSE  spindle.0.locked
    29  bit   OUT          TRUE  spindle.0.on ==> spindle-enable
    29  bit   OUT         FALSE  spindle.0.orient
    29  float OUT             0  spindle.0.orient-angle
    29  s32   IN              0  spindle.0.orient-fault
    29  s32   OUT             0  spindle.0.orient-mode
    29  bit   OUT         FALSE  spindle.0.reverse ==> spindle-ccw
    29  float IN             -0  spindle.0.revs <== spindle-revs
    29  float OUT      29.16667  spindle.0.speed-cmd-rps
    29  float IN              0  spindle.0.speed-in <== spindle-vel-fb-rps
    29  float OUT          1750  spindle.0.speed-out ==> spindle-vel-cmd-rpm
    29  float OUT          1750  spindle.0.speed-out-abs ==> spindle-vel-cmd-rpm-abs
    29  float OUT      29.16667  spindle.0.speed-out-rps ==> spindle-vel-cmd-rps
    29  float OUT      29.16667  spindle.0.speed-out-rps-abs ==> spindle-vel-cmd-rps-abs

Pin Aliases:
 Alias                                            Original Name

Signals:
Type          Value  Name     (linked to)
bit            TRUE  spindle-at-speed
                         ==> gmoccapy.spindle_at_speed_led
                         ==> spindle.0.at-speed
bit           FALSE  spindle-brake
                         <== spindle.0.brake
bit           FALSE  spindle-ccw
                         <== spindle.0.reverse
bit            TRUE  spindle-cw
                         <== spindle.0.forward
bit            TRUE  spindle-enable
                         ==> hm2_7i96.0.pwmgen.00.enable
                         ==> hm2_7i96.0.ssr.00.out-05
                         ==> pid.s.enable
                         <== spindle.0.on
bit           FALSE  spindle-index-enable
                         <=> hm2_7i96.0.encoder.00.index-enable
                         ==> pid.s.index-enable
                         <=> spindle.0.index-enable
bit           FALSE  spindle-manual-ccw
                         ==> halui.spindle.0.reverse
bit           FALSE  spindle-manual-cw
                         ==> halui.spindle.0.forward
bit           FALSE  spindle-manual-stop
                         ==> halui.spindle.0.stop
float          1750  spindle-output
                         ==> hm2_7i96.0.pwmgen.00.value
                         <== pid.s.output
float            -0  spindle-revs
                         <== hm2_7i96.0.encoder.00.position
                         ==> spindle.0.revs
float          1750  spindle-vel-cmd-rpm
                         <== spindle.0.speed-out
float          1750  spindle-vel-cmd-rpm-abs
                         ==> pid.s.command
                         <== spindle.0.speed-out-abs
float      29.16667  spindle-vel-cmd-rps
                         <== spindle.0.speed-out-rps
float      29.16667  spindle-vel-cmd-rps-abs
                         <== spindle.0.speed-out-rps-abs
float             0  spindle-vel-fb-rpm
                         <== hm2_7i96.0.encoder.00.velocity-rpm
float             0  spindle-vel-fb-rpm-abs
                         ==> pid.s.feedback
float             0  spindle-vel-fb-rps
                         <== hm2_7i96.0.encoder.00.velocity
                         ==> spindle.0.speed-in

Parameters:
Owner   Type  Dir         Value  Name

Parameter Aliases:
 Alias                                            Original Name

Exported Functions:
Owner   CodeAddr  Arg       FP   Users  Name

Realtime Threads:
     Period  FP     Name               (     Time, Max-Time )

Measuring the pwm pin output shows 1.1v at 50% speed and 2.2v at 100%, 0 volt when the spindle is off.

Thank you,

Dan
 

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

More
04 Jul 2025 17:06 #331252 by PCW
Replied by PCW on topic Mesa 7i96 Spindle PWM
If you set the PWM to 0 and invert the PWM output
do you get ~5V?

to invert:

halcmd setp hm2_7i96.0.pwmgen.00.out0.invert_output true



 
The following user(s) said Thank You: dubstar_04

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

  • dubstar_04
  • dubstar_04's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
04 Jul 2025 17:15 #331253 by dubstar_04
Replied by dubstar_04 on topic Mesa 7i96 Spindle PWM
With the output inverted the pwm output is 2.2v without the spindle running.

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

More
04 Jul 2025 18:07 - 04 Jul 2025 18:14 #331254 by PCW
Replied by PCW on topic Mesa 7i96 Spindle PWM
Sounds like the output has been damaged...

You might check the step- output (TB2 pin 2)

(as a sanity check, STEP- should be at ~5V when STEP+ is 0)

 
Last edit: 04 Jul 2025 18:14 by PCW.
The following user(s) said Thank You: dubstar_04

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

  • dubstar_04
  • dubstar_04's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
04 Jul 2025 18:23 #331258 by dubstar_04
Replied by dubstar_04 on topic Mesa 7i96 Spindle PWM
There is no output at all on TB2-2.

Is it possible to move the PWM to one of the other stepgens? eg. TB1-20/21?

Thanks,

Dan

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

More
04 Jul 2025 19:44 #331262 by PCW
Replied by PCW on topic Mesa 7i96 Spindle PWM
 

File Attachment:

File Name: 7i96s_2pwm...7-04.zip
File Size:248 KB


7I96 bitfile with 2 PWMGens

Looks like the 74ACT04 (U17) was damaged
Attachments:
The following user(s) said Thank You: dubstar_04

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

  • dubstar_04
  • dubstar_04's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
04 Jul 2025 19:51 #331264 by dubstar_04
Replied by dubstar_04 on topic Mesa 7i96 Spindle PWM
Amazing! Thank you! 

I don't know the history of the board. Bought it cheap on eBay many years ago. It would be great if I can manage to use it, if not a 7I96S would probably suit my needs better.

Thanks again,

Dan

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

  • dubstar_04
  • dubstar_04's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
05 Jul 2025 08:00 #331303 by dubstar_04
Replied by dubstar_04 on topic Mesa 7i96 Spindle PWM
Hi Peter,

Is the file you uploaded correct? It is listed as 7I96S and I can't seem to find a .bit file.

Thanks,

Dan

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

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