Mesa 5i25/7i77 - First Steps
25 Feb 2016 00:19 #70589
by Sparky961
Mesa 5i25/7i77 - First Steps was created by Sparky961
This is my first post on this forum so please be gentle...
I've recently received a 5i25/7i77 kit from Mesa. While waiting for it I kept busy reading everything I could find on the hardware and configuring for LinuxCNC.
What I haven't been able to find yet is a fairly concise "first steps" or "quick start" sort of document that gets you started with a minimal system. Now I understand the difficulty because there are so many different ways you could put it together, but would a simple example with the board, a +/-10V BLDC servo driver, encoder, and servo not be fairly universal?
If there's anything you think I should have a look at when just starting out, I'd appreciate a link or two that gets me going in the right direction.
I've recently received a 5i25/7i77 kit from Mesa. While waiting for it I kept busy reading everything I could find on the hardware and configuring for LinuxCNC.
What I haven't been able to find yet is a fairly concise "first steps" or "quick start" sort of document that gets you started with a minimal system. Now I understand the difficulty because there are so many different ways you could put it together, but would a simple example with the board, a +/-10V BLDC servo driver, encoder, and servo not be fairly universal?
If there's anything you think I should have a look at when just starting out, I'd appreciate a link or two that gets me going in the right direction.
Please Log in or Create an account to join the conversation.
25 Feb 2016 12:14 #70608
by andypugh
Replied by andypugh on topic Mesa 5i25/7i77 - First Steps
You would normally use the PNCConf wizard to create a basic LinuxCNC configuration, and I would certainly recommend that for getting all the files required for a configuration in the right place, and with the right layout and structure.
However, it can sometimes be very useful to check things out first _without_ the complexity of getting a full LinuxCNC system up and running.
Here is what I do when I get a new card. (And is actually what the HAL and INI files do, automatically, for you).
Install just the 5i25 and power up the PC. Open a terminal window.
The first command sets up a realtime environment and starts an interactive HAL session.
Then we load the main Mesa driver and the PCI card driver and create a realtime threa.
The next lines add the read/write functions to the realtime thread, then start the thread running.
You can now start to look at the HAL pins and even make the LEDs on the 5i25 change state.
Use "exit" to close the HAL session and unload the drivers.
If you then attach the 7i77 you should see more pins, and if you supply field power to power-up the GPIO on the 7i77 you should see even more. You should also be able to set analogue outputs and read pin values too.
However, it can sometimes be very useful to check things out first _without_ the complexity of getting a full LinuxCNC system up and running.
Here is what I do when I get a new card. (And is actually what the HAL and INI files do, automatically, for you).
Install just the 5i25 and power up the PC. Open a terminal window.
halrun
loadrt hostmot2
loadrt hm2_pci
loadrt threads
addf hm2_5i25.0.read thread1
addf hm2_5i25.0.write thread1
start
The first command sets up a realtime environment and starts an interactive HAL session.
Then we load the main Mesa driver and the PCI card driver and create a realtime threa.
The next lines add the read/write functions to the realtime thread, then start the thread running.
You can now start to look at the HAL pins and even make the LEDs on the 5i25 change state.
show pin
setp hm2_5i25.0.led.CR01 1
setp hm2_5i25.0.led.CR01 0
Use "exit" to close the HAL session and unload the drivers.
If you then attach the 7i77 you should see more pins, and if you supply field power to power-up the GPIO on the 7i77 you should see even more. You should also be able to set analogue outputs and read pin values too.
The following user(s) said Thank You: new2linux
Please Log in or Create an account to join the conversation.
25 Feb 2016 23:41 #70649
by Sparky961
Replied by Sparky961 on topic Mesa 5i25/7i77 - First Steps
Perfect. This is exactly the sort of thing I was missing. Something of a "Hello World" type of example. After posting this and the other "first" message (I got confused after not seeing it, only to realize they get moderated first) I continued to play and research. I was able to figure out the bit about omitting petting the watchdog. As I began to doze at the keyboard though, I still couldn't for the life of me figure out how to control an LED on the board. I'll try what you've suggested tonight. Are there specific resources you can point me to that are geared more toward starting out with this, rather than overloading my brain with things that can wait until later? I'd like to start with just one servo/driver and get that moving before proceeding with the rest of the system. I'll have to think of a good way to keep my wiring safe, neat and manageable as well.
Your prompt and useful reply was greatly appreciated. It's reassuring to know that there are people like you to help out with this.
Your prompt and useful reply was greatly appreciated. It's reassuring to know that there are people like you to help out with this.
Please Log in or Create an account to join the conversation.
26 Feb 2016 00:13 #70651
by andypugh
The HAL structure to control an axis is not 100% simple. You need a PID controller that compares the encoder feedback to the commanded position and outputs a command signal for the analogue output in proportion to the position error.
You then need to spend some time adjusting the P, I and D gains to get the right system response.
Start by getting the encoder scales right, possibly at the command line.
One useful adjunct to the command-line example aboveThat will create a little live-display of the selected pin, which saves you a lot of typing of "show pin"
Replied by andypugh on topic Mesa 5i25/7i77 - First Steps
I'd like to start with just one servo/driver and get that moving before proceeding with the rest of the system.
The HAL structure to control an axis is not 100% simple. You need a PID controller that compares the encoder feedback to the commanded position and outputs a command signal for the analogue output in proportion to the position error.
You then need to spend some time adjusting the P, I and D gains to get the right system response.
Start by getting the encoder scales right, possibly at the command line.
One useful adjunct to the command-line example above
loadusr halmeter pin hm2_5i25.0.encoder.00.position
Please Log in or Create an account to join the conversation.
26 Feb 2016 00:31 #70654
by Sparky961
Replied by Sparky961 on topic Mesa 5i25/7i77 - First Steps
LED CR01 on, LED CR01 off... check. Same for CR02. Looks like the 5i25 board is doing what it's supposed to.
However, you mentioned that I should see more pins after connecting the 7i77. I don't. As far as I recall the only things I've changed from default are jumper 5i25/W2 _up_ (for breakout power) and 7i77/W5 _left_and 7i77/W1 _left_. I do not yet have anything external connected. No field power yet.
On the 7i77 there are 3 LEDs currently lit: CR1, CR6, and CR7.
However, you mentioned that I should see more pins after connecting the 7i77. I don't. As far as I recall the only things I've changed from default are jumper 5i25/W2 _up_ (for breakout power) and 7i77/W5 _left_and 7i77/W1 _left_. I do not yet have anything external connected. No field power yet.
On the 7i77 there are 3 LEDs currently lit: CR1, CR6, and CR7.
Please Log in or Create an account to join the conversation.
26 Feb 2016 02:16 #70656
by Sparky961
Replied by Sparky961 on topic Mesa 5i25/7i77 - First Steps
Ok, I went ahead and anxiously applied 24V field power to all four VFIELD pnis on TB2, plus GND (side note: why four pins? current capacity? why not have one larger connector?). 7i77/CR3 is also on now, plus 7i77/CR16. After restarting the HAL session, CR16 turns off and CR15 blinks.
All a bit cryptic, but with some apparent activity going on when I give it commands and no "magic smoke" being emitted, I'm happy with my baby steps so far.
Regarding the pins from the 7i77 you mentioned earlier, they may have been there but perhaps I missed them because they were at the top of the list. I'm not a complete newbie when it comes to Linux but it's certainly been a while. I forgot the massive volume of scrolling terminal output that the developers love to display.
Next I'll work on getting an encoder connected up.
All a bit cryptic, but with some apparent activity going on when I give it commands and no "magic smoke" being emitted, I'm happy with my baby steps so far.
Regarding the pins from the 7i77 you mentioned earlier, they may have been there but perhaps I missed them because they were at the top of the list. I'm not a complete newbie when it comes to Linux but it's certainly been a while. I forgot the massive volume of scrolling terminal output that the developers love to display.
Next I'll work on getting an encoder connected up.
Please Log in or Create an account to join the conversation.
26 Feb 2016 03:12 #70657
by Sparky961
Replied by Sparky961 on topic Mesa 5i25/7i77 - First Steps
This thread is turning out to be more of a build journal than I expected. I figure it's a good thing though because Google will pick it up for other people like me in the future. Maybe I might even need to search for this thread at some point to remember how I got things going.
So, the encoder is alive - mostly. I can observe hm2_5i25.0.encoder.00.position changing as I manually rotate the servo's shaft. The encoder is mounted directly to the back of the BLDC motor. I'm not too concerned about scaling right now, but I do get 4000 counts per rotation which is what I'd expect in 4X quadrature mode.
I can't see any change on hm2_5i25.0.encoder.00.input-index though. I've tried changing hm2_5i25.0.encoder.00.index-enable from FALSE to TRUE, thinking this might make it work... nope. I don't know how wide the pulse is, so maybe I'm just missing the change as I turn it very slowly?
I'll keep plugging away at it.... anyone feel free to jump in if you can offer something helpful or see me going down the wrong track.
So, the encoder is alive - mostly. I can observe hm2_5i25.0.encoder.00.position changing as I manually rotate the servo's shaft. The encoder is mounted directly to the back of the BLDC motor. I'm not too concerned about scaling right now, but I do get 4000 counts per rotation which is what I'd expect in 4X quadrature mode.
I can't see any change on hm2_5i25.0.encoder.00.input-index though. I've tried changing hm2_5i25.0.encoder.00.index-enable from FALSE to TRUE, thinking this might make it work... nope. I don't know how wide the pulse is, so maybe I'm just missing the change as I turn it very slowly?
I'll keep plugging away at it.... anyone feel free to jump in if you can offer something helpful or see me going down the wrong track.
Please Log in or Create an account to join the conversation.
26 Feb 2016 09:37 #70661
by andypugh
I think that the idea is one pin is the power supply and the other pins can be used to take power _to_ switches / optos etc.
Replied by andypugh on topic Mesa 5i25/7i77 - First Steps
(side note: why four pins? current capacity? why not have one larger connector?).
I think that the idea is one pin is the power supply and the other pins can be used to take power _to_ switches / optos etc.
Please Log in or Create an account to join the conversation.
26 Feb 2016 09:39 #70662
by andypugh
You will probably never see the pulse.
But, if you set the index-enable pin to true, then rotate the shaft, at some point you should see index-enable reset to false, and the counts and position pins will go to zero.
Replied by andypugh on topic Mesa 5i25/7i77 - First Steps
I can't see any change on hm2_5i25.0.encoder.00.input-index though. I've tried changing hm2_5i25.0.encoder.00.index-enable from FALSE to TRUE, thinking this might make it work... nope. I don't know how wide the pulse is, so maybe I'm just missing the change as I turn it very slowly?.
You will probably never see the pulse.
But, if you set the index-enable pin to true, then rotate the shaft, at some point you should see index-enable reset to false, and the counts and position pins will go to zero.
Please Log in or Create an account to join the conversation.
26 Feb 2016 23:15 - 26 Feb 2016 23:21 #70689
by Sparky961
Replied by Sparky961 on topic Mesa 5i25/7i77 - First Steps
You, sir, are awesome.
Your quick and concise replies have had an incredible effect helping me to figure out whether things are working. Again, it turns out that they are. I can watch hm2_5i25.0.encoder.00.index-enable reset back to FALSE after setting TRUE and rotating the servo shaft somewhere less than a full rotation.
So, next steps.... I have an MPG here that I'm thinking about getting working early on because I don't like having to control axes with a keyboard. The first few times you pick up an MPG it doesn't seem that natural but after a while you don't know how you lived without one. I have a TOSOKU "Handy Controller" HC121. It came to me non-functional and I was able to do some surgery and positively locate and resolve the fault. Its power is supposed to be 12V but I'm thinking I might try it with 5V and see what happens. I don't think I can damage anything with less, can I?
I know that the MPG could be connected in a multitude of configurations but is there any "standard" for which I/O pins to use? I do recall seeing something about this when I first ran PNCConf. At the time I didn't have power applied to the board so I don't think it would work right. I'll be going and searching for more information on that one tonight. Page 27of the 7i77 manual lists 4 "Software Process Data Modes", with mode 3 mentioning 2 MPGs on inputs 16 through 19. How do I know what mode the board is in and/or change it? Do I want to?
Do you think that's a good next step or would it be time to get into the servo amp connections?
Your quick and concise replies have had an incredible effect helping me to figure out whether things are working. Again, it turns out that they are. I can watch hm2_5i25.0.encoder.00.index-enable reset back to FALSE after setting TRUE and rotating the servo shaft somewhere less than a full rotation.
So, next steps.... I have an MPG here that I'm thinking about getting working early on because I don't like having to control axes with a keyboard. The first few times you pick up an MPG it doesn't seem that natural but after a while you don't know how you lived without one. I have a TOSOKU "Handy Controller" HC121. It came to me non-functional and I was able to do some surgery and positively locate and resolve the fault. Its power is supposed to be 12V but I'm thinking I might try it with 5V and see what happens. I don't think I can damage anything with less, can I?
I know that the MPG could be connected in a multitude of configurations but is there any "standard" for which I/O pins to use? I do recall seeing something about this when I first ran PNCConf. At the time I didn't have power applied to the board so I don't think it would work right. I'll be going and searching for more information on that one tonight. Page 27of the 7i77 manual lists 4 "Software Process Data Modes", with mode 3 mentioning 2 MPGs on inputs 16 through 19. How do I know what mode the board is in and/or change it? Do I want to?
Do you think that's a good next step or would it be time to get into the servo amp connections?
Last edit: 26 Feb 2016 23:21 by Sparky961. Reason: Added information relating to 7i77 manual
Please Log in or Create an account to join the conversation.
Time to create page: 0.092 seconds