7i96 Can't get PWM output - SOLVED
20 Nov 2019 16:07 #150771
by PCW
Replied by PCW on topic 7i96 Can't get PWM output
It looks like the configuration tool sets up the PWM frequency and mode (it sets the mode incorrectly) but its does not make the connections between Linuxcnc and the hardware
something like
net spindle_on spindle.0.on hm2_7i96.0.pwmgen.00.enable hm2_7i96.0.ssr.00.out-05
net spindle_speed spindle.0.speed-out hm2_7i96.0.pwmgen.00.value
( assuming you want sign magnitude PWM and a separate spindle ENA output on the 7I96's isolated output 5)
something like
net spindle_on spindle.0.on hm2_7i96.0.pwmgen.00.enable hm2_7i96.0.ssr.00.out-05
net spindle_speed spindle.0.speed-out hm2_7i96.0.pwmgen.00.value
( assuming you want sign magnitude PWM and a separate spindle ENA output on the 7I96's isolated output 5)
Please Log in or Create an account to join the conversation.
20 Nov 2019 16:52 - 20 Nov 2019 16:53 #150772
by jools
Yeah when I looked at it I thought that it was the net functions/commands missing.
The functions I would like are spindle command fromwithin a program and MDI along with the manual controls of stop, cw, cww and the speed increase and decrease.
I also think the configuration tool sets up the outputs wrong too. When I used the tool and set cw, ccw and enable outputs up from the tab linux cnc failed to load citing io.hal issues. The lines in the io.hal are the second bit of code in the OP. All of them caused a failure to load.
Thanks for this I'll implement it later and update.
Jools
Replied by jools on topic 7i96 Can't get PWM output
It looks like the configuration tool sets up the PWM frequency and mode (it sets the mode incorrectly) but its does not make the connections between Linuxcnc and the hardware
something like
net spindle_on spindle.0.on hm2_7i96.0.pwmgen.00.enable hm2_7i96.0.ssr.00.out-05
net spindle_speed spindle.0.speed-out hm2_7i96.0.pwmgen.00.value
( assuming you want sign magnitude PWM and a separate spindle ENA output on the 7I96's isolated output 5)
Yeah when I looked at it I thought that it was the net functions/commands missing.
The functions I would like are spindle command fromwithin a program and MDI along with the manual controls of stop, cw, cww and the speed increase and decrease.
I also think the configuration tool sets up the outputs wrong too. When I used the tool and set cw, ccw and enable outputs up from the tab linux cnc failed to load citing io.hal issues. The lines in the io.hal are the second bit of code in the OP. All of them caused a failure to load.
Thanks for this I'll implement it later and update.
Jools
Last edit: 20 Nov 2019 16:53 by jools. Reason: clarification
Please Log in or Create an account to join the conversation.
20 Nov 2019 19:49 #150787
by jools
code output for this below
Replied by jools on topic 7i96 Can't get PWM output
Sorry the command is
halcmd show all *pwmgen*
or
halcmd show all | grep pwm
I forgot that halcmd does not do a simple text match like vanilla grep
but seems to search only for complete tokens
code output for this below
Loaded HAL Components:
ID Type Name PID State
Component Pins:
Owner Type Dir Value Name
29 bit IN FALSE hm2_7i96.0.pwmgen.00.enable
29 float IN 0 hm2_7i96.0.pwmgen.00.value
Pin Aliases:
Alias Original Name
Signals:
Type Value Name (linked to)
Parameters:
Owner Type Dir Value Name
29 bit RW FALSE hm2_7i96.0.pwmgen.00.out0.invert_output
29 bit RW FALSE hm2_7i96.0.pwmgen.00.out0.is_opendrain
29 bit RW FALSE hm2_7i96.0.pwmgen.00.out1.invert_output
29 bit RW FALSE hm2_7i96.0.pwmgen.00.out1.is_opendrain
29 s32 RW 1 hm2_7i96.0.pwmgen.00.output-type
29 float RW 2500 hm2_7i96.0.pwmgen.00.scale
29 u32 RW 0x00004E20 hm2_7i96.0.pwmgen.pdm_frequency
29 u32 RW 0x00000014 hm2_7i96.0.pwmgen.pwm_frequency
Parameter Aliases:
Alias Original Name
hm2_7i96.0.pwmgen.00.out0.invert_output hm2_7i96.0.gpio.025.invert_output
hm2_7i96.0.pwmgen.00.out0.is_opendrain hm2_7i96.0.gpio.025.is_opendrain
hm2_7i96.0.pwmgen.00.out1.invert_output hm2_7i96.0.gpio.026.invert_output
hm2_7i96.0.pwmgen.00.out1.is_opendrain hm2_7i96.0.gpio.026.is_opendrain
Exported Functions:
Owner CodeAddr Arg FP Users Name
Realtime Threads:
Period FP Name ( Time, Max-Time )
Please Log in or Create an account to join the conversation.
20 Nov 2019 20:00 - 20 Nov 2019 20:01 #150790
by jools
I did wonder about this because the configuration tool doesn't add a PWMGENS = (value) in the .INI file. All the other loadrt's are referenced through the HOSTMOT part of the ini file. See code
I'm possibly thinking there's a bug with the tool (though I am probably wrong with this), I will start a new thread asking if anyone has got this working. Someone must have got the pwmgen firmware working and maybe I can copy their file.
I had tried this earlier though and it didn't work.
Replied by jools on topic 7i96 Can't get PWM output
Add the num_pwm = 1 to loadrt line for Mesa 7i76, or see if there is a provision for setting that in tool.
I did wonder about this because the configuration tool doesn't add a PWMGENS = (value) in the .INI file. All the other loadrt's are referenced through the HOSTMOT part of the ini file. See code
[HOSTMOT2]
DRIVER = hm2_eth
IPADDRESS = "10.10.10.10"
BOARD = 7i96
STEPGENS = 3
ENCODERS = 1
SSERIAL_PORT = 1
I'm possibly thinking there's a bug with the tool (though I am probably wrong with this), I will start a new thread asking if anyone has got this working. Someone must have got the pwmgen firmware working and maybe I can copy their file.
I had tried this earlier though and it didn't work.
Last edit: 20 Nov 2019 20:01 by jools.
Please Log in or Create an account to join the conversation.
20 Nov 2019 21:07 #150797
by PCW
Replied by PCW on topic 7i96 Can't get PWM output
Did you try my net suggestions?
Please Log in or Create an account to join the conversation.
20 Nov 2019 21:48 #150801
by jools
Replied by jools on topic 7i96 Can't get PWM output
I did but they didn’t work initially. Need to just look at it in more depth in the morning and try them in different places; it’s getting late here.
Thanks for the help so far, I’ll update in my morning.
Jools
Thanks for the help so far, I’ll update in my morning.
Jools
Please Log in or Create an account to join the conversation.
21 Nov 2019 09:30 #150814
by jools
Replied by jools on topic 7i96 Can't get PWM output
Bigjohnt has updated on another thread that he has not been able to configure PWM on the 7I96.
I will look at velocity mode to control it.
I will look at velocity mode to control it.
Please Log in or Create an account to join the conversation.
21 Nov 2019 14:16 #150826
by PCW
Replied by PCW on topic 7i96 Can't get PWM output
I just tested my net commands and:
I get spindle speed proportional PWM on the STEP4 output
I get a spindle direction signal on the DIR4 output
I get a spindle on control from the SSR5 output
Adding the two net commands and fixing the PWM mode set
error was all that was needed to get this working
I get spindle speed proportional PWM on the STEP4 output
I get a spindle direction signal on the DIR4 output
I get a spindle on control from the SSR5 output
Adding the two net commands and fixing the PWM mode set
error was all that was needed to get this working
The following user(s) said Thank You: jools
Please Log in or Create an account to join the conversation.
21 Nov 2019 15:47 #150838
by jools
Should they be underscores or hyphens?
Did you put them in the hal file or the h#io.hal.
Any chance you can attach your whole configs file please.
Thanks
Jools
Replied by jools on topic 7i96 Can't get PWM output
It looks like the configuration tool sets up the PWM frequency and mode (it sets the mode incorrectly) but its does not make the connections between Linuxcnc and the hardware
something like
net spindle_on spindle.0.on hm2_7i96.0.pwmgen.00.enable hm2_7i96.0.ssr.00.out-05
net spindle_speed spindle.0.speed-out hm2_7i96.0.pwmgen.00.value
( assuming you want sign magnitude PWM and a separate spindle ENA output on the 7I96's isolated output 5)
Should they be underscores or hyphens?
Did you put them in the hal file or the h#io.hal.
Any chance you can attach your whole configs file please.
Thanks
Jools
Please Log in or Create an account to join the conversation.
21 Nov 2019 15:52 #150839
by PCW
Replied by PCW on topic 7i96 Can't get PWM output
The signal names can be listed via halcmd so there is no need to guess
in fact you can list all signal, pins, and parameters and create a file for
copy pasting with
halcmd show all > allnames.txt
I put the commands in the main hal file
in fact you can list all signal, pins, and parameters and create a file for
copy pasting with
halcmd show all > allnames.txt
I put the commands in the main hal file
The following user(s) said Thank You: jools
Please Log in or Create an account to join the conversation.
Time to create page: 0.110 seconds