microcontroller vs parallel port
It comes to mind that using the ethernet port or a pci/pcie card is no different than what I was suggesting in the first place. Your main pc running linuxcnc is talking to a peripheral that is controlling the stepper drivers. I wonder what sort of information is going through the ethernet cable?
Thats not how it is. The steppens always remain under LinuxCNC control. LinuxCNC tells the Mesa stepgens to operate at a specific frequency and the Mesa stepgen will do so until eternity unless its told (by Linuxcnc) to stop or change to a different frequency. But becasue the servo thread is running at 1 kHz, Linuxcnc can vary that frequency 1000 times a second. The stepgens can operate at up to 10 Mhz so this results in smoother operation/ It also removes the need for Linuxcnc to generate the step pulses in software so it much reduces demand on the latency and performance of the Linuxcnc PC.
Please Log in or Create an account to join the conversation.
The information is step-rate, or PWM frequency, and values to write to GPIO pins.
Encoder counts and GPIO input data comes back.
What isn't sent / received is any kind of G-code or motion information that needs to be interpreted on the boards.
Please Log in or Create an account to join the conversation.
I followed the other thread where someone was designing a custom controller. I'll have to read it again. The big problem sounded like dealing the linuxcnc and not the controller.
Are the low level commands documented somewhere, and could they be sent over the serial port?
I have several little machines that might benefit from running linuxcnc so this is interesting to me.
Please Log in or Create an account to join the conversation.
Are the low level commands documented somewhere, and could they be sent over the serial port?
I have several little machines that might benefit from running linuxcnc so this is interesting to me.
There are a number of projects that just do something like that. I'm aware of github.com/scottalford75/Remora and of github.com/kinsamanka/PICnc-V2.
Please Log in or Create an account to join the conversation.
Are the low level commands documented somewhere
They are lower-level than you seem to be imagining.
In the case of the Mesa cards the step rate (etc) is controlled by values written to registers:
github.com/LinuxCNC/hostmot2-firmware/bl...ster/src/regmap#L225
The HAL driver receives position or velocity commands through HAL pins, and writes integer values to the registers on the FPGA accordingly:
github.com/LinuxCNC/linuxcnc/blob/master...tmot2/stepgen.c#L325
Though some of the Mesa cards are a lot less than $200. The 7i90 is $59.If speed is needed, some other microcontroller with a higher clock rate. $12 is much cheaper than $200 and the same job is accomplished.
But, as PCW has pointed out in another thread , it should be possible to send SPI commands direct to a Trinamic stepper drivers (eg the silentstepstick) , and use no microcontroller or FPGA at all.
Please Log in or Create an account to join the conversation.
There are a number of projects that just do something like that. I'm aware of github.com/scottalford75/Remora and of github.com/kinsamanka/PICnc-V2.
I was thinking more along the lines of github.com/dewy721/EMC-2-Arduino
Please Log in or Create an account to join the conversation.
There are a number of projects that just do something like that. I'm aware of github.com/scottalford75/Remora and of github.com/kinsamanka/PICnc-V2.
I was thinking more along the lines of github.com/dewy721/EMC-2-Arduino
It looks like this is based on a userspace python hal component that talks to arduino via serial port at 115200 bps. This architecture is a dead end, you would be better off using grbl or some derivative. IMHO. Comment in the code:
# Note: This interface will always have (at least) serveral milliseconds of
# lag, compared to the standard parallel port latency with lag times of just
# nanoseconds.
Whereas with the approach in the two projects I linked in my earlier post, you do get decent performance.
Please Log in or Create an account to join the conversation.
- MCU over USB as step generator
breaks the idea of the project
- This way the MCU will inevitably become a motion controller (you will port features from linuxcnc into MCU) instead of being a simple hardware
- The main concern is the latency (USB is not designed for realtime. Other projects using USB have a different architecture.)
- Though it looks possible to use linuxcnc + MCU. There are some linuxcnc forks that use external MCU over SPI as simple hardware interface (for example github.com/scottalford75/Remora )
- LinuxCNC supports many different hardware interfaces
- Native PC parallel port works fine (though it has speed limitations etc.)
- An incomplete list of the motion-control hardware supported by LinuxCNC is here: wiki.linuxcnc.org/cgi-bin/wiki.pl?LinuxCNC_Supported_Hardware
- Mesa is
programmableconfigurable hardware device- usually PC (personal computer) does not have dedicated hardware (like PWM etc.) for generating stepper pulses etc. but it has PCI/Ethernet/etc. to attach hardware to
- FPGA is configurable i.e. any device can be configured (MCU on the opposite has fixed hardware structure for example it is not possible to add/reconfigure second/third PWM to MCU)
- Mesa allows to configure devices to generate pulses, read encoders etc. (This does not make Mesa board a motion controller, linuxcnc still controls everything)
- Linux can run on a wide variety of hardware platforms. For example
LinuxCNC at RPI4 with using IO Pins only
- Maybe even some exotic use cases are possible today e.g. converting modern fridge with performant hardware into cnc lathe controller
Please Log in or Create an account to join the conversation.
I just read the replies again and now interested in the idea.
- Could someone please tell whether the same is doable with PC?
- not RPi gpio
- does it sound like poor man's hardware acceleration?
paraport >> software SPI >> AVR PWM1
>> software SPI >> stm32 PWM2
etc.
instead of
PCI/whatewer >> Mesa (PWM1, PWM2 etc.)
I would appreciate any help. (It would be great if someone can tell what source code files to start with. Being a web developer I'm overwhelmed a little bit with all low level stuff at the moment. I cannot even understand whether the idea above will work or not. I just have many of arduino-like boards and would like to utilize them somehow...)
Please Log in or Create an account to join the conversation.
you can use an older version of remora (over SPI) as base/template for the hal-component.
and porting the spi part to parport (soft-spi).
there are already ports of remora to stm32, so you need only to replace the SPI part on the PC side.
Please Log in or Create an account to join the conversation.