- Posts: 42
- Thank you received: 0
7i76: pwm output stuck high
6 years 6 months ago #163591
by johnbl
7i76: pwm output stuck high was created by johnbl
Hi,
I have a 7i96+7i76 combo, and have a PWM fan connected to one the StepGen (converted to PWM) outputs on the 7i76.
I use the following to control the fan in LinuxCNC:
When the boards are powered on, the pwm output is off as expected.
However when I quit LinuxCNC, or make a mistake in my config and LCNC fails to start, the pwm output is stuck high, and the fan spins like crazy. Is this expected?
I have a 7i96+7i76 combo, and have a PWM fan connected to one the StepGen (converted to PWM) outputs on the 7i76.
I use the following to control the fan in LinuxCNC:
Code:
net case_fan_ena => hm2_7i96.0.pwmgen.02.enable
net case_fan_pwm => hm2_7i96.0.pwmgen.02.value
setp hm2_7i96.0.pwmgen.02.output-type 1
setp hm2_7i96.0.pwmgen.02.scale 100
sets case_fan_pwm 30
sets case_fan_ena 1
When the boards are powered on, the pwm output is off as expected.
However when I quit LinuxCNC, or make a mistake in my config and LCNC fails to start, the pwm output is stuck high, and the fan spins like crazy. Is this expected?
Please Log in to join the conversation.
6 years 6 months ago #163613
by bbsr_5a
Replied by bbsr_5a on topic 7i76: pwm output stuck high
you can use a shutdown file to get all set off
if you use a coustom M-code to do pwm its also set to off during a e-stop
if you use a coustom M-code to do pwm its also set to off during a e-stop
Please Log in to join the conversation.
6 years 6 months ago #163617
by PCW
Replied by PCW on topic 7i76: pwm output stuck high
The 7I96 step/dir outputs default to high when un-driven so you might try using the inverted
output (the StepN- pin) and inverting the PWM polarity:
setp hm2_7i96.0.pwmgen.02.out0.invert_output true
output (the StepN- pin) and inverting the PWM polarity:
setp hm2_7i96.0.pwmgen.02.out0.invert_output true
Please Log in to join the conversation.
6 years 6 months ago #163632
by johnbl
Replied by johnbl on topic 7i76: pwm output stuck high
Actually after more testing, what I initially wrote is not completely correct.
The PWM fan is connected on a STEP- pin, and as PCW suggested with invert_output = true.
When LinuxCNC exits, the STEP- pin is low.
However, when launching LinuxCNC and a driver fails to load (I'm developing a rt driver so it happens often...), the STEP- pin become stuck high. It's very annoying...
Any ideas?
The PWM fan is connected on a STEP- pin, and as PCW suggested with invert_output = true.
When LinuxCNC exits, the STEP- pin is low.
However, when launching LinuxCNC and a driver fails to load (I'm developing a rt driver so it happens often...), the STEP- pin become stuck high. It's very annoying...
Any ideas?
Please Log in to join the conversation.
6 years 6 months ago #163633
by PCW
Replied by PCW on topic 7i76: pwm output stuck high
Is the watchdog enabled?
Please Log in to join the conversation.
6 years 6 months ago #163634
by johnbl
Replied by johnbl on topic 7i76: pwm output stuck high
I think so. I have
This is the kind of log I get when it happens, suggesting that the mesa board is properly reset, but somehow isn't.
Code:
setp hm2_7i96.0.watchdog.timeout_ns 10000000
This is the kind of log I get when it happens, suggesting that the mesa board is properly reset, but somehow isn't.
Code:
atv_vfd: rtapi_app_main: Operation now in progress (-115)
./gm1.hal:19: waitpid failed /home/cnc/src/linuxcnc/bin/rtapi_app atv_vfd
./gm1.hal:19: /home/cnc/src/linuxcnc/bin/rtapi_app exited without becoming ready
./gm1.hal:19: insmod for atv_vfd failed, returned -1
Shutting down and cleaning up LinuxCNC...
hm2_eth: HostMot2 ethernet driver unloaded
hm2: unloading
Please Log in to join the conversation.
6 years 6 months ago #163635
by PCW
Replied by PCW on topic 7i76: pwm output stuck high
If the watchdog bit it should have set the step- pins low
Does the red " /INIT" LED light up when LinuxCNC fails to load?
What firmware are you using?
Does the red " /INIT" LED light up when LinuxCNC fails to load?
What firmware are you using?
Please Log in to join the conversation.
6 years 6 months ago #163638
by johnbl
Replied by johnbl on topic 7i76: pwm output stuck high
No red led, no.
Is this what you need about the firmware?
Is this what you need about the firmware?
Code:
hm2: loading Mesa HostMot2 driver version 0.15
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 10.10.10.10: Hardware address: 00:60:1b:16:00:3a
hm2_eth: discovered 7I96
hm2/hm2_7i96.0: Low Level init 0.15
hm2/hm2_7i96.0: Smart Serial Firmware Version 43
Board hm2_7i96.0.7i76.0.0 Hardware Mode 0 = standard
Board hm2_7i96.0.7i76.0.0 Software Mode 0 = io_spin
Board hm2_7i96.0.7i76.0.0 Software Mode 1 = io_ana_spin
Board hm2_7i96.0.7i76.0.0 Software Mode 2 = io_enc_ana_spin_fv
hm2/hm2_7i96.0: created PktUART interface function hm2_7i96.0.pktuart.0
hm2/hm2_7i96.0: 51 I/O Pins used:
hm2/hm2_7i96.0: IO Pin 000 (TB3-01): IOPort
hm2/hm2_7i96.0: IO Pin 001 (TB3-02): IOPort
hm2/hm2_7i96.0: IO Pin 002 (TB3-03): IOPort
hm2/hm2_7i96.0: IO Pin 003 (TB3-04): IOPort
hm2/hm2_7i96.0: IO Pin 004 (TB3-05): IOPort
hm2/hm2_7i96.0: IO Pin 005 (TB3-06): IOPort
hm2/hm2_7i96.0: IO Pin 006 (TB3-07): IOPort
hm2/hm2_7i96.0: IO Pin 007 (TB3-08): IOPort
hm2/hm2_7i96.0: IO Pin 008 (TB3-09): IOPort
hm2/hm2_7i96.0: IO Pin 009 (TB3-10): IOPort
hm2/hm2_7i96.0: IO Pin 010 (TB3-11): IOPort
hm2/hm2_7i96.0: IO Pin 011 (TB3-13/TB3-14): SSR #0, pin Out-00 (Output)
hm2/hm2_7i96.0: IO Pin 012 (TB3-15/TB3-16): SSR #0, pin Out-01 (Output)
hm2/hm2_7i96.0: IO Pin 013 (TB3-17/TB3-18): SSR #0, pin Out-02 (Output)
hm2/hm2_7i96.0: IO Pin 014 (TB3-19/TB3-20): SSR #0, pin Out-03 (Output)
hm2/hm2_7i96.0: IO Pin 015 (TB3-21/TB3-22): SSR #0, pin Out-04 (Output)
hm2/hm2_7i96.0: IO Pin 016 (TB3-23/TB3-24): SSR #0, pin Out-05 (Output)
hm2/hm2_7i96.0: IO Pin 017 (TB1-02/TB1-03): StepGen #0, pin Step (Output)
hm2/hm2_7i96.0: IO Pin 018 (TB1-04/TB1-05): StepGen #0, pin Direction (Output)
hm2/hm2_7i96.0: IO Pin 019 (TB1-08/TB1-09): StepGen #1, pin Step (Output)
hm2/hm2_7i96.0: IO Pin 020 (TB1-10/TB1-11): StepGen #1, pin Direction (Output)
hm2/hm2_7i96.0: IO Pin 021 (TB1-14/TB1-15): StepGen #2, pin Step (Output)
hm2/hm2_7i96.0: IO Pin 022 (TB1-16/TB1-17): StepGen #2, pin Direction (Output)
hm2/hm2_7i96.0: IO Pin 023 (TB1-20/TB1-21): StepGen #3, pin Step (Output)
hm2/hm2_7i96.0: IO Pin 024 (TB1-22-TB1-23): StepGen #3, pin Direction (Output)
hm2/hm2_7i96.0: IO Pin 025 (TB2-01/TB2-03): PWMGen #0, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i96.0: IO Pin 026 (TB2-04/TB2-05): PWMGen #0, pin Out1 (Dir or Down) (Output)
hm2/hm2_7i96.0: IO Pin 027 (TB2-07/TB2-08): Encoder #0, pin A (Input)
hm2/hm2_7i96.0: IO Pin 028 (TB2-10/TB2-11): Encoder #0, pin B (Input)
hm2/hm2_7i96.0: IO Pin 029 (TB2-13/TB2-14): Encoder #0, pin Index (Input)
hm2/hm2_7i96.0: IO Pin 030 (TB2-16/TB2-17): PktUART Receive Channel #0, pin RX Data (Input)
hm2/hm2_7i96.0: IO Pin 031 (TB2-18/TB2-19): PktUART Transmit Channel #0, pin TX Data (Output)
hm2/hm2_7i96.0: IO Pin 032 (internal): PktUART Transmit Channel #0, pin Drv Enable (Output)
hm2/hm2_7i96.0: IO Pin 033 (internal): SSR #0, pin AC Ref (Output)
hm2/hm2_7i96.0: IO Pin 034 (P1-01): PWMGen #1, pin Out1 (Dir or Down) (Output)
hm2/hm2_7i96.0: IO Pin 035 (P1-02): PWMGen #1, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i96.0: IO Pin 036 (P1-03): StepGen #4, pin Direction (Output)
hm2/hm2_7i96.0: IO Pin 037 (P1-04): StepGen #4, pin Step (Output)
hm2/hm2_7i96.0: IO Pin 038 (P1-05): StepGen #5, pin Direction (Output)
hm2/hm2_7i96.0: IO Pin 039 (P1-06): StepGen #5, pin Step (Output)
hm2/hm2_7i96.0: IO Pin 040 (P1-07): PWMGen #2, pin Out1 (Dir or Down) (Output)
hm2/hm2_7i96.0: IO Pin 041 (P1-08): PWMGen #2, pin Out0 (PWM or Up) (Output)
hm2/hm2_7i96.0: IO Pin 042 (P1-09): StepGen #6, pin Direction (Output)
hm2/hm2_7i96.0: IO Pin 043 (P1-11): StepGen #6, pin Step (Output)
hm2/hm2_7i96.0: IO Pin 044 (P1-13): Smart Serial Interface #0, pin tx0 (Output)
hm2/hm2_7i96.0: IO Pin 045 (P1-15): Smart Serial Interface #0, pin rx0 (Input)
hm2/hm2_7i96.0: IO Pin 046 (P1-17): IOPort
hm2/hm2_7i96.0: IO Pin 047 (P1-19): IOPort
hm2/hm2_7i96.0: IO Pin 048 (P1-21): Encoder #1, pin Index (Input)
hm2/hm2_7i96.0: IO Pin 049 (P1-23): Encoder #1, pin B (Input)
hm2/hm2_7i96.0: IO Pin 050 (P1-25): Encoder #1, pin A (Input)
hm2/hm2_7i96.0: registered
Please Log in to join the conversation.
6 years 6 months ago #163639
by johnbl
Replied by johnbl on topic 7i76: pwm output stuck high
However when LCNC exits properly the red LED lights up.
Please Log in to join the conversation.
6 years 6 months ago #163640
by PCW
Replied by PCW on topic 7i76: pwm output stuck high
Right so it looks like there's a window in the start-up where the watchdog has not been enabled yet (because a number of time consuming non RT setup tasks need to be done)
but a failed module load can cause an exit.
I will take a look at the driver to see if there's a way to mitigate this
but a failed module load can cause an exit.
I will take a look at the driver to see if there's a way to mitigate this
Please Log in to join the conversation.
Time to create page: 0.092 seconds
