Fitting an encoder to non Tormach mill (Again)

More
25 Apr 2021 22:16 #207048 by rafferty
Almost finished my conversion, last thing is getting spindle RPM into PathPilot. Been here before a few years ago but never finished the job.

Currently using the PP bitfile. With encoders=2 I get the PPR encoder on GPIO 16 and what looks like a real encoder on GPIO 30, 31 and 32. Here's the 5i25 pinout, I'm using some of the P2 GPIO pins.
# 5i25
# Configuration pin-out: 
#
#                    IO Connections for P3
#    Mill Function   P3 Pin# I/O     Pri. func    Sec. func    Chan      Pin func        Pin Dir
#
#    Spindle Speed    1        0     IOPort       StepGen       4        Step/Table1     (Out)
#    Coolant         14        1     IOPort       None                                   (Out)
#    X Direction      2        2     IOPort       StepGen       0        Dir/Table2      (Out)
#    Estop Reset     15        3     IOPort       None                                   (In)
#    X Step           3        4     IOPort       StepGen       0        Step/Table1     (Out)
#    Spindle Dir     16        5     IOPort       None                                   (Out)
#    Y Direction      4        6     IOPort       StepGen       1        Dir/Table2      (Out)
#    Charge Pump     17        7     IOPort       PWM           0        PWM             (Out)
#    Y Step           5        8     IOPort       StepGen       1        Step/Table1     (Out)
#    Z Direction      6        9     IOPort       StepGen       2        Dir/Table2      (Out)
#    Z Step           7       10     IOPort       StepGen       2        Step/Table1     (Out)
#    A Direction      8       11     IOPort       StepGen       3        Dir/Table2      (Out)
#    A Step           9       12     IOPort       StepGen       3        Step/Table1     (Out)
#    X Limit         10       13     IOPort       None                                   (In)
#    Y Limit         11       14     IOPort       None                                   (In)
#    Z Limit         12       15     IOPort       None                                   (In)
#    PPR.            13       16     IOPort.      Encoder       0        ppr             (In) not used, was a-home/acc
#
#                    IO Connections for P2
#    Mill Function   P2 Pin# I/O     Pri. func    Sec. func    Chan      Pin func        Pin Dir
#
#    !at_spped        1       17     IOPort                                              (In) gpio used
#                    14       18     IOPort                                              (-)
#    lo/!hi           2       19     IOPort                                              (Out) gpio used
#                    15       20     IOPort                                              (-)
#    a-home/acc-in    3       21     IOPort                                              (In) gpio used
#                    16       22     IOPort                                              (-)
#    !machine_ok      4       23     IOPort                                              (In) gpio used
#                    17       24     IOPort                                              (-)
#                     5       25     IOPort                                              (-)
#                     6       26     IOPort                                              (-)
#                     7       27     IOPort                                              (-)
#                     8       28     IOPort                                              (-)
#                     9       29     IOPort                                              (-)
#     tach index     10       30     IOPort       Encoder       1                        (In) trying to
#     tach ph A      11       31     IOPort       Encoder       1                        (In) use this
#     tach ph B      12       32     IOPort       Encoder       1                        (In) encoder
#                    13       33     IOPort                                              (-)

Encoder 1 is not making sense which could either be Tormach mods or my incompetence.

It was suggested back in the day I should switch to a 'standard' bitfile and that's what I'm about to do.

All the bitfiles for the 5i25 appear to be for a 5i25 with 1 or 2 attached expansion cards, is there a bitfile that supports just P3 and P2 connecting to the world ?

Ken

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

More
26 Apr 2021 01:49 #207057 by PCW
Not sure what you mean by attaching to the world. In general you would always use some kind of a breakout board with a 5I25.

Tormach has custom firmware for their 1-PPR "encoder" used on their "RapidTurn" attachment

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

More
26 Apr 2021 03:13 #207066 by rafferty

Not sure what you mean by attaching to the world. In general you would always use some kind of a breakout board with a 5I25.

Tormach has custom firmware for their 1-PPR "encoder" used on their "RapidTurn" attachment


By 'world' I mean external to the computer, in this instance the control box for the mill which has the stepper drivers, spindle control. estop etc.

I don't see the need for any breakout board, the interface (my design) has two DB25s that go to the 5i25, all signals are opto isolated or buffered as required. My interface IS the breakout board I suppose.

If you look at the P2 pinout that's all I need, an encoder and a few GPIOS. On those same pins would be nice but I put jumpers on my board to accommodate other pins.

All I need to know is what bitfile will do the P3 and P2 pins.

Thanks, Ken.

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

More
26 Apr 2021 03:45 #207068 by PCW
If you look at the .pin files in the 5i25.zip archive,
there should be one that's suitable:

The generic parallel port type pinouts are these:

5i25_hdbb2
5i25_dmmbob1x2
5i25_r990x2
5i25_mx3660x2
5i25_bstechx2
5i25_hdbb2
5i25_benezanx2D
5i25_pmdx126x2
5i25_5ABOBx2
5i25_c11x2
5i25_c11gx2
5i25_g540_enc
5i25_prob_rfx2
5i25_g540x2

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

More
27 Apr 2021 06:51 #207199 by rafferty

If you look at the .pin files in the 5i25.zip archive,
there should be one that's suitable:


I've been through all the pin files in the current 5i25.zip and an older one I have, by all II mean all, not the just the suggested BOB ones, there's nothing that matches my (tormach) based pinout.

mesa dump shows the bitfile has two encoders, I was hoping the second instance was a real encoder but the dump lists two instances of an encoder so both are pulse-per-rev.

I can get by with the pulse-per-rev encoder for DRO display but I was hoping to do a bit better for any spindle sync I might try down the road.

Thanks for your help, Ken

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

More
27 Apr 2021 13:20 #207220 by PCW
Here is a Tormach pinout bitfile for a 5I25

File Attachment:

File Name: 5i25_tmd.zip
File Size:82 KB
Attachments:

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

More
27 Apr 2021 14:01 #207226 by rafferty

Here is a Tormach pinout bitfile for a 5I25


My sincerest thanks for this.

I will give it a run first thing tomorrow, it's midnight here right now.

Many thanks again, Ken.

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

More
28 Apr 2021 05:24 #207289 by rafferty
The new bitfile works well, I've yet to set up the spindle encoder, I have to do a bit of research on that, lowpass filter on position output for instance.

Unused encoder 01 sits on top of GPIO pins used for limit switch inputs. I don't think this is a problem at least on inputs, is it?

Yesterday I said none of the pinouts of existing bitfiles matched the tormach pinout. Today while testing the new bitfile I realised I was comparing header pin numbers with DB-25 pin numbers. I'll look through the pin files again just to put the record straight

Thanks again for sorting me out,

Ken

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

More
28 Apr 2021 18:39 #207321 by PCW
Special function inputs (like quadrature encoders) do not
interfere with GPIO input usage, but will prevent using those pins
as GPIO outputs (but you can do that by setting encoders=1)

Likewise, special function outputs (Step/Dir/ PWM etc)
revert to GPIO if disabled by limiting the number enabled
in the driver command line

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

More
29 Apr 2021 12:49 #207367 by rafferty
That's what I understood the relationship between GPIOs and component I/O to be.

I went through all 5i25 pin files again today, looking at the correct connector pinouts today and there's nothing that would have done the job.

Ken

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

Moderators: cncbasher
Time to create page: 0.164 seconds
Powered by Kunena Forum