How to redirect the machine commands
13 May 2016 08:12 #74588
by MH7400
How to redirect the machine commands was created by MH7400
Hi *,
is it possible to define/configure some kind of "target machine" where all the primitive commands (move from current position to some new XYZ, and so on...) derived from the interpreted G code are stored in the formatted file?
My use case:
I've built simple 3 axis machine with stepper motors. These motors are driven by HW I've built too and this small HW receives the commands over RS232. The data (formatted text file, in principle) contains simple commands like move to XYZ, wait a while and so on. I want to use the LinuxCNC to interpret the G code and to "export" the primitive commands in any "simple enough" form so that I can feed my HW with it directly or after some conversion I'll implement, without the need to interpret the G code self.
Thanks a LOT for the feedback!
BR,
MH7400
is it possible to define/configure some kind of "target machine" where all the primitive commands (move from current position to some new XYZ, and so on...) derived from the interpreted G code are stored in the formatted file?
My use case:
I've built simple 3 axis machine with stepper motors. These motors are driven by HW I've built too and this small HW receives the commands over RS232. The data (formatted text file, in principle) contains simple commands like move to XYZ, wait a while and so on. I want to use the LinuxCNC to interpret the G code and to "export" the primitive commands in any "simple enough" form so that I can feed my HW with it directly or after some conversion I'll implement, without the need to interpret the G code self.
Thanks a LOT for the feedback!
BR,
MH7400
Please Log in or Create an account to join the conversation.
13 May 2016 12:08 #74592
by andypugh
All things are possible... But I don't know if LinuxCNC is the best starting point. (LinuxCNC is a machine controller that happens to have a G-code interpreter, and you only want to use the G-code interpreter).
The module you want is probably sai, the Stand Alone Interpreter:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...dc646ebe0ad320cf12d5
See also the demo config which uses canterp (an altenative interpreter that uses a language other than G-code)
start sim->axis->canterp from the config picker and load the canterp_example.can file.
The INI file that shows how to choose an alternative interpreter is:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...dc646ebe0ad320cf12d5
It is quite likely that some other project (GRBL perhaps?) is a better starting point for what you want to do.
Replied by andypugh on topic How to redirect the machine commands
is it possible to define/configure some kind of "target machine" where all the primitive commands (move from current position to some new XYZ, and so on...) derived from the interpreted G code are stored in the formatted file?
All things are possible... But I don't know if LinuxCNC is the best starting point. (LinuxCNC is a machine controller that happens to have a G-code interpreter, and you only want to use the G-code interpreter).
The module you want is probably sai, the Stand Alone Interpreter:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...dc646ebe0ad320cf12d5
See also the demo config which uses canterp (an altenative interpreter that uses a language other than G-code)
start sim->axis->canterp from the config picker and load the canterp_example.can file.
The INI file that shows how to choose an alternative interpreter is:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...dc646ebe0ad320cf12d5
It is quite likely that some other project (GRBL perhaps?) is a better starting point for what you want to do.
Please Log in or Create an account to join the conversation.
17 May 2016 07:11 #74787
by MH7400
Replied by MH7400 on topic How to redirect the machine commands
Hi andypugh,
thanks you for the answer/hints. I've played with LinCNC in the last few days and I like it really. I decided to use LinCNC for my machine. The GRBL is nice, but it is primarily intended to run in the machine HW - my approach is somewhat different. My HW controlling the machine is "smart enough" just to understand some VERY basic commands sent over serial line (formatted human readable texts - go to some XYZ and so on) - thanks to RS232 communication I don't need any real time kernels. And, the "brain" - interpreting of G code (or any other code) inclusive scaling and any additional intelligence should be done in the PC.
OK, now, my plan: I'll hack the LinCNC so that it produces the output I need for my machine. What is your opinion? I mean - do you think it is good or bad idea :-D?
Thanks for any feedback.
thanks you for the answer/hints. I've played with LinCNC in the last few days and I like it really. I decided to use LinCNC for my machine. The GRBL is nice, but it is primarily intended to run in the machine HW - my approach is somewhat different. My HW controlling the machine is "smart enough" just to understand some VERY basic commands sent over serial line (formatted human readable texts - go to some XYZ and so on) - thanks to RS232 communication I don't need any real time kernels. And, the "brain" - interpreting of G code (or any other code) inclusive scaling and any additional intelligence should be done in the PC.
OK, now, my plan: I'll hack the LinCNC so that it produces the output I need for my machine. What is your opinion? I mean - do you think it is good or bad idea :-D?
Thanks for any feedback.
Please Log in or Create an account to join the conversation.
17 May 2016 13:51 #74789
by andypugh
I think that you might end up with a system very similar in concept to the Pico / Mesa / General Mechatronics options, and should probably consider running the system the same way.
You would use the preempt-rt kernel version to get good timing of the 1kHz servo thread and use a HAL driver to send the axis position commands to the serial port.
I don't know of any existing drivers that send _data_ to the serial port in real-time, and that will still be required to work this way.
The reason that this arrangement needs realtime is that the HAL driver only gets positions, the rate of change of the positions (and hence velocity and acceleration limits) is controlled by the trajectory planner, but for that to be accurate the updates need to be absolutely regular.
Replied by andypugh on topic How to redirect the machine commands
OK, now, my plan: I'll hack the LinCNC so that it produces the output I need for my machine. What is your opinion? I mean - do you think it is good or bad idea
I think that you might end up with a system very similar in concept to the Pico / Mesa / General Mechatronics options, and should probably consider running the system the same way.
You would use the preempt-rt kernel version to get good timing of the 1kHz servo thread and use a HAL driver to send the axis position commands to the serial port.
I don't know of any existing drivers that send _data_ to the serial port in real-time, and that will still be required to work this way.
The reason that this arrangement needs realtime is that the HAL driver only gets positions, the rate of change of the positions (and hence velocity and acceleration limits) is controlled by the trajectory planner, but for that to be accurate the updates need to be absolutely regular.
Please Log in or Create an account to join the conversation.
Time to create page: 0.068 seconds