neeed help with additional pwm 6i25 and 7i76

More
24 Mar 2025 22:31 - 24 Mar 2025 22:34 #324841 by mmt
sorry spoke too soon

there are 4 pwm in the terminal command but hal stop on the pwm freq line. i tried it with a hyphen and an underscore

here is my relevant info
Configuration Name: HOSTMOT2

General configuration information:

  BoardName : MESA5I25
  FPGA Size: 9 KGates
  FPGA Pins: 144
  Number of IO Ports: 2
  Width of one I/O port: 17
  Clock Low frequency: 33.3333 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: 33.333 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: 33.333 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

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

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

  Module: QCount
  There are 2 of QCount in configuration
  Version: 2
  Registers: 5
  BaseAddress: 3000
  ClockFrequency: 33.333 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: 33.333 MHz
  Register Stride: 256 bytes
  Instance Stride: 64 bytes

  Module: StepGen
  There are 6 of StepGen in configuration
  Version: 2
  Registers: 10
  BaseAddress: 2000
  ClockFrequency: 33.333 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: 33.333 MHz
  Register Stride: 256 bytes
  Instance Stride: 4 bytes

Configuration pin-out:

IO Connections for P3
DB25 pin#             I/O   Pri. func    Sec. func        Chan     Sec. Pin func   Sec. Pin Dir

 1                      0   IOPort       StepGen          0        Dir/Table2      (Out)
14                      1   IOPort       StepGen          0        Step/Table1     (Out)
 2                      2   IOPort       StepGen          1        Dir/Table2      (Out)
15                      3   IOPort       StepGen          1        Step/Table1     (Out)
 3                      4   IOPort       StepGen          2        Dir/Table2      (Out)
16                      5   IOPort       StepGen          2        Step/Table1     (Out)
 4                      6   IOPort       PWM              0        Dir             (Out)
17                      7   IOPort       PWM              0        PWM             (Out)
 5                      8   IOPort       PWM              1        Dir             (Out)
 6                      9   IOPort       PWM              1        PWM             (Out)
 7                     10   IOPort       SSerial          0        TXData0         (Out)
 8                     11   IOPort       SSerial          0        RXData0         (In)
 9                     12   IOPort       SSerial          0        TXData1         (Out)
10                     13   IOPort       SSerial          0        RXData1         (In)
11                     14   IOPort       QCount           0        Quad-IDX        (In)
12                     15   IOPort       QCount           0        Quad-B          (In)
13                     16   IOPort       QCount           0        Quad-A          (In)

IO Connections for P2
DB25 pin#             I/O   Pri. func    Sec. func        Chan     Sec. Pin func   Sec. Pin Dir

 1                     17   IOPort       StepGen          3        Dir/Table2      (Out)
14                     18   IOPort       StepGen          3        Step/Table1     (Out)
 2                     19   IOPort       StepGen          4        Dir/Table2      (Out)
15                     20   IOPort       StepGen          4        Step/Table1     (Out)
 3                     21   IOPort       StepGen          5        Dir/Table2      (Out)
16                     22   IOPort       StepGen          5        Step/Table1     (Out)
 4                     23   IOPort       PWM              2        Dir             (Out)
17                     24   IOPort       PWM              2        PWM             (Out)
 5                     25   IOPort       PWM              3        Dir             (Out)
 6                     26   IOPort       PWM              3        PWM             (Out)
 7                     27   IOPort       SSerial          0        TXData2         (Out)
 8                     28   IOPort       SSerial          0        RXData2         (In)
 9                     29   IOPort       SSerial          0        TXData3         (Out)
10                     30   IOPort       SSerial          0        RXData3         (In)
11                     31   IOPort       QCount           1        Quad-IDX        (In)
12                     32   IOPort       QCount           1        Quad-B          (In)
13                     33   IOPort       QCount           1        Quad-A          (In)

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_pci config="num_encoders=1 num_pwmgens=1 num_stepgens=4 sserial_port_0=00xxxxxx"
setp    hm2_5i25.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.y,pid.z,pid.a,pid.s
loadrt pwmgen output_type=0

