Mesa Newb Questions
03 Sep 2017 18:43 #98421
by Ioccajr
Mesa Newb Questions was created by Ioccajr
Let me preface this by stating that I am aware that I probably don't understand enough about this to ask the correct questions.
My Setup is as follows:
LinuxCNC 2.7.8
Mesanet 5i24 PCI card configured as SV12.BIT
2 7i29 h-bridge drivers
1 7i37ta io card
using hm2-servo.hal and a modified version of 5i23.ini (find replace for 5i23 for 5i24) I am able to command my H-bridge drivers and receive their position back.
However I am at a total loss of how to add functionality to this setup. Since SV12 configures all of the 5i24 pins to some part of servo control I am not sure what I need to do to add limit switches. Mesa made it sound like I could do this through the .HAL file but I can't seem to figure it out. I found in the basic hm2-servo.hal that it expects a home signal on the invert of pin 25. But if I change this value to match the 5i24 pin that I am trying to send the signal to (49) hm2-servo.hal stops working and will not start working again until I restore the .hal file from backup. Even if I change the number back.
I am trying to wrap my head around very basic concepts at this point. If I don't need all the servo outputs of SV12.BIT do I need a different configuration file with specific GPIO pins called out? Since a configuration like that doesnt seem to exist for the 5i24 do I need to write this config file somehow?
Why do simple pin # changes in the hal file stop the system from starting. Why does changing the value back not fix the problem?
Why when I run PNCconf to try and make a template .hal file does it have a very different structure from hm2-servo.hal. Is PNCconf reliable for other Mesacards like the 5i23. I have been wrestling with this for more than a year and am very willing to try a different PCI card at this point just so I can move on.
My Setup is as follows:
LinuxCNC 2.7.8
Mesanet 5i24 PCI card configured as SV12.BIT
2 7i29 h-bridge drivers
1 7i37ta io card
using hm2-servo.hal and a modified version of 5i23.ini (find replace for 5i23 for 5i24) I am able to command my H-bridge drivers and receive their position back.
However I am at a total loss of how to add functionality to this setup. Since SV12 configures all of the 5i24 pins to some part of servo control I am not sure what I need to do to add limit switches. Mesa made it sound like I could do this through the .HAL file but I can't seem to figure it out. I found in the basic hm2-servo.hal that it expects a home signal on the invert of pin 25. But if I change this value to match the 5i24 pin that I am trying to send the signal to (49) hm2-servo.hal stops working and will not start working again until I restore the .hal file from backup. Even if I change the number back.
I am trying to wrap my head around very basic concepts at this point. If I don't need all the servo outputs of SV12.BIT do I need a different configuration file with specific GPIO pins called out? Since a configuration like that doesnt seem to exist for the 5i24 do I need to write this config file somehow?
Why do simple pin # changes in the hal file stop the system from starting. Why does changing the value back not fix the problem?
Why when I run PNCconf to try and make a template .hal file does it have a very different structure from hm2-servo.hal. Is PNCconf reliable for other Mesacards like the 5i23. I have been wrestling with this for more than a year and am very willing to try a different PCI card at this point just so I can move on.
Please Log in or Create an account to join the conversation.
03 Sep 2017 19:10 #98425
by PCW
Replied by PCW on topic Mesa Newb Questions
All Mesa cards are pretty much compatible at the hal file level
GPIO pin numbers differ and some minor configuration options differ
but the basic hal files are the same for all
(a 5i23/5i24 swap really only needs the card name changed in the hal file and the firmware option add/deleted)
If you are using a 5I24 SV12 configuration with two 7I29s, you would enable only 4 PWMGens and 4 encoders in the hal config line (and connect the 2 7I29s to the 5I24s P4 (GPIO 0..23))
Now P3 (GPIO 24..47) and P2 (GPIO 48..71) are available for use with a 7I37
So for example if you connect the 7I37TA to P3, 7I37TA inputs 0..15 would be available as hostmot2 GPIO pins 24..39
In general when you are making changes to hal files, its good to launch LinuxCNC from the command line so you can see the error (the line number of the offending hal line is printed)
GPIO pin numbers differ and some minor configuration options differ
but the basic hal files are the same for all
(a 5i23/5i24 swap really only needs the card name changed in the hal file and the firmware option add/deleted)
If you are using a 5I24 SV12 configuration with two 7I29s, you would enable only 4 PWMGens and 4 encoders in the hal config line (and connect the 2 7I29s to the 5I24s P4 (GPIO 0..23))
Now P3 (GPIO 24..47) and P2 (GPIO 48..71) are available for use with a 7I37
So for example if you connect the 7I37TA to P3, 7I37TA inputs 0..15 would be available as hostmot2 GPIO pins 24..39
In general when you are making changes to hal files, its good to launch LinuxCNC from the command line so you can see the error (the line number of the offending hal line is printed)
Please Log in or Create an account to join the conversation.
03 Sep 2017 19:31 #98427
by Ioccajr
Replied by Ioccajr on topic Mesa Newb Questions
ok so as I expected I think I am asking the wrong questions.
I have enabled the 5I24 SV12 with 4 encoders and 4 pwms. I can also get the 7I37 hardware to respond to the limit switches (on board led's illuminate on switch close) but I don't understand how to get that information into linux CNC so that hitting a limit switch stops the servo.
Thank you in advance for any help. I am struggling trying to find examples but nearly everything I find is for very different setups.
I have enabled the 5I24 SV12 with 4 encoders and 4 pwms. I can also get the 7I37 hardware to respond to the limit switches (on board led's illuminate on switch close) but I don't understand how to get that information into linux CNC so that hitting a limit switch stops the servo.
Thank you in advance for any help. I am struggling trying to find examples but nearly everything I find is for very different setups.
Please Log in or Create an account to join the conversation.
03 Sep 2017 20:03 - 04 Sep 2017 12:28 #98429
by PCW
Replied by PCW on topic Mesa Newb Questions
Once you know what hostmot2 GPIO hal pins you need for limits, the rest is just standard LinuxCNC setup
Basically you connect the mesa specific pins (hm2_5i24.something) to the appropriate LinuxCNC pins with net commands
For example if you have a 7I37TA connected to P3, hm2_5i24.0.gpio.024.in would represent 7I37TA IN0 (and hm2_5i24.0.gpio.024.in_not would be the inverted version of the same input)
So if you wanted 7I37 IN0 to be used for X home you would need
net x-home hm2_5i24.0.gpio.024.in => axis.0.home-sw-in
or perhaps
net x-home hm2_5i24.0.gpio.024.in_not => axis.0.home-sw-in
depending on the limit switch polarity
somewhere in your hal file
(see the Axis pins in the motion components)
linuxcnc.org/docs/html/config/core-components.html
Note: if you have red LEDs lighting up on your 7I37, that means you have the input polarity reversed
The way to check the input is with halmeter or halshow
You can run halshow from the axis interface by selecting the "Machine", "Show Hal Configuration" menu items then selecting the "Watch" tab and then selecting the pin, parameter or signal you wish to monitor
Basically you connect the mesa specific pins (hm2_5i24.something) to the appropriate LinuxCNC pins with net commands
For example if you have a 7I37TA connected to P3, hm2_5i24.0.gpio.024.in would represent 7I37TA IN0 (and hm2_5i24.0.gpio.024.in_not would be the inverted version of the same input)
So if you wanted 7I37 IN0 to be used for X home you would need
net x-home hm2_5i24.0.gpio.024.in => axis.0.home-sw-in
or perhaps
net x-home hm2_5i24.0.gpio.024.in_not => axis.0.home-sw-in
depending on the limit switch polarity
somewhere in your hal file
(see the Axis pins in the motion components)
linuxcnc.org/docs/html/config/core-components.html
Note: if you have red LEDs lighting up on your 7I37, that means you have the input polarity reversed
The way to check the input is with halmeter or halshow
You can run halshow from the axis interface by selecting the "Machine", "Show Hal Configuration" menu items then selecting the "Watch" tab and then selecting the pin, parameter or signal you wish to monitor
Last edit: 04 Sep 2017 12:28 by andypugh.
The following user(s) said Thank You: Ioccajr
Please Log in or Create an account to join the conversation.
- Jesusmeca07
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
07 May 2020 17:17 #166975
by Jesusmeca07
Replied by Jesusmeca07 on topic Mesa Newb Questions
Hello, I have a question regarding the Gpio. How do I define if they are inputs and outputs on the 7I37? and how can I assign them to do an action? thank you very much for reading me
Please Log in or Create an account to join the conversation.
07 May 2020 19:00 - 07 May 2020 19:02 #166978
by PCW
Replied by PCW on topic Mesa Newb Questions
GPIO pin are all inputs at start-up so should work as-is
For the 8 output pins on a 7I37, you must set the associated GPIO pins to
output mode and also you normally would want to invert the outputs since
the 7I37 outputs are activated when the FPGA pins are in the low state
For example
setp hm2_[your_card].0.gpio.016.is_output true
setp hm2_[your_card].0.gpio.016.invert_output true
man hostmot2
Describes these parameters (in the GPIO section)
As far as putting them into action, that's done in the hal file by connecting the
GPIO pins to signals with 'net' commands
For the 8 output pins on a 7I37, you must set the associated GPIO pins to
output mode and also you normally would want to invert the outputs since
the 7I37 outputs are activated when the FPGA pins are in the low state
For example
setp hm2_[your_card].0.gpio.016.is_output true
setp hm2_[your_card].0.gpio.016.invert_output true
man hostmot2
Describes these parameters (in the GPIO section)
As far as putting them into action, that's done in the hal file by connecting the
GPIO pins to signals with 'net' commands
Last edit: 07 May 2020 19:02 by PCW.
The following user(s) said Thank You: Dorro1971
Please Log in or Create an account to join the conversation.
Time to create page: 0.097 seconds