Two arduinos between Duet2 wifi and BLtouch
-
Hello,
Me and my team are building a giant cable driven 3d printer. A modification of the hangprinter. I've run into a problem with the zprobe.
The distance from the end effector to duet is over 15 meters. We have and arduino nano on the endeffector and Mega next to duet that are communicating through rs485.
Our plan was was to get the zprobe commands from duet transferred to mega then from mega to nano. Then nano proceeds to use the BLtouch and sends the data back to mega which sends it to duet. I wonder if it's possible to get it working like this? I can see a possible problem atleast from the delays in the data transfer.
Also despite my efforts I have not found what kind of data is coming from duet to BLtouch so I have no idea how to pass it through between the arduinos. Also I'd need to know in what form should the data go back to duet?
Could I for example shove the data into an uint16_t using bitwise operator and transfer it back to duet?
Anyway, if somebody with more knowledge on the subject could tell if this idea is a fools errand or actually a doable I'd highly appreciate it!
Best Regards,
PieTorque -
As I understand it the bltouch has two interfaces, a standard RC PWM in for probe mode and deeploy / retract and a descrete high low out for probe trigger.
You can read in the pwm from the duet and write back to the bltouch with Arduino standard RC servo libraries. And the descrete is just a digital read write command.
Pass the data between the two Arduino how ever you like.
Hope that helps.
If anyone knows better please correct me.
All the best
Barry M -
@pietorque
Have you considered a duet3 + tool daughter board over can bus? Might make it all a duet based drop in solution for you. -
@cncmodeller Hello,
Thank you for responding so briefly. I have not considered it, not yet atleast. Something I'll definately look into since we're planning on migrating to duet3 at some point
-
@pietorque Basically, the Duet commands the Z axis to move down and when it sees the digital signal on ZProbe go true, it stops moving down and records the current Z position.
With your setup, the Duet will command the Z axis to move down, and when the BLTouch detects the bed, it will make its output true, then:
- Arduino Nano notices the digital input
- Package up a message to send via RS485
- Wait for other messages in progress to finish
- Send message serially.
- MEGA receives message and decodes it
- MEGA makes its output true
- DUET notices Zprobe going true and stops moving down and records the current Z position.
You can imagine that all the delay and variability in all those conversions are going to either result in your BLTouch crashing right through the bed before the DUET receives the signal, or will be so variable due to conversion times and transmission/receiving times that you'll get a vastly different number for every probe.
It will take several additional wires going from the Duet to the BLTouch, but you'll get much better results by using a "Line driver/receiver" pair going in each direction.
The PWM signal from the Duet goes into a line driver, then through wires to the end effector, then to a line receiver and back to TTL.
The "Contact! signal from the BLTouch goes into a line driver, then through wires to the Duet-end, then to a line receiver and back to TTL.
There will still be some delays, but they will be small and predictable so you'll get good results.
-
@PieTorque
I agree with alankilian, there is too much latency when sending each probe signal via all these relais stations.
You could ask the arduino closest to the BLTouch to do all the probepoints and then send the whole heightmap as one file to the duet. That should be doable, since Marlin runs on ATMega328P, they sure have some working bed-leveling routines.For such long distances I'd use fiberglass transmitters for peace of mind. They can use standard RX/TX protocol. No need for RS485.
-
@pietorque said in Two arduinos between Duet2 wifi and BLtouch:
building a giant cable driven 3d printer
A side question, is BlTouch a good fit for a giant printer? I would think that it's deployment and detection distances were optimized for much smaller printers.
-
@zapta said in Two arduinos between Duet2 wifi and BLtouch:
@pietorque said in Two arduinos between Duet2 wifi and BLtouch:
building a giant cable driven 3d printer
A side question, is BlTouch a good fit for a giant printer? I would think that it's deployment and detection distances were optimized for much smaller printers.
I would use an inductive probe if you are not planning on using some sort of magnettically secured printing surface.
-
@pietorque You might be able to use two ESP32s and the ESPNOW protocol as wireless serial bridges. Someone did it to wirelessly connect a paneldue (search the forum if you are interested), so it is possible.
-
-
@oliof said in Two arduinos between Duet2 wifi and BLtouch:
Someone did it to wirelessly connect a paneldue
A panelDue or a Z-probe are two different shoes.
If you meant to transfer the whole heightmap at once, I see ESP32 as an option. But WiFi would cause even more latency problems (and higher variation) than a cable driven serial connection. ( and it can take a few attempts to bind two ESP32 with ESPnow AFAIR) -
That solution sounds to me like overkill.
The servo signal from the Duet is at a slow speed, so I don't think it should have any trouble going over a 15m cable.
The signal coming back from the BLTouch is an open-drain signal. In the not-triggered state it should be fairly immune to noise. In the triggered state it will pick up noise from adjacent cables. To mitigate that, it may be sufficient to add a pullup resistor of between 2.2K and 4.7K between the BLTouch output and +5V. Alternatively, at the BLTouch end you could use a pullup resistor and a 74HC chip to buffer the signal.
If there are stepper motor wires in the same bundle than either the BLTouch wires (along with other signals wires e.g. for temperature sensors) or the stepper motor wires should be shielded, and the stepper motor wires should be two twisted pairs, one pair per phase.
The best solution is probably a Duet 3 plus a tool board, which will also reduce the number of wires going to the print head; but if the axis motors use external drivers or servo drives then you may want to wait for the external driver version of the Duet 3 main board.
-
@dc42 said in Two arduinos between Duet2 wifi and BLtouch:
... but if the axis motors use external drivers or servo drives then you may want to wait for the external driver version of the Duet 3 main board.
Hi @dc42, what is the timeline on the external driver version of the Duet 3 main board? Are there details available?
Many thanks
Barry M -
@cncmodeller said in Two arduinos between Duet2 wifi and BLtouch:
Hi @dc42, what is the timeline on the external driver version of the Duet 3 main board? Are there details available?
My guess is 3 months. However, there is a severe shortage of semiconductors developing, so we may have to change our design plans to suit what is available rather than what we would like to use.
-
@dc42 said in Two arduinos between Duet2 wifi and BLtouch:
@cncmodeller said in Two arduinos between Duet2 wifi and BLtouch:
Hi @dc42, what is the timeline on the external driver version of the Duet 3 main board? Are there details available?
My guess is 3 months. However, there is a severe shortage of semiconductors developing, so we may have to change our design plans to suit what is available rather than what we would like to use.
Ok thanks for the info, I'll keep a weather eye in the forum for future updates.