Change polarity of step output on 7i80 board
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 425
- Thank you received: 81
20 Nov 2015 01:16 - 20 Nov 2015 01:53 #65554
by auto-mation-assist
Change polarity of step output on 7i80 board was created by auto-mation-assist
In regards to the Mesa 7i80 board gpio interface. I have been trying to change the polarity of the step outputs that appear to be hard coded in hostmot2 to the output pins of the assigned gpio pin when the bit file is created. In my case I assigned my x-axis step out to io3 and it appears not to be available in hal to change the pulse output polarity. Hal states that the pin is not found and the pin does not show up as being configurable in Halshow. I suspect that there is a way to change the output pulses from positive going to negative going with commands similar to those used for steplen or stepspace.
At the present time I can control the motor speed just fine but wish to invert the output signal which will make it so the opto isolator in the Leadshine DCS810 the pulse output is driving light up up only when step pulses are being generated. At the present time with no pulses generated about 10ma of current is passing through the opto's input pins. Step pulse width is 3us so the average current should from zero to very low. I have six of these outputs to change. I'm running 2.8.0-pre1-1214-g447847f of linuxcnc.
Is there a way to flip the output polarity of the step pulses and also verify open drain configuration?
At the present time I can control the motor speed just fine but wish to invert the output signal which will make it so the opto isolator in the Leadshine DCS810 the pulse output is driving light up up only when step pulses are being generated. At the present time with no pulses generated about 10ma of current is passing through the opto's input pins. Step pulse width is 3us so the average current should from zero to very low. I have six of these outputs to change. I'm running 2.8.0-pre1-1214-g447847f of linuxcnc.
Is there a way to flip the output polarity of the step pulses and also verify open drain configuration?
Last edit: 20 Nov 2015 01:53 by auto-mation-assist. Reason: I forgot to add version of linuxcnc
Please Log in or Create an account to join the conversation.
20 Nov 2015 11:27 #65567
by andypugh
Every stepgen pin is also a GPIO pin. If you want to invert the sense of the pin then you set the ...invert_output parameter of the gpio pin.
In your case this is probably
linuxcnc.org/docs/2.7/html/man/man9/hostmot2.9.html#UART
Replied by andypugh on topic Change polarity of step output on 7i80 board
In my case I assigned my x-axis step out to io3 and it appears not to be available in hal to change the pulse output polarity. Hal states that the pin is not found and the pin does not show up as being configurable in Halshow.
Every stepgen pin is also a GPIO pin. If you want to invert the sense of the pin then you set the ...invert_output parameter of the gpio pin.
In your case this is probably
setp hm2_7i80.0.gpio.003.invert_output 1
linuxcnc.org/docs/2.7/html/man/man9/hostmot2.9.html#UART
The following user(s) said Thank You: auto-mation-assist
Please Log in or Create an account to join the conversation.
20 Nov 2015 15:55 - 20 Nov 2015 19:40 #65574
by PCW
Replied by PCW on topic Change polarity of step output on 7i80 board
You can check if open-drain is enabled for a pin by verifying that the pin voltage is 5V
when the pin is in a a high state (If you invert the stepgen outputs they will idle in a high state)
Not sure when it was merged (or if its merged yet) but there is coming support for GPIO name aliases
so instead of:
setp hm2_7i80.0.gpio.003.invert_output 1
you use (something like):
setp hm2_7i80.0.stepgen.01.invert_output true
This makes hal files more readable and portable
when the pin is in a a high state (If you invert the stepgen outputs they will idle in a high state)
Not sure when it was merged (or if its merged yet) but there is coming support for GPIO name aliases
so instead of:
setp hm2_7i80.0.gpio.003.invert_output 1
you use (something like):
setp hm2_7i80.0.stepgen.01.invert_output true
This makes hal files more readable and portable
Last edit: 20 Nov 2015 19:40 by PCW.
The following user(s) said Thank You: auto-mation-assist
Please Log in or Create an account to join the conversation.
20 Nov 2015 18:52 #65579
by andypugh
It appears to only be in Master, so won't be in a release version prior to 2.8.
Replied by andypugh on topic Change polarity of step output on 7i80 board
Not sure when it was merged (or if its merged yet) but there is coming support for GPIO name aliases
It appears to only be in Master, so won't be in a release version prior to 2.8.
The following user(s) said Thank You: auto-mation-assist
Please Log in or Create an account to join the conversation.
- auto-mation-assist
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 425
- Thank you received: 81
20 Nov 2015 21:23 #65587
by auto-mation-assist
Replied by auto-mation-assist on topic Change polarity of step output on 7i80 board
andypugh your suggestion of using setp hm2_7i80.0.gpio.003.invert_output 1 resolved my issue. I tried this before but suspect that I left of the "1" on the end.
PCW using setp hm2_7i80.0.stepgen.01.invert_output true gave me a error of 'parameter or pin 'hm2_7i80.0.stepgen.01.invert_output' not found'. I also tried it as setp hm2_7i80.0.stepgen.00.invert_output true and it gave me the same result.
PCW using setp hm2_7i80.0.stepgen.01.invert_output true gave me a error of 'parameter or pin 'hm2_7i80.0.stepgen.01.invert_output' not found'. I also tried it as setp hm2_7i80.0.stepgen.00.invert_output true and it gave me the same result.
Please Log in or Create an account to join the conversation.
20 Nov 2015 22:56 - 20 Nov 2015 22:57 #65589
by PCW
Replied by PCW on topic Change polarity of step output on 7i80 board
I suspect it has to be a pretty fresh version of master to have the aliases
Rather than guessing at pin or parameter names you can list all the available pins and parameters
by making a master list (suitable for copy-paste into hal files) by using halcmd when linuxcnc is running:
halcmd show pin > allpins.txt
halcmd show param >allparams.txt
Rather than guessing at pin or parameter names you can list all the available pins and parameters
by making a master list (suitable for copy-paste into hal files) by using halcmd when linuxcnc is running:
halcmd show pin > allpins.txt
halcmd show param >allparams.txt
Last edit: 20 Nov 2015 22:57 by PCW.
The following user(s) said Thank You: auto-mation-assist
Please Log in or Create an account to join the conversation.
Time to create page: 0.069 seconds