Mesa 7i96 with SPINX1 to control spindle speed
- kbec
- Offline
- Premium Member
Less
More
- Posts: 132
- Thank you received: 4
22 Feb 2022 22:50 #235563
by kbec
Replied by kbec on topic Mesa 7i96 with SPINX1 to control spindle speed
I saw where one issue was the quotes, the other issue was the SPINDLE_0 and the brackets. I saw where in the ini file, the section is SPINDLE with no number, so I changed that too.
I also got this error:
./io.hal:4: Pin 'spindle.0.on' was already linked to signal 'spindle-enable'
So I commented out this line:
#net spindle-enable <= spindle.0.on
It seems defined in the io.hal
net spindle-on spindle.0.on => hm2_7i96.0.ssr.00.out-00
After that,I got linuxcnc running, but I still don't see the LED for speed lighting up.
I also got this error:
./io.hal:4: Pin 'spindle.0.on' was already linked to signal 'spindle-enable'
So I commented out this line:
#net spindle-enable <= spindle.0.on
It seems defined in the io.hal
net spindle-on spindle.0.on => hm2_7i96.0.ssr.00.out-00
After that,I got linuxcnc running, but I still don't see the LED for speed lighting up.
Please Log in or Create an account to join the conversation.
- PCW
- Offline
- Moderator
Less
More
- Posts: 17907
- Thank you received: 4794
22 Feb 2022 23:01 #235564
by PCW
Replied by PCW on topic Mesa 7i96 with SPINX1 to control spindle speed
The reason that you have no PWM is that the PWM generator pins
and setup parameters are not present in the hal file
and setup parameters are not present in the hal file
Please Log in or Create an account to join the conversation.
- kbec
- Offline
- Premium Member
Less
More
- Posts: 132
- Thank you received: 4
22 Feb 2022 23:25 #235566
by kbec
Replied by kbec on topic Mesa 7i96 with SPINX1 to control spindle speed
I am kind of lost now, I am not sure where the wires need to go, or why the PWM isn't in the HAL.
In the firmware part I see:
IO Connections for TB1/TB2
Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir
5 25 IOPort PWM 0 PWM (Out)
6 26 IOPort PWM 0 Dir (Out)
But in the tool, on the pin tab,
TB2
6 +5v
5 Dir +
4 Dir -
3 PWM +
2 PWM -
1 Ground
I also see this:
mesaflash --device 7i96 --addr 192.168.1.121 --readhmid
...
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
I am not sure why the config tool isn't putting the PWM signals in there. I do notice it pulls the card ip when I load the ini, but the Board configuration goes to 5 step gens, even though I saved it at 4, and the Step Gens, Encoders, and Spindle PWM revert to Default.
In the firmware part I see:
IO Connections for TB1/TB2
Pin# I/O Pri. func Sec. func Chan Pin func Pin Dir
5 25 IOPort PWM 0 PWM (Out)
6 26 IOPort PWM 0 Dir (Out)
But in the tool, on the pin tab,
TB2
6 +5v
5 Dir +
4 Dir -
3 PWM +
2 PWM -
1 Ground
I also see this:
mesaflash --device 7i96 --addr 192.168.1.121 --readhmid
...
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
I am not sure why the config tool isn't putting the PWM signals in there. I do notice it pulls the card ip when I load the ini, but the Board configuration goes to 5 step gens, even though I saved it at 4, and the Step Gens, Encoders, and Spindle PWM revert to Default.
Please Log in or Create an account to join the conversation.
- PCW
- Offline
- Moderator
Less
More
- Posts: 17907
- Thank you received: 4794
22 Feb 2022 23:54 #235567
by PCW
Replied by PCW on topic Mesa 7i96 with SPINX1 to control spindle speed
Those are config tool issues (or maybe how it expects its input data)
I can cobble together a working PWM setup to add to your hal file
Could you post your ini file also so I can use and setup values
there rather than put them all in the hal file
I can cobble together a working PWM setup to add to your hal file
Could you post your ini file also so I can use and setup values
there rather than put them all in the hal file
Please Log in or Create an account to join the conversation.
- kbec
- Offline
- Premium Member
Less
More
- Posts: 132
- Thank you received: 4
23 Feb 2022 00:15 #235569
by kbec
Replied by kbec on topic Mesa 7i96 with SPINX1 to control spindle speed
I had to change the extension for the ini to txt. Thanks
Attachments:
Please Log in or Create an account to join the conversation.
- PCW
- Offline
- Moderator
Less
More
- Posts: 17907
- Thank you received: 4794
23 Feb 2022 01:19 - 23 Feb 2022 01:21 #235572
by PCW
Replied by PCW on topic Mesa 7i96 with SPINX1 to control spindle speed
Ahh, I think Johns utility has an additional hal file for connections
perhaps io.hal? I would need to see that also
Here are some needed changes in the SPINDLE section of the ini file:
[SPINDLE]
OUTPUT_TYPE = 1
SCALE = 2800
PWM_FREQUENCY = 5000
MAX_RPM = 2800
MIN_RPM = 70
DEADBAND = 0
P = 0
I = 0
D = 0
FF0 = 1
FF1 = 0
FF2 = 0
BIAS = 0
MAX_ERROR = 0
And at minimum in the hal file, replace:
net spindle-vel-cmd-rpm => pid.1.command
with
net spindle-vel-cmd-rpm-abs => pid.1.command
perhaps io.hal? I would need to see that also
Here are some needed changes in the SPINDLE section of the ini file:
[SPINDLE]
OUTPUT_TYPE = 1
SCALE = 2800
PWM_FREQUENCY = 5000
MAX_RPM = 2800
MIN_RPM = 70
DEADBAND = 0
P = 0
I = 0
D = 0
FF0 = 1
FF1 = 0
FF2 = 0
BIAS = 0
MAX_ERROR = 0
And at minimum in the hal file, replace:
net spindle-vel-cmd-rpm => pid.1.command
with
net spindle-vel-cmd-rpm-abs => pid.1.command
Last edit: 23 Feb 2022 01:21 by PCW.
Please Log in or Create an account to join the conversation.
- kbec
- Offline
- Premium Member
Less
More
- Posts: 132
- Thank you received: 4
23 Feb 2022 01:25 #235573
by kbec
Replied by kbec on topic Mesa 7i96 with SPINX1 to control spindle speed
io.hal just has the one line:
net spindle-on spindle.0.on => hm2_7i96.0.ssr.00.out-00
net spindle-on spindle.0.on => hm2_7i96.0.ssr.00.out-00
Please Log in or Create an account to join the conversation.
- kbec
- Offline
- Premium Member
Less
More
- Posts: 132
- Thank you received: 4
23 Feb 2022 01:40 #235574
by kbec
Replied by kbec on topic Mesa 7i96 with SPINX1 to control spindle speed
Can you tell what pins I should have my PWM and Dir plugged into to go to the spinx? I am confused as to the config tool and firmware differs, and not really sure how to trace it in the hal files if I even can.
thanks again
thanks again
Please Log in or Create an account to join the conversation.
- PCW
- Offline
- Moderator
Less
More
- Posts: 17907
- Thank you received: 4794
23 Feb 2022 01:46 #235575
by PCW
Replied by PCW on topic Mesa 7i96 with SPINX1 to control spindle speed
Step4+ to 7I96 PWM, Dir4+ to Dir
Also I was wrong about
net spindle-vel-cmd-rpm => pid.1.command
Thats correct because the PWM sign determines the direction output
Here is a first shot of what's missing (in io.hal):
net spindle-on spindle.0.on => hm2_7i96.0.ssr.00.out-00
net spindle-on => hm2_7i96.0.pwmgen.00.enable
net spindle-output => hm2_7i96.0.pwmgen.00.value
setp hm2_7i96.0.pwmgen.pwm_frequency [SPINDLE]PWM_FREQUENCY
setp hm2_7i96.0.pwmgen.00.scale [SPINDLE]SCALE
Also I was wrong about
net spindle-vel-cmd-rpm => pid.1.command
Thats correct because the PWM sign determines the direction output
Here is a first shot of what's missing (in io.hal):
net spindle-on spindle.0.on => hm2_7i96.0.ssr.00.out-00
net spindle-on => hm2_7i96.0.pwmgen.00.enable
net spindle-output => hm2_7i96.0.pwmgen.00.value
setp hm2_7i96.0.pwmgen.pwm_frequency [SPINDLE]PWM_FREQUENCY
setp hm2_7i96.0.pwmgen.00.scale [SPINDLE]SCALE
Please Log in or Create an account to join the conversation.
- kbec
- Offline
- Premium Member
Less
More
- Posts: 132
- Thank you received: 4
23 Feb 2022 02:04 #235578
by kbec
Replied by kbec on topic Mesa 7i96 with SPINX1 to control spindle speed
I made all the changes, the LED still isn't lighting up, here is some debug output I see in on my screen if it helps any:
iov2:ESTOP changed to 0
EMC_TOOL_ABORT reason=5
Issuing EMC_TASK_PLAN_SYNCH -- ( +516,+24, +0,)
emcTaskPlanSynch() returned 0
Issuing EMC_TASK_SET_STATE -- ( +505,+24, +12, +4,)
hm2/hm2_7i96.0: stepgen.00.maxvel is too big for current step timings & position-scale, clipping to max possible
hm2/hm2_7i96.0: stepgen.00.maxvel is too big for current step timings & position-scale, clipping to max possible
EMC_LUBE_ON
Issuing EMC_SPINDLE_ON -- ( +1304,+64, +13,1.000000,0.000000,0.000000, +1,)
Issuing EMC_SPINDLE_INCREASE -- ( +1309,+40, +14,0.000000,)
Issuing EMC_SPINDLE_CONSTANT -- ( +1311,+40, +15,0.000000,)
Issuing EMC_SPINDLE_DECREASE -- ( +1310,+40, +16,0.000000,)
Issuing EMC_SPINDLE_CONSTANT -- ( +1311,+40, +17,0.000000,)
Issuing EMC_SPINDLE_DECREASE -- ( +1310,+40, +18,0.000000,)
Issuing EMC_SPINDLE_CONSTANT -- ( +1311,+40, +19,0.000000,)
Issuing EMC_SPINDLE_INCREASE -- ( +1309,+40, +20,0.000000,)
Issuing EMC_SPINDLE_CONSTANT -- ( +1311,+40, +21,0.000000,)
Issuing EMC_SPINDLE_OFF -- ( +1305,+32, +22,)
Issuing EMC_SPINDLE_ON -- ( +1304,+64, +23,-1.000000,0.000000,0.000000, +1,)
Issuing EMC_SPINDLE_OFF -- ( +1305,+32, +24,)
Issuing EMC_TASK_SET_STATE -- ( +505,+24, +25, +3,)
EMC_TOOL_ABORT reason=4
NML_INTERP_LIST(0x55cc35f128c0)::clear(): discarding 0 items
NML_INTERP_LIST(0x55cc35f128c0)::append(nml_msg_ptr{size=24,type=EMC_TASK_PLAN_SYNCH}) : list_size=1, line_number=0
emcTaskPlanSynch() returned 0
NML_INTERP_LIST(0x55cc35f128c0)::get(): {size=24, type=EMC_TASK_PLAN_SYNCH}, list_size=0
emcTaskPlanLevel() returned 0
NML_INTERP_LIST(0x55cc35f128c0)::clear(): discarding 0 items
NML_INTERP_LIST(0x55cc35f128c0)::append(nml_msg_ptr{size=24,type=EMC_TASK_PLAN_SYNCH}) : list_size=1, line_number=0
task: main loop took 0.111895 seconds
NML_INTERP_LIST(0x55cc35f128c0)::get(): {size=24, type=EMC_TASK_PLAN_SYNCH}, list_size=0
emcTaskPlanLevel() returned 0
EMC_TOOL_ABORT reason=7
Issuing EMC_TASK_PLAN_SYNCH -- ( +516,+24, +0,)
iov2:ESTOP changed to 0
EMC_TOOL_ABORT reason=5
Issuing EMC_TASK_PLAN_SYNCH -- ( +516,+24, +0,)
emcTaskPlanSynch() returned 0
Issuing EMC_TASK_SET_STATE -- ( +505,+24, +12, +4,)
hm2/hm2_7i96.0: stepgen.00.maxvel is too big for current step timings & position-scale, clipping to max possible
hm2/hm2_7i96.0: stepgen.00.maxvel is too big for current step timings & position-scale, clipping to max possible
EMC_LUBE_ON
Issuing EMC_SPINDLE_ON -- ( +1304,+64, +13,1.000000,0.000000,0.000000, +1,)
Issuing EMC_SPINDLE_INCREASE -- ( +1309,+40, +14,0.000000,)
Issuing EMC_SPINDLE_CONSTANT -- ( +1311,+40, +15,0.000000,)
Issuing EMC_SPINDLE_DECREASE -- ( +1310,+40, +16,0.000000,)
Issuing EMC_SPINDLE_CONSTANT -- ( +1311,+40, +17,0.000000,)
Issuing EMC_SPINDLE_DECREASE -- ( +1310,+40, +18,0.000000,)
Issuing EMC_SPINDLE_CONSTANT -- ( +1311,+40, +19,0.000000,)
Issuing EMC_SPINDLE_INCREASE -- ( +1309,+40, +20,0.000000,)
Issuing EMC_SPINDLE_CONSTANT -- ( +1311,+40, +21,0.000000,)
Issuing EMC_SPINDLE_OFF -- ( +1305,+32, +22,)
Issuing EMC_SPINDLE_ON -- ( +1304,+64, +23,-1.000000,0.000000,0.000000, +1,)
Issuing EMC_SPINDLE_OFF -- ( +1305,+32, +24,)
Issuing EMC_TASK_SET_STATE -- ( +505,+24, +25, +3,)
EMC_TOOL_ABORT reason=4
NML_INTERP_LIST(0x55cc35f128c0)::clear(): discarding 0 items
NML_INTERP_LIST(0x55cc35f128c0)::append(nml_msg_ptr{size=24,type=EMC_TASK_PLAN_SYNCH}) : list_size=1, line_number=0
emcTaskPlanSynch() returned 0
NML_INTERP_LIST(0x55cc35f128c0)::get(): {size=24, type=EMC_TASK_PLAN_SYNCH}, list_size=0
emcTaskPlanLevel() returned 0
NML_INTERP_LIST(0x55cc35f128c0)::clear(): discarding 0 items
NML_INTERP_LIST(0x55cc35f128c0)::append(nml_msg_ptr{size=24,type=EMC_TASK_PLAN_SYNCH}) : list_size=1, line_number=0
task: main loop took 0.111895 seconds
NML_INTERP_LIST(0x55cc35f128c0)::get(): {size=24, type=EMC_TASK_PLAN_SYNCH}, list_size=0
emcTaskPlanLevel() returned 0
EMC_TOOL_ABORT reason=7
Issuing EMC_TASK_PLAN_SYNCH -- ( +516,+24, +0,)
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.080 seconds