7i47s Analog out
10 Feb 2020 21:40 #156983
by dremeier
7i47s Analog out was created by dremeier
Can someone give me an example for the analog out of the 7i47s, regarding for spindle control?
Is that a hardware PWM or need as software PWM? The Bit file is correct, I got it direct from Mesa. thx!
I tried a lot bus nothing works. Using l-cnc 2.9.
Any suggestions are welcome!
Is that a hardware PWM or need as software PWM? The Bit file is correct, I got it direct from Mesa. thx!
I tried a lot bus nothing works. Using l-cnc 2.9.
Any suggestions are welcome!
Please Log in or Create an account to join the conversation.
10 Feb 2020 21:55 #156984
by PCW
Replied by PCW on topic 7i47s Analog out
You would use hardware PWM set to about 5KHz
What bit file are you using?
What bit file are you using?
Please Log in or Create an account to join the conversation.
10 Feb 2020 22:22 #156985
by dremeier
Replied by dremeier on topic 7i47s Analog out
attached the bit file and pin file.
for hardware pwm I should see these pins in HAL-Show, right? But there is only pwmgen.value and pwmgen.on.
How does the hardware PWM would look like in HAL?
for hardware pwm I should see these pins in HAL-Show, right? But there is only pwmgen.value and pwmgen.on.
How does the hardware PWM would look like in HAL?
Please Log in or Create an account to join the conversation.
10 Feb 2020 22:49 #156986
by PCW
Replied by PCW on topic 7i47s Analog out
pins should it should be something like
hm2_5i24.0.pwmgen.00.enable
and
hm2_5i24.0.pwmgen.00.value
and parameters
hm2_5i24.0.pwmgen.pwm_frequency
etc
hm2_5i24.0.pwmgen.00.enable
and
hm2_5i24.0.pwmgen.00.value
and parameters
hm2_5i24.0.pwmgen.pwm_frequency
etc
Please Log in or Create an account to join the conversation.
11 Feb 2020 00:40 #156989
by dremeier
Replied by dremeier on topic 7i47s Analog out
ok thank you, I got it, so far so good:
for testing I´ve this in the hal:
setp hm2_5i24.0.pwmgen.00.scale -100
setp hm2_5i24.0.pwmgen.00.output-type 1
setp hm2_5i24.0.pwmgen.00.enable TRUE
setp hm2_5i24.0.pwmgen.pwm_frequency 5000
setp hm2_5i24.0.pwmgen.00.offset-mode 0
setp hm2_5i24.0.pwmgen.00.value 20
But
if the value is 20 the voltage is 8V
if the value is 80 the voltage is 2V
but I guess it should be vice versa?
for testing I´ve this in the hal:
setp hm2_5i24.0.pwmgen.00.scale -100
setp hm2_5i24.0.pwmgen.00.output-type 1
setp hm2_5i24.0.pwmgen.00.enable TRUE
setp hm2_5i24.0.pwmgen.pwm_frequency 5000
setp hm2_5i24.0.pwmgen.00.offset-mode 0
setp hm2_5i24.0.pwmgen.00.value 20
But
if the value is 20 the voltage is 8V
if the value is 80 the voltage is 2V
but I guess it should be vice versa?
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19210
- Thank you received: 6438
11 Feb 2020 00:55 #156990
by tommylight
Replied by tommylight on topic 7i47s Analog out
You have the scale reversed with " - " .
Please Log in or Create an account to join the conversation.
11 Feb 2020 01:05 - 11 Feb 2020 01:12 #156994
by dremeier
Replied by dremeier on topic 7i47s Analog out
yes, that was a try to revers the behavior but it is the same if the scale is +
Last edit: 11 Feb 2020 01:12 by dremeier.
Please Log in or Create an account to join the conversation.
11 Feb 2020 01:21 - 11 Feb 2020 01:22 #156996
by PCW
Replied by PCW on topic 7i47s Analog out
From the 7I78 manual:
"Spindle PWM is active low so if the 7I78 is used with HostMot2 firmware, the PWM output must be inverted."
on a 5I24 (and LinuxCNC 2.8 and above) you would:
setp hm2_5i24.0.pwmgen.00.out0.invert_output true
"Spindle PWM is active low so if the 7I78 is used with HostMot2 firmware, the PWM output must be inverted."
on a 5I24 (and LinuxCNC 2.8 and above) you would:
setp hm2_5i24.0.pwmgen.00.out0.invert_output true
Last edit: 11 Feb 2020 01:22 by PCW.
Please Log in or Create an account to join the conversation.
11 Feb 2020 09:42 #157032
by dremeier
Replied by dremeier on topic 7i47s Analog out
ok, now I´ve it almost !
here the HAL:
setp hm2_5i24.0.pwmgen.pwm_frequency [SPINDLE_0]PWM_FREQ
setp hm2_5i24.0.pwmgen.00.scale [SPINDLE_0]OUTPUT_SCALE
setp hm2_5i24.0.pwmgen.00.output-type 1
setp hm2_5i24.0.pwmgen.00.offset-mode 0 # 1 wenn value +- dann bei 0 = 50%
setp hm2_5i24.0.pwmgen.00.out0.invert_output true # damit der PWM Ausgang bei steigendem Value auch ansteigt
setp hm2_5i24.0.gpio.016.is_output 1 # gpio 016 ist Aux (M4) - auf Ausgang setzen
setp hm2_5i24.0.gpio.016.invert_output 1
net spindle-speed-cmd spindle.0.speed-out-abs => hm2_5i24.0.pwmgen.00.value
net spindle-on spindle.0.on => hm2_5i24.0.pwmgen.00.enable # FU und PWM enable
net spindle-fwd => spindle.0.forward => hm2_5i24.0.gpio.016.out # gpio 016 / Aux (M3)
net spindle-rev => spindle.0.reverse => hm2_5i24.0.7i90.0.0.p1-out-02 # M4 - da DIR nicht ansprechbar -> 7i90
Then I figured out that the markings for the optocoupler outs on the 7i47s (EN, DIR, AUX) are vice versa, + is - and - is +. But that does no matter for me.
The only thing I can´t figure out how to set the DIR output? Probably gpio.017 is for that purpose, but the only opportunity is to set the Parameter setp hm2_5i24.0.pwmgen.00.out1.invert_output to 0 to get a state change. This is not a pin so not possible to connect with 'net'. A out-pin related to gpio.017 I couldn´t find.
here the HAL:
setp hm2_5i24.0.pwmgen.pwm_frequency [SPINDLE_0]PWM_FREQ
setp hm2_5i24.0.pwmgen.00.scale [SPINDLE_0]OUTPUT_SCALE
setp hm2_5i24.0.pwmgen.00.output-type 1
setp hm2_5i24.0.pwmgen.00.offset-mode 0 # 1 wenn value +- dann bei 0 = 50%
setp hm2_5i24.0.pwmgen.00.out0.invert_output true # damit der PWM Ausgang bei steigendem Value auch ansteigt
setp hm2_5i24.0.gpio.016.is_output 1 # gpio 016 ist Aux (M4) - auf Ausgang setzen
setp hm2_5i24.0.gpio.016.invert_output 1
net spindle-speed-cmd spindle.0.speed-out-abs => hm2_5i24.0.pwmgen.00.value
net spindle-on spindle.0.on => hm2_5i24.0.pwmgen.00.enable # FU und PWM enable
net spindle-fwd => spindle.0.forward => hm2_5i24.0.gpio.016.out # gpio 016 / Aux (M3)
net spindle-rev => spindle.0.reverse => hm2_5i24.0.7i90.0.0.p1-out-02 # M4 - da DIR nicht ansprechbar -> 7i90
Then I figured out that the markings for the optocoupler outs on the 7i47s (EN, DIR, AUX) are vice versa, + is - and - is +. But that does no matter for me.
The only thing I can´t figure out how to set the DIR output? Probably gpio.017 is for that purpose, but the only opportunity is to set the Parameter setp hm2_5i24.0.pwmgen.00.out1.invert_output to 0 to get a state change. This is not a pin so not possible to connect with 'net'. A out-pin related to gpio.017 I couldn´t find.
Please Log in or Create an account to join the conversation.
11 Feb 2020 12:29 #157041
by PCW
Replied by PCW on topic 7i47s Analog out
Depending on firmware, DIR will be controlled by the sign of the PWM rather than a GPIO bit
What is reversed about the Optocoupler outputs?
What is reversed about the Optocoupler outputs?
Please Log in or Create an account to join the conversation.
Time to create page: 0.087 seconds