7i92T + 5 Axis BOB, encoder pin mapping issue.

More
31 May 2023 20:26 - 02 Jun 2023 22:54 #272605 by Ac1dburn
Hey, long time lurker, first time poster. I'm in the process of converting a Chinese lathe to CNC using a MESA 7i92T and the popular Chinese 5 axis breakout board. I picked these components because I've already done a 3 axis tandem Y CNC router using this combo and I've already ironed out how to get them playing nice together, or so I thought. Only issue I've run into is, I didn't need an encoder on the CNC router build. Here's my problem, I've mapped everything out and hopped into pncconf to start setting up my IO for the 5 axis BOB. Everything seems to make sense except I have a (hopefully) small issue. It appears that pncconf is wanting to put the encoder inputs on pins 13, 14, and 15. According to the 5ABOBx2 pin file readout, that won't work as the encoder inputs are mapped to pins 14, 15, and 16. So the result is, I lose pin 13 which was going to be used for my 6-24v NC NPN inductive sensor for my X axis limit and..., I'm pretty certain the encoder needs to use pins 14, 15 and 16 to function. Is this something I'll just have to remap in the HAL file? I'm okay with doing that but I may be asking more questions as I move forward in trying to figure that process out. Just wanted to ask first to make sure I'm on the right path in my assumptions before I let the smoke out of something. I've shared some pictures to detail exactly what I'm talking about. Sorry in advance for the janky image work. Also attached a pic of the exact 5 axis bob I am using. PS to avoid confusion, IO pins 14, 15, 16 correlate to pins labeled 11, 12, 13 on the breakout board and IO pin 13 correlates to pin 10 on the breakout board. At least from what I'm understanding anyway. 
Attachments:
Last edit: 02 Jun 2023 22:54 by Ac1dburn.

Please Log in or Create an account to join the conversation.

More
31 May 2023 21:29 - 31 May 2023 21:34 #272608 by PCW
The encoder inputs are on DB-25 pins 11,12,13 (GPIO 14,15,16)
These do no interfere with use as GPIO inputs, but you need to
disable the encoders in pncconf for pncconf to show these as available
input pins. ( by setting "Num of encoders"  to 0 on the configuration tab)
Last edit: 31 May 2023 21:34 by PCW. Reason: clarify

Please Log in or Create an account to join the conversation.

More
31 May 2023 23:25 #272614 by Ac1dburn
Correct, I'm able to get all of the inputs to become available to me by disabling the encoder in pncconf, but I need the encoder since it's for a lathe. I was just expecting the encoder to be set to gpio pins 14, 15, 16 when I did have pncconf set to include one encoder. (It appears to be setting them to gpio 13, 14, 15) with one encoder enabled, gpio 16 shouldn't be available as it should be used by the ENC-I. Unless I'm misunderstanding and you're suggesting I set # of encoders to 0, then just hook the encoder wires up where they are supposed to be (db-25 pins 11, 12, 13) and carry on with my configuration. Thanks for the reply by the way

Please Log in or Create an account to join the conversation.

More
01 Jun 2023 00:20 - 01 Jun 2023 00:21 #272616 by PCW
Yes, because pncconf thinks this is for a G540...

For a lathe, I would do this:
Run pncconf with 1 encoder enabled

Do all the normal lathe setup
The actual encoder wiring is to DB25 pins 11,12,13
The only funny business is that pncconfs idea of what GPIO
is free is incorrect so you may need to do some hand editing of the
hal file for setting up misc inputs.
Last edit: 01 Jun 2023 00:21 by PCW.
The following user(s) said Thank You: Ac1dburn

Please Log in or Create an account to join the conversation.

More
01 Jun 2023 00:33 #272617 by Ac1dburn
Perfect! I figured that was the case. I'll have a chance to mess with it again in a few days. Thanks for your help!

Please Log in or Create an account to join the conversation.

More
02 Jun 2023 03:11 #272671 by mor
I have the same setup exact I'm using two of the 5-axis Chinese BOBs; one on each P1 and P2.  I'm using P1 just for additional 5 GPIO pins, 10-13 and 15, for limit switches, E-Stop, and touchprobe.

I used PNCConf and used the Board Discovery feature; see attached.  The 5ABOBx2D.bit requires the encoder to use pins 11, 12, and 13.  You'll still have two pins, 10 and 15 for other GPIO.

IO Connections for P2
DB25 pin#             I/O   Pri. func    Sec. func        Chan     Sec. Pin func   Sec. Pin Dir

11                     14   IOPort       QCount           0        Quad-A          (In)
12                     15   IOPort       QCount           0        Quad-B          (In)
13                     16   IOPort       QCount           0        Quad-IDX        (In)

Attachments:
The following user(s) said Thank You: Ac1dburn

Please Log in or Create an account to join the conversation.

More
02 Jun 2023 10:42 #272692 by tommylight
If you do not load an encoder in hal, those pins can be used as IO.
All pins on 7i92 can be used as gpio, no matter what mesaflash says for stepgen, pwm, encoder, etc, just not loading those functions will leave pins as IO.
In this case, you are limited by BOB, but if you need an encoder, load just one in hal, then you have 2 pins on that port as inputs and all 5 on the other port.
The following user(s) said Thank You: Ac1dburn

Please Log in or Create an account to join the conversation.

More
02 Jun 2023 12:49 #272717 by PCW
Note that even if you enable an encoder (or other input function) ,
those pins can be used as GPIO inputs (just not outputs)
The following user(s) said Thank You: tommylight, Ac1dburn

Please Log in or Create an account to join the conversation.

More
02 Jun 2023 17:49 #272753 by Ac1dburn
Thanks a bunch! Yes, so everything is what I'd suspected I'd have to do. I'm going through the Hal file now and making sure everything is pointing where it should be. Thanks for these replies, helps with my sanity check!
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.119 seconds
Powered by Kunena Forum