Changing an Isel FB2 to LinuxCNC?

More
4 years 8 months ago - 4 years 8 months ago #234238 by knipknap
Thanks again for the helpful explanations! The firmware part is making me shy away a bit, this project appears to become more complex with all that.

I am wondering though if a mesa card is even needed, because the machine is currently communicating via a single RS-485 connection.
The LS-173 drivers are all "chained" to allow communication to all of them via a single (shared) RS-485 port, see the attached photo. The machine also has a LS-785 IO card, which is also chained with the LS-173 drivers in the same manner, for IO ports and spindle control.

So if I understand this correctly, I would only need a way to communicate over a single RS-485 UART port from LinuxCNC. Doesn't that simplify things to the point that I don't need any additional hardware? I guess I could program the Raspberry IO pins for RS-485, or to avoid latency issues perhaps use a simpler RS-485 hat, if LinuxCNC has support for that?

Of course I would still need a driver, but at least the hardware part should be simpler, I guess.
Last edit: 4 years 8 months ago by knipknap.

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

More
4 years 8 months ago #234245 by knipknap
...and now I found this:

forum.linuxcnc.org/27-driver-boards/3889...h-mesa-7c81?start=30

Since the 7c81 seems to come with matching firmware, this looks like the potentially easiest solution.

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

More
4 years 8 months ago #234270 by andypugh

Since the 7c81 seems to come with matching firmware, this looks like the potentially easiest solution.
I wouldn't get too hung-up on the firmware, it's not generally too difficult to persuade PCW to make you one. 

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

More
4 years 8 months ago - 4 years 8 months ago #234272 by andypugh

So if I understand this correctly, I would only need a way to communicate over a single RS-485 UART port from LinuxCNC. Doesn't that simplify things to the point that I don't need any additional hardware? I guess I could program the Raspberry IO pins for RS-485, or to avoid latency issues perhaps use a simpler RS-485 hat, if LinuxCNC has support for that?

Of course I would still need a driver, but at least the hardware part should be simpler, I guess.


Maybe so. If your PC has an onboard RS-485 port (and some do[1]) then it would be very easy. Alternatively RS-232 to RS-485 converters are cheap enough. 
There is a driver for onboard serial ports. It only drives the status lines, but might be a very good starting point. 
Docs:  linuxcnc.org/docs/2.8/html/man/man9/serport.9.html
Code:  github.com/LinuxCNC/linuxcnc/blob/master...drivers/serport.comp

Basically, if you have the port address then you just need to use rtapI_inb() and rtapi_outb() commands to write straight to the port. 


[1] For example  www.mini-itx.com/~JNF797-Q370 is claimed to have 2x RS232/422/485 ports. (Not sure how that works...) . (edited the board, found one with that runs of simple DC power without a separate PSU. There are others with CPU soldered-in which might be cheaper and easier, but I didn't find one with DC input, RS485 _and_ included CPU) 
Last edit: 4 years 8 months ago by andypugh.

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

More
4 years 8 months ago - 4 years 8 months ago #234280 by andypugh

Since the 7c81 seems to come with matching firmware, this looks like the potentially easiest solution.
I wouldn't get too hung-up on the firmware, it's not generally too difficult to persuade PCW to make you one. 
Also, once you have the build environment set up to build the firmware, there is only one file to edit to build a custom one. Here is an example (that was made for me, hence the name) that contains both UART and smart-serial. The file declares what components are in the firmware, and which pins they use. [/quote]
Last edit: 4 years 8 months ago by andypugh.

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

More
4 years 8 months ago #234287 by knipknap
I think a RS-232 to RS-485 adapter maybe would not work, because the (chain of) LS-173 uses full duplex (4 wire) RS-485, and I think RS-232 only does half duplex.

Sadly, that maybe also means that a Raspberry Hat would probably not work, because looking at the pinout of the Raspberry, it also has only two pins labels RX/TX, though I guess some IO pins may be re-purposed if the hat comes with a full duplex serial port driver.

So in summary, I still like the 7C81 option best, also because I like the form factor, I have several Raspberries lying around, and it is one of the few boards that are in stock in the EU...

Though I do like the simplicity of the HAL driver (.comp) for the serial port, this was easy to follow even for me, and I think I understand how HAL works now :-). My initial confusion came from thinking I would have to translate G commands into servo driver commands in the HAL driver, which I understand now is of course not needed.

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

Time to create page: 0.243 seconds
Powered by Kunena Forum