IO Questions around mixing IO between Ethercat and Pi 5?

More
1 year 4 months ago - 1 year 4 months ago #329810 by jhandel
Howdy all,
     I am working out the high level architecture (and ordering) for a Ethercat retrofit of my CNC Mill ( its VFD is dying and its as good an excuse as any to re work may decisions I made on it when I converted it to LinuxCNC the first time).. 

Anyways, I am looking at the MPG and realizing that I have open IO pins on my pi (like all of them).

So here is my current "plan" for I/O which I would love feedback on 

1x EK1100 - Ethercat to FieldBus coupler
2x EL1819  - 16 inputs (I need 28 so 2 it is) - (the response time is killer vs the EL1809)
1x EL2819 - 16 output (need 11 so that works)
1x EL5151 - Encoder for the MPG  <-- this is where I would love feedback because this guy is $250 used

The really open question is what risks on integration and general PITA am I facing if I use my Pi's IO pins to handle MPG encoder rather than the spendy EL5151. 

I plan to use either Leadshine or Innovance mult-turn servos for all of my motors and spindle so my only current known need for an encoder is the MPG...  This is less a question of "can I mix Ethercat with Pi IO pins" and more a question of "should I"... Am I setting myself up for sparks and pain getting the realtime thread where the Pi IO will come in syncing with the rest of the system that is all running on the Server Thread? 

To that end, should I be using other parts of the Pi's IO for emergency stuff like e-stop? 

Thanks in advance. 
Last edit: 1 year 4 months ago by jhandel.

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

More
1 year 4 months ago #329841 by unknown
Shouldn't be an issue, as all you you are doing is adding another function, servo thread should be ok for MPG.
Give it a go and see what happens.

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

More
1 year 4 months ago #329845 by jhandel
so your saying take the Pi GPIO and put it on a server thread not on a realtime thread?

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

More
1 year 4 months ago #329846 by unknown
Yeah, a manual MPG shouldn't require reading at the same rate as would be required for spindle encoder.
Just remember that the RPi io is only 3.3v tolerant, so a way of translating the MPG signal voltage and protecting the RPi io from noise.
The 74lvc series are 3.3v devices that are 5v tolerant on their inputs.

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

More
1 year 4 months ago #329854 by tommylight
Or using "voltage dividers" made from 2 resistors for each input also works fine, but care must be taken to prevent the lower side resistor from disconnecting.
It does induce more current draw from outputs though, but i know for sure in most cases all is OK.

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

More
1 year 4 months ago #329871 by jhandel
if I can take any two inputs and turn them into an MPG encoder in the HAL then could I just take two inputs from the EtherCat side?

I was thinking I would need to be running on an realtime thread to do encoder counting due to some timing issues between "listening" to A and B ticks.. But if the Pi GPIO can run on the Servo thread and 1ms is fast enougn, then it should be fast enough for the ethercat IO too right??

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

Time to create page: 0.059 seconds
Powered by Kunena Forum