addf hm2_5i25.0.read          servo-thread
addf motion-command-handler   servo-thread
addf motion-controller        servo-thread
addf pid.x.do-pid-calcs       servo-thread
addf pid.y.do-pid-calcs       servo-thread
addf pid.z.do-pid-calcs       servo-thread
addf pid.a.do-pid-calcs       servo-thread
addf pid.s.do-pid-calcs       servo-thread
addf hm2_5i25.0.write         servo-thread

# external output signals

net shutter-output      => hm2_5i25.0.7i76.0.0.output-00
net laser-output        => hm2_5i25.0.7i76.0.0.output-01

# --- LASER POWER ---
setp   hm2_5i25.0.pwmgen.0.pwm_freq 1000
setp   hm2_5i25.0.pwmgen.0.scale 100
net pwm-output hm2_5i25.0.pwmgen.0
net pwm-enable <= motion.motion-enabled  => hm2_5i25.0.pwmgen.0.enable
Last edit: 24 Mar 2025 22:34 by mmt.

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

More
25 Mar 2025 00:22 - 25 Mar 2025 00:47 #324847 by PCW
try this:

setp   hm2_5i25.0.pwmgen.pwm_frequency 1000
setp   hm2_5i25.0.pwmgen.00.scale 100
net pwm-enable <= motion.motion-enabled  => hm2_5i25.0.pwmgen.00.enable
net pwm-output hm2_5i25.0.pwmgen.00.value

This assumes pwm-output is a signal that has the current desired PWM value


And delete this line:

loadrt pwmgen output_type=0

Note: if you have a issue with names, you can list all pwm related pin/parameter names with

halcmd show all | grep pwm

(when LinuxCNC is running)
Last edit: 25 Mar 2025 00:47 by PCW.

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

More
25 Mar 2025 20:17 - 25 Mar 2025 20:37 #324912 by mmt
now i have no idea what is going on.

with the 5i25_7i76x2_2pd loaded my hal does load the pwm without alarm (i have not checked actual output though) but my A(3) axis does not work. If i revert to 5i25_7i76x2 A axis is good but obviously no pwm

???

thanks
Last edit: 25 Mar 2025 20:37 by mmt.

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

More
25 Mar 2025 20:46 #324918 by mmt
another question

i know the standard io pins can not pwm very fast.

i only need 10K freq can they acheive that?

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

More
25 Mar 2025 20:54 #324919 by PCW

now i have no idea what is going on.

with the 5i25_7i76x2_2pd loaded my hal does load the pwm without alarm (i have not checked actual output though) but my A(3) axis does not work. If i revert to 5i25_7i76x2 A axis is good but obviously no pwm

???

thanks
 


There are only 3 stepgens per 7I76 in that configuration, so that's expected.
You probably need a  configuration with just 1 PWMgen per 7I76.

I can make one when I get a chance.

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

More
25 Mar 2025 20:56 #324920 by PCW

another question

i know the standard io pins can not pwm very fast.

i only need 10K freq can they acheive that?
 

Not likely, you need hardware PWM for that.

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

More
25 Mar 2025 21:01 #324921 by mmt
i am assuming by your lack of a firmware file one needs to be created. Is there a way I can do this ?

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

More
25 Mar 2025 21:03 #324922 by mmt
nevermind i got ahead of myself i now see you said you could create one. That would be much appreciated.

Thank you for all your help

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

More
25 Mar 2025 21:51 #324924 by PCW
5i25/6i25 firmware for 7i76X2 last stepgen (04) on each 7I76
replaced with a PWMgen


File Attachment:

File Name: 5i25_7i76x...3-25.zip
File Size:113 KB
Attachments:

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

More
25 Mar 2025 22:09 #324926 by mmt
Working good now. Thank you so much

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

Time to create page: 0.076 seconds
Powered by Kunena Forum