Integrating Touchdro with steppers

andy_ck87028

Registered
Registered
Joined
Aug 27, 2024
Messages
4
Hi,
I confess I am overwhelmed and quite out of my depth in this need however to me it makes perfect sense.
Given the Touchdro adapter at any given time knows exactly where the cutting head is then why not inform the steppers to stop when the cutting envelope limit has been reached? My mill has a lot of backlash and my steppers will be intended purely as powerfeed and not grbl driven.
My goal is to take the realtime position known by Touchdro and export it to a position monitoring arduino which will have x,y,z limits defined (with display and numeric setting feature) thus defining the envelope. When a limit is reached that arduino will signal to the stepper arduino that the relevant x,y or z stepper must stop and can only move within the envelope.
My question is: how can I retrieve the realtime position of the cutting head from the Touchdro adapter and make it available to the position monitoring arduino?
Please remember I am way out of my depth and am planning my project at this stage. My only arduino uno is still in the box and has yet to be programmed to move the stepper.

Many thanks in advance

Andrew
 
Hi,
I confess I am overwhelmed and quite out of my depth in this need however to me it makes perfect sense.
Given the Touchdro adapter at any given time knows exactly where the cutting head is then why not inform the steppers to stop when the cutting envelope limit has been reached? My mill has a lot of backlash and my steppers will be intended purely as powerfeed and not grbl driven.
My goal is to take the realtime position known by Touchdro and export it to a position monitoring arduino which will have x,y,z limits defined (with display and numeric setting feature) thus defining the envelope. When a limit is reached that arduino will signal to the stepper arduino that the relevant x,y or z stepper must stop and can only move within the envelope.
My question is: how can I retrieve the realtime position of the cutting head from the Touchdro adapter and make it available to the position monitoring arduino?
Please remember I am way out of my depth and am planning my project at this stage. My only arduino uno is still in the box and has yet to be programmed to move the stepper.

Many thanks in advance

Andrew
Andrew,
Please don't take this as me trying to offend you, but given the question(s), I'd say "don't do it". What you are suggesting might work when things go right, but it will not be accurate or reliable. This sort of thing needs to have pretty tight closed loop control to work correctly, and chaining a TouchDRO + an Arduino (or two?) is just a plain bad idea:
1. TouchDRO does not give you a realtime position. It has semi-fixed refresh rate (capped at about 50 Hz), so you are getting 20ms delay right away.
2. The data is coming as a plain text, so you will need to have a parser in your Arduino. It's a basic FSM (finite state machine), but given the limited resources of the 8-bit processor, string manipulation will be pretty taxing, and will add more delay to the loop.
3. Stopping steppers with 0 deceleration is a bad practice, so you will need to implement some sort of PID-ish control loop. Given the inherent delay, it will be a VERY sloppy PID loop.
4. You will need to think hard about failure modes. I.e. what happens if TouchDRO looses power? Do you stop when there is no position reading for 20 seconds? What happens when you get an unexpected reading? How will you handle all of the "service" messages (TouchDRO sends a lot of difference stuff to the app besides just the position).

In general, controlling things that can kill or injure you is not a good "I want to learn Arduino" project. This can and will go wrong due to small bugs, edge cases, etc. and knowing what those things are and how to handle them comes from a lot of experience, among other things. I've been writing software in various capacities since early 2000, and I still don't feel comfortable adding this sort of thing to TouchDRO. Motion control is hard...

Regards
Yuriy
 
Hi and welcome,

CNC controllers are much cheaper than TouchDRO and will match up with equally cheap stepper drivers. Linux CNC https://www.linuxcnc.org/ is free and will allow you to create an inexpensive CNC machine with less effort than what you're proposing here. Also, lots of folks have been down this path before you and can offer help and advice along the way.

John
 
Yuriy is right- objection #1 pretty much says it all- it's not realtime (enough) and not closed loop
 
Hi and welcome,

CNC controllers are much cheaper than TouchDRO and will match up with equally cheap stepper drivers. Linux CNC https://www.linuxcnc.org/ is free and will allow you to create an inexpensive CNC machine with less effort than what you're proposing here. Also, lots of folks have been down this path before you and can offer help and advice along the way.

John
Thx Matthew. I will possibly cnc a separate mill later but for now I want powerfeed and manual feed and dro.

Sent from my SM-T500 using Tapatalk
 
Andrew,
Please don't take this as me trying to offend you, but given the question(s), I'd say "don't do it". What you are suggesting might work when things go right, but it will not be accurate or reliable. This sort of thing needs to have pretty tight closed loop control to work correctly, and chaining a TouchDRO + an Arduino (or two?) is just a plain bad idea:
1. TouchDRO does not give you a realtime position. It has semi-fixed refresh rate (capped at about 50 Hz), so you are getting 20ms delay right away.
2. The data is coming as a plain text, so you will need to have a parser in your Arduino. It's a basic FSM (finite state machine), but given the limited resources of the 8-bit processor, string manipulation will be pretty taxing, and will add more delay to the loop.
3. Stopping steppers with 0 deceleration is a bad practice, so you will need to implement some sort of PID-ish control loop. Given the inherent delay, it will be a VERY sloppy PID loop.
4. You will need to think hard about failure modes. I.e. what happens if TouchDRO looses power? Do you stop when there is no position reading for 20 seconds? What happens when you get an unexpected reading? How will you handle all of the "service" messages (TouchDRO sends a lot of difference stuff to the app besides just the position).

In general, controlling things that can kill or injure you is not a good "I want to learn Arduino" project. This can and will go wrong due to small bugs, edge cases, etc. and knowing what those things are and how to handle them comes from a lot of experience, among other things. I've been writing software in various capacities since early 2000, and I still don't feel comfortable adding this sort of thing to TouchDRO. Motion control is hard...

Regards
Yuriy
No offense Yuriy. Excellent information and thanks taking time out.

Sent from my SM-T500 using Tapatalk
 
Back
Top