realtime independent motor control with linuxcnc
- giantstone
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
25 Jul 2016 14:48 - 25 Jul 2016 14:58 #77987
by giantstone
realtime independent motor control with linuxcnc was created by giantstone
Hello,
I haven't tried linuxcnc yet, but I'm trying to figure out if it will be helpful.
in my understandings, linuxcnc commands the motors move around by pre-defined G-codes. In my situation, when the motors follow a series 2 D trajectory in a plane, I need to control in realtime a third dimention of the trajectory (random by situation, but cannot be pre-defined).
To ahieve this, I will need realtime the position of the moving point under linuxcnc's command, (and the status if the moving point is following a trajectory or it's moving around in prepartion to follow a trajectory. ) Then I need to tell the motors controlled by linuxcnc wait until ready to follow a trajectory at the start and at the end of the trajectory.
Is my intention feasible with linuxcnc?
Many thanks in advance for your time to read my question
I haven't tried linuxcnc yet, but I'm trying to figure out if it will be helpful.
in my understandings, linuxcnc commands the motors move around by pre-defined G-codes. In my situation, when the motors follow a series 2 D trajectory in a plane, I need to control in realtime a third dimention of the trajectory (random by situation, but cannot be pre-defined).
To ahieve this, I will need realtime the position of the moving point under linuxcnc's command, (and the status if the moving point is following a trajectory or it's moving around in prepartion to follow a trajectory. ) Then I need to tell the motors controlled by linuxcnc wait until ready to follow a trajectory at the start and at the end of the trajectory.
Is my intention feasible with linuxcnc?
Many thanks in advance for your time to read my question
Last edit: 25 Jul 2016 14:58 by giantstone. Reason: providing more info.
Please Log in or Create an account to join the conversation.
25 Jul 2016 14:55 #77990
by andypugh
Replied by andypugh on topic realtime independent motor control with linuxcnc
Possible in principle, yes. What is the source of your real-time Z offset data?
The following user(s) said Thank You: giantstone
Please Log in or Create an account to join the conversation.
- giantstone
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
25 Jul 2016 15:03 #77991
by giantstone
Replied by giantstone on topic realtime independent motor control with linuxcnc
Thanks for your quick reply! that's fast
my z offset data will come from calculated values based on visual feedbacks.
btw i pushed my question further a bit:
"To ahieve this, I will need realtime the position of the moving point under linuxcnc's command, (and the status if the moving point is following a trajectory or it's moving around in prepartion to follow a trajectory. ) Then I need to tell the motors controlled by linuxcnc wait until ready to follow a trajectory at the start and at the end of the trajectory."
is it still possible?
my z offset data will come from calculated values based on visual feedbacks.
btw i pushed my question further a bit:
"To ahieve this, I will need realtime the position of the moving point under linuxcnc's command, (and the status if the moving point is following a trajectory or it's moving around in prepartion to follow a trajectory. ) Then I need to tell the motors controlled by linuxcnc wait until ready to follow a trajectory at the start and at the end of the trajectory."
is it still possible?
Please Log in or Create an account to join the conversation.
25 Jul 2016 15:21 #77992
by andypugh
Yes, there is a HAL pin that indicates the motion mode, and that can be used in the HAL logic. Positions are available in HAL too.
linuxcnc.org/docs/2.7/html/man/man9/motion.9.html
You would probably use a controlled Z-axis and then apply an offset to that:
linuxcnc.org/docs/2.7/html/man/man9/offset.9.html
Replied by andypugh on topic realtime independent motor control with linuxcnc
"To ahieve this, I will need realtime the position of the moving point under linuxcnc's command, (and the status if the moving point is following a trajectory or it's moving around in prepartion to follow a trajectory. ) Then I need to tell the motors controlled by linuxcnc wait until ready to follow a trajectory at the start and at the end of the trajectory."
is it still possible?
Yes, there is a HAL pin that indicates the motion mode, and that can be used in the HAL logic. Positions are available in HAL too.
linuxcnc.org/docs/2.7/html/man/man9/motion.9.html
You would probably use a controlled Z-axis and then apply an offset to that:
linuxcnc.org/docs/2.7/html/man/man9/offset.9.html
The following user(s) said Thank You: giantstone
Please Log in or Create an account to join the conversation.
- giantstone
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
09 Aug 2016 13:33 #78529
by giantstone
Replied by giantstone on topic realtime independent motor control with linuxcnc
Hi Andy, Thanks so much for your detailed instructions.
I'm planning to ask for further help on this and planning to pay some cahs for it.
Please read if you have time:
I’m planning to make my standard 4-axis(X Y Z A) workstation cut a series of lines(curves) according to my inputs. The non-trivial part of my goal is that while cutting curves in the X-Y plane I need to use a visual sensor to control the Z axis in real-time. The work-flow(path) of my end tool will be: go to the start point of the first curve in an open space, start spinning the blade(always tangent to the cutting point) , go down until visual sensor feedback says ok, follow the first curve (while my visual sensor adjust the height of the tool in real-time) to the last point, then cut the next curve the same way and so forth.
The control board I’m using is a BeagleBone-black with Cramps 2.2. There is a config file available from Machinekit ( see attachment). And I’m instructed to use HAL pins (motion and offset in particular to achieve my goal.
Here is the plan I came up with: Design a HAL logic which includes motion pins (to parse the cutting movement) and offset pins( to control the Z axis), integrate the HAL logic into a python script, say main.py, that imports pygtk and linuxcnc. ( The main.py will receive the cutting-curves in the machine coordinate system from ROS (robotics operating system) topics, either in the form of a series of sets of coordinates or an depth image, I can do this part myself.) After receiving the cutting-curve, the Linuxcnc will start generating G-codes, and start cutting the curves in the way I described above.
Unfortunately I find it hard to write the HAL logic and integrate everything to my main.py ( I have 0 experience with linuxcnc and HAL, I’m looking for someone who find this easy please help me with some sample scripts or help me to write the frame of my main.py (without the ROS part) .
I’m really grateful for your time and help, and I’m willing to pay some cash for your help.
Please leave a message if you would like to do me a favor.
I'm planning to ask for further help on this and planning to pay some cahs for it.
Please read if you have time:
I’m planning to make my standard 4-axis(X Y Z A) workstation cut a series of lines(curves) according to my inputs. The non-trivial part of my goal is that while cutting curves in the X-Y plane I need to use a visual sensor to control the Z axis in real-time. The work-flow(path) of my end tool will be: go to the start point of the first curve in an open space, start spinning the blade(always tangent to the cutting point) , go down until visual sensor feedback says ok, follow the first curve (while my visual sensor adjust the height of the tool in real-time) to the last point, then cut the next curve the same way and so forth.
The control board I’m using is a BeagleBone-black with Cramps 2.2. There is a config file available from Machinekit ( see attachment). And I’m instructed to use HAL pins (motion and offset in particular to achieve my goal.
Here is the plan I came up with: Design a HAL logic which includes motion pins (to parse the cutting movement) and offset pins( to control the Z axis), integrate the HAL logic into a python script, say main.py, that imports pygtk and linuxcnc. ( The main.py will receive the cutting-curves in the machine coordinate system from ROS (robotics operating system) topics, either in the form of a series of sets of coordinates or an depth image, I can do this part myself.) After receiving the cutting-curve, the Linuxcnc will start generating G-codes, and start cutting the curves in the way I described above.
Unfortunately I find it hard to write the HAL logic and integrate everything to my main.py ( I have 0 experience with linuxcnc and HAL, I’m looking for someone who find this easy please help me with some sample scripts or help me to write the frame of my main.py (without the ROS part) .
I’m really grateful for your time and help, and I’m willing to pay some cash for your help.
Please leave a message if you would like to do me a favor.
Please Log in or Create an account to join the conversation.
09 Aug 2016 16:47 #78535
by andypugh
Replied by andypugh on topic realtime independent motor control with linuxcnc
I make it a rule to never involve cash in my hobbies, and this is my hobby.
However, what you seem to want isn't particularly difficult. But you seem to be making it so
I don't see what ROS is adding to this system. Or, for that matter, where your Python routine fits in.
Your application sounds _very_ similar to a plasma cutter with a cutter-height-control system. And I think that you can probably use exactly the same approach, doing it all in HAL without ROS or any new code.
However, what you seem to want isn't particularly difficult. But you seem to be making it so
I don't see what ROS is adding to this system. Or, for that matter, where your Python routine fits in.
Your application sounds _very_ similar to a plasma cutter with a cutter-height-control system. And I think that you can probably use exactly the same approach, doing it all in HAL without ROS or any new code.
Please Log in or Create an account to join the conversation.
09 Aug 2016 19:01 #78537
by Badger
Replied by Badger on topic realtime independent motor control with linuxcnc
Can you give us a real world example of what you are trying to accomplish? For instance I use an optical tracing plasma cutter but have to make adjustments to the torch height by visually watching the arc distance due to warped metal. Sometimes getting the basic conversation on the same page is the biggest challenge.
Please Log in or Create an account to join the conversation.
- giantstone
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
10 Aug 2016 02:51 #78554
by giantstone
Replied by giantstone on topic realtime independent motor control with linuxcnc
ok, sorry to talk about cash here
I need ROS to receive the cutting curves from another machine,
I will check the plasma cutter system thanks for your help again
I need ROS to receive the cutting curves from another machine,
I will check the plasma cutter system thanks for your help again
Please Log in or Create an account to join the conversation.
- giantstone
- Offline
- Senior Member
Less
More
- Posts: 55
- Thank you received: 0
10 Aug 2016 03:29 - 10 Aug 2016 03:29 #78555
by giantstone
Replied by giantstone on topic realtime independent motor control with linuxcnc
Hi Badger, your optical tracing plasma cutter sounds infinitely similiar to what I'm trying to do.
I'm building a fur cutter, and I have to make adjustment to the blade height by visually watching the blade cutting-depth as well, otherwise the tool may drag the fur around(in a long run for certain it will). could you please teach me how you did it? will you be willing to open-source your code?
thanks very much for your help =D
I'm building a fur cutter, and I have to make adjustment to the blade height by visually watching the blade cutting-depth as well, otherwise the tool may drag the fur around(in a long run for certain it will). could you please teach me how you did it? will you be willing to open-source your code?
thanks very much for your help =D
Last edit: 10 Aug 2016 03:29 by giantstone.
Please Log in or Create an account to join the conversation.
10 Aug 2016 04:17 #78558
by Badger
Replied by Badger on topic realtime independent motor control with linuxcnc
With the optical tracer plasma torch the torch height is adjusted with a knob on a gear rack. I literally reach over and turn the knob as needed. It may be that what you need is something independent from linuxcnc controls since you need to control it, not LNC. It maybe something as simple as a RC servo hooked up to a potentiometer?
If you are dealing with a variable surface where you need to keep the blade in a certain depth you may be able use a proximity sensor to follow the surface. You could have a two stage "Z" axis where the g-code commands the blade to lower and then the proximity sensor would move secondary motor or take over the Z axis motor?
I used quite a few cheats on my Rugbot with help of this forum. The answers are out there, you just have to have the right question.
Good luck.
If you are dealing with a variable surface where you need to keep the blade in a certain depth you may be able use a proximity sensor to follow the surface. You could have a two stage "Z" axis where the g-code commands the blade to lower and then the proximity sensor would move secondary motor or take over the Z axis motor?
I used quite a few cheats on my Rugbot with help of this forum. The answers are out there, you just have to have the right question.
Good luck.
Please Log in or Create an account to join the conversation.
Time to create page: 0.079 seconds