Changing an Isel FB2 to LinuxCNC?

More
06 Feb 2022 17:21 #234126 by knipknap
Hi all,

I recently got an Isel FB2 for free (yay!) and am considering to move it to LinuxCNC, as it currently uses an outdated, proprietary WinXP based, software (Isy 2.5).
My main problem is: I don't know how I can interface with the Logosol LS-173CM-2010 servo drivers .

My knowledge about CNCs is limited - just a few months ago I started with a 3018 desktop CNC using GRBL 1.1 with CNCjs (on a RaspberryPi).

What I know about the Isel: It uses three different Nanotec servos , which were also sold from different brands. I found the manufacturer specs here .
- X-Axis: DH052-120E7N02Y  120W - Servo
- Y-Axis: DH072-330E7N01Y 330W - Servo
- Z-Axis: DH052-120E7-B05   120W - Servo with brake

So my questions are:
- Do I have any hope of using this machine with LinuxCNC?
- I am assuming that I have to replace the existing controller from Isel (it's a CDS 412-V). Any controller recommendation?
- Can I re-use the existing drivers, which only feature a RJ45 port for connecting them to a controller, or will I have to replace them as well?

Any help/hints appreciated.

-Samuel

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

More
06 Feb 2022 18:29 #234142 by andypugh
The servo drives seem to be controlled by RS-485 serial commands.

I think that you would need a driver, but that it might not be very hard to make one.

LinuxCNC _appears_ to support the 5i21:
store.mesanet.com/index.php?route=produc...ct_id=53&search=5i21
But I have not heard of anyone using one.

Alternatively, one of the Mesa controller cards and a 7i85 might be an option:
store.mesanet.com/index.php?route=produc...t_id=124&search=7i85

But, on balance, I think that this would be the best choice: store.mesanet.com/index.php?route=produc...69_62&product_id=324

The reason I like the look of that is that it would allow you to load a Mesa firmware with 4 x RS485 UARTS for the servo drives and 4 x Mesa Smart-serial outputs for general purpose IO and interfacing.

But you would still, probably, need to make a driver. I don't think that would be all that hard, as the protocol is in the docs you linked, and it seems fairly simple. There is an example of a simple uart driver here (for an imaginary device)
github.com/LinuxCNC/linuxcnc/blob/master...ivers/mesa_uart.comp
The send / receive function in lines 55 to 85 are where the "magic" would need to happen to (for example) convert LinuxCNC velocity commands to driver serial data packets, and then convert returned data packets into servo motor encoder positions.

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

More
06 Feb 2022 18:55 #234151 by knipknap
That answers my questions exactly, and it looks like a lot to learn to make this work ;).

Thanks a lot for your help!

-Samuel

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

More
06 Feb 2022 19:19 #234155 by andypugh
Where are you? Maybe there is someone local who could help with a driver if you loaned hardware.

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

More
06 Feb 2022 22:09 #234183 by knipknap
Thanks for the suggestion - I used to be a programmer though, so that part doesn't give me the biggest worries. I just have tons of questions...
  • Reading through the  7i94 manual , the supported firmwares don't seem to include any that support 4 UART + 4 serial IO. The closest one seems to be "PKT", which configures all 8 ports as UART, but no serial IO port. Does that mean I would have to make and flash my own firmware (and/or configuration)?
  • To flash the 7i94, I would connect to it through ethernet - but LinuxCNC would connect to that through parallel or serial communication? Then one of the 7i94 ports would probably need to configured as a parallel port?
  • The 7i94 manual does not seem to include any documentation on how to address each port given a particular firmware. So I don't know how to address individual UARTs (servos) and IO pins when communicating with it.
  • The LinuxCNC UART driver that you referenced uses some input variable "tx_bytes", is there any documentation on where this comes from or what it contains? Documentation of the input data would be the first step if I have to map that to some output for the 7i94.
  • Similarly for the received data.
  • I am not sure if the encoder values of the servos are (supposed to be) fed back through the LS-173 driver, or if the driver handles all that internally with no feedback to the controller.

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

More
07 Feb 2022 02:05 #234210 by andypugh

Reading through the  7i94 manual, the supported firmwares don't seem to include any that support 4 UART + 4 serial IO. The closest one seems to be "PKT", which configures all 8 ports as UART, but no serial IO port. Does that mean I would have to make and flash my own firmware (and/or configuration)?


That is an option, instructions for making custom firmwares can be found here on the forum and on the LinuxCNC Wiki. The Mesa Hostmot FPGA code id open-source. But it is also fairly likely that Mesa can be persuaded to make you one, or might have one available.

To flash the 7i94, I would connect to it through ethernet - but LinuxCNC would connect to that through parallel or serial communication?


No, all communication would be via Ethernet using "mesaflash" to flash the firmware and then the LinuxCNC "hostmot2" and "hm2_eth" drivers to link in to the LinuxCNC HAL layer.

The 7i94 manual does not seem to include any documentation on how to address each port given a particular firmware. So I don't know how to address individual UARTs (servos) and IO pins when communicating with it.


When LinuxCNC loads the hm2_eth driver it will query the board firmware and see what modules are included. For UARTs (and PktUARTs) it will report a port name in the log, which would be the "hook" by which your driver would access the UARTs. For Any "Smart serial" ports it would interrogate the attached devices and create all the appropriate HAL pins automatically.

The LinuxCNC UART driver that you referenced uses some input variable "tx_bytes", is there any documentation on where this comes from or what it contains?

That driver is something that I cobbled together as an example, and as far as I know there is no matching hardware.
The problem I had is that a generic UART interface is almost impossible to code a hogh-level universal driver for so I didn't try. As it happens I have had further thoughts on that, but even those would not help here.
so we would be in the situation of making a custom driver.
To answer your specific question about "tx_bytes" is a variable linked to a HAL pin (Line 43 in the code). For the imaginary device that the driver is for that would probably be set once in HAL. For your application I think that the number of bytes to be transmitted might be calculated inside the driver.
(I realise that you probably don't really know what HAL is yet, but it is the virtual "breadboard" layer in LinuxCNC where internal signals are connected to real-world devices. And, like a breadboard, you can insert many complex signal processing components in the signal path.

I am not sure if the encoder values of the servos are (supposed to be) fed back through the LS-173 driver

Skimming the manual, I think that it does. But I can't see much about the nature of the return data, other than position is 4 bytes.
Running in position mode might be an option. I wonder what ISEL do? My natural inclination is to move as much of the logic as possible in to LinuxCNC where we can see what is going on.

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

More
07 Feb 2022 11:28 - 07 Feb 2022 11:33 #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.
Attachments:
Last edit: 07 Feb 2022 11:33 by knipknap.

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

More
07 Feb 2022 14:05 #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
07 Feb 2022 18:49 #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
07 Feb 2022 18:58 - 07 Feb 2022 19:08 #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: 07 Feb 2022 19:08 by andypugh.

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

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