IO interface with Arduino over Ethernet

More
9 years 7 months ago #89232 by DocStein99

andypugh wrote: This is the code that reads Mesa encoder values:
github.com/LinuxCNC/linuxcnc/blob/master...tmot2/encoder.c#L862

And, if you care, this is the vhdl that defines the encoder on the FPGA
github.com/LinuxCNC/hostmot2-firmware/bl...r/src/qcountersf.vhd


Ok, well you've just gave away all the magic. I was a little mystified before, but now I can see the code is as simple as writing an ansi .C class object - that uses the same digital standard for all the other devices - yes, it is quite straight forward (to me).

The examples are a very important to me - thank you for pointing them out. I was actually interested in knowing how these signals were transferred and how I could design my own hardware interface to solve the comparability struggles I go through each time I make another system. I've wanted to make my own remote step/direction output board to merge directly to the motor driver, and get rid of the 4-6+ bulky long wires that had to route through the cabinet to the motors.

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

More
9 years 7 months ago #89235 by andypugh

DocStein99 wrote: Ok, well you've just gave away all the magic. I was a little mystified before, but now I can see the code is as simple as writing an ansi .C class object.


Yes, it really is quite easy. It is easy because John Kasunich (and others) made a really good job of making HAL extendable, and Seb Kuzminsky made a really good job of making Hostmot2 interfaces abstractable even though when he started there was only PCI and EPP.
At this point in time I think that I have written about half of the Mesa to HAL interface code, but that was all made possible by others designing their interfaces well. The first C-code I ever wrote was the Mesa card LED HAL driver.
LinuxCNC is _meant_ to be easy to code for.

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

More
9 years 7 months ago #89237 by DocStein99
Linux is a whole lot easier to code - compared to MICROSOFT! I held a career as applications engineer in Visual Studio, processing data in SQL servers, and telephony SIP voice streams. Windows has so many layers of permissions, grants, rights to access admin for each and every move - it's evolved to take the fun out of coding and bring misery of security! I can't go on about how many bible sized books I studied to try and learn how to write a hardware device driver in windows.....

LinuxCNC is easy after learning as much as I have from using it and studying all that I could about how each and every signal is generated, toggled and passed through all the way down to the motor itself. I bought plans 12 years ago on soldering my own stepper driver board using logic gates and tip-120's, since it was important for me to know how to make a motor move from the push of my keyboard button, all the way down to the electric passed through those coils.

I am interested in helping linuxCNC as it has helped for me, in the past. It's a powerful collection of tools limited only by imagination, really. Remote controlling motors, wireless, the list is endless.

It took me a little poking around to find this thread, was kind of frustrated when it took me a little searching around. I figured since the last time I did a setup, someone surely added a feature to toggle i/o pins through a tcp socket. It's a real drag lacing up dozens of wires to make a hardware control panel.

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

More
9 years 7 months ago #89243 by andypugh

DocStein99 wrote: I figured since the last time I did a setup, someone surely added a feature to toggle i/o pins through a tcp socket.


linuxcnc.org/docs/2.7/html/man/man1/linuxcncrsh.1.html

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

More
9 years 7 months ago - 9 years 7 months ago #89321 by DocStein99

andypugh wrote: linuxcnc.org/docs/2.7/html/man/man1/linuxcncrsh.1.html


This is a useful feature for me, absolutely. But the cnccrsh has no actual user interface, which makes jogging blind without readouts or anything else. That feature would be great to just design the user interface in Windows to actually control the hardware linux side, on anything else.
Last edit: 9 years 7 months ago by DocStein99.

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

More
9 years 7 months ago #89492 by M4MazakUser
Im looking at ordering a stm32f103c8t6 and a enc28j60 network adapter to see how much speed i can get for encoder counting... The arm cortex-m3 runs at 72mhz and it looks like it can be programmed from the arduino ide. I'll let you know how i go.

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

Time to create page: 0.439 seconds
Powered by Kunena Forum