Need some help with the math
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- mpetrasinovic
- Posts: 106
- Joined: Sat Feb 22, 2020 10:19 am
- Location: Belgrade, Serbia
- Contact:
Re: Need some help with the math
Again, glad to help
I didn't even know that B-code exists but the wire-bending capability for the Path workbench would be a really good thing to have.
I didn't even know that B-code exists but the wire-bending capability for the Path workbench would be a really good thing to have.
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Need some help with the math
UPDATE.
I finally had time to wire up a stepper motor to drive the wire extruder and get Lenny configured to drive it. I did my first bending tests yesterday with some success. Good news is it bent a wire! Bad news, is there's some issues to resolve.
Here's the sample wire I'm bending. It's just a sketch so all segments are on the same plane. The first segment processed is the short 5mm one at the bottom. Selecting the sketch and running my attached macro will produce the b-code and Lenny's gcode in the report window. The b-code looks like this:
So far, so good. But the bent wire is wrong. I'll post again as I work it out.
I finally had time to wire up a stepper motor to drive the wire extruder and get Lenny configured to drive it. I did my first bending tests yesterday with some success. Good news is it bent a wire! Bad news, is there's some issues to resolve.
Here's the sample wire I'm bending. It's just a sketch so all segments are on the same plane. The first segment processed is the short 5mm one at the bottom. Selecting the sketch and running my attached macro will produce the b-code and Lenny's gcode in the report window. The b-code looks like this:
Code: Select all
Length Rotation Angle
====== ======== ======
5.000 0.00 90.000
25.000 180.00 48.000
40.000 180.00 81.000
20.000 0.00 0.000
- Attachments
-
- bendingcode.FCMacro
- (3.61 KiB) Downloaded 28 times
-
- bendtest.FCStd
- (4.49 KiB) Downloaded 71 times
Re: Need some help with the math
Well, it works, congratulations! The rest is fine tuning.
If I look at the first 90° bend it seems that Lenny is still a bit hesitant about bending. Taking that into account it seems that the angle of the subsequent bends should rather be 180°-angle. And Lenny seems to a bit stubborn, thinking something like "I just turned 180° and now again? No, sir, if he really wanted this he wouldn't have turned the first time!"
If I look at the first 90° bend it seems that Lenny is still a bit hesitant about bending. Taking that into account it seems that the angle of the subsequent bends should rather be 180°-angle. And Lenny seems to a bit stubborn, thinking something like "I just turned 180° and now again? No, sir, if he really wanted this he wouldn't have turned the first time!"
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Need some help with the math
Exactly. I think the bending algorithm is about right. There's some spring-back in the wire and he isn't tuned very accurately but that's fine tuning.
That was my first thought too..and part of the problem I think. flipping it to 180 degrees - angle improves it but the last segment is still inverted.Taking that into account it seems that the angle of the subsequent bends should rather be 180°-angle. And Lenny seems to a bit stubborn, thinking something like "I just turned 180° and now again? No, sir, if he really wanted this he wouldn't have turned the first time!"
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Need some help with the math
Actually, You were pretty close on this one too. The b-code produced by the algorithm gives the rotation angle between bends incrementally. But Lenny's C joint is in absolute coordinates so when commanded to go to 180 degrees the second time, he said, "I'm already there" and didn't move. Easy fix and he's producing something like correct bends now.
Now to fine tune....
Re: Need some help with the math
It becomes so simple once you know the reason.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- mpetrasinovic
- Posts: 106
- Joined: Sat Feb 22, 2020 10:19 am
- Location: Belgrade, Serbia
- Contact:
Re: Need some help with the math
I did not saw this posts until now. Glad to see the wire, is it working now?
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Need some help with the math
I posted the first of a series of videos about this project. This is just the introduction so not much content yet.
I've been able to do some very basic bends. I still have some issues to work out and I want to merge the b-code generating logic into master as a python module.
I'm not sure what this will look like in the Path module yet so stay tuned.
I've been able to do some very basic bends. I still have some issues to work out and I want to merge the b-code generating logic into master as a python module.
I'm not sure what this will look like in the Path module yet so stay tuned.
- mpetrasinovic
- Posts: 106
- Joined: Sat Feb 22, 2020 10:19 am
- Location: Belgrade, Serbia
- Contact:
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Need some help with the math
Thanks! I may take you up on that. I'm going to get serious testing and bending now that the bender is ready.mpetrasinovic wrote: ↑Mon Jun 01, 2020 7:09 pm Looking good. I am willing to help if you run into some new math/mechanics problem.