FullControlXYZ / fullcontrol

Python version of FullControl for toolpath design (and more) - the readme below is best source of information
GNU General Public License v3.0
672 stars 78 forks source link

Can you help me desing an overhang test for 5 axis printer? #77

Open qlqlo opened 7 months ago

qlqlo commented 7 months ago

I want to create an overhang test for my 5 axis printer, but I struggle with python and math. I wrote a code in which I did not care about the rotation of the nozzle and I already got stuck. I was able to write a code that makes the base geometry, but when I skip to next segment there is a big gap and I don't know how to fix it. Can you please guide me through this problem?

extrusion_width = 2
extrusion_height = 1                    # and layer height
initial_z = extrusion_height*0.6           # for squish of the 1st layer

x_size = 40
y_size = 20
start_point = fc.Point(x=0, y=0, z=initial_z)
segment_length = 50
angle_between_segments = 10 # degrees

x0, y0 = 0,0
x1, y1 = x_size,y0
x2, y2 = x1,y1+y_size
x3, y3 = x0,y2

steps = []

angle_in_radians = math.radians(angle_between_segments)
z_offset = - segment_length
y_offset = 0

for segment in range(10):
  y_offset = y_offset + segment_length * math.sin(angle_in_radians)
  z_offset = z_offset + segment_length * math.cos(angle_in_radians)

  angle = segment * angle_between_segments
  angle_in_radians = math.radians(angle)

  z_move = math.cos(angle_in_radians)
  y_move = math.sin(angle_in_radians)

  z_correction = y_size * math.sin(angle_in_radians)
  y_correction = 0
  y_correction = y_size * math.cos(angle_in_radians)

  print(y_offset)

  for layer in range (50):
    point0 = fc.Point(x=x0, y=y0 - layer*y_move - y_offset, z=initial_z + extrusion_height*layer*z_move + z_offset)
    point1 = fc.Point(x=x1, y=y1 - layer*y_move - y_offset, z=initial_z + extrusion_height*layer*z_move + z_offset)
    point2 = fc.Point(x=x2, y=y0 - layer*y_move - y_offset + y_correction, z=initial_z + extrusion_height*layer*z_move + z_offset + z_correction)
    point3 = fc.Point(x=x3, y=y0 - layer*y_move - y_offset + y_correction, z=initial_z + extrusion_height*layer*z_move + z_offset + z_correction)
    steps.append(point0)
    steps.append(point1)
    steps.append(point2)
    steps.append(point3)

fc.transform(steps, 'plot', fc.PlotControls(color_type='print_sequence', style='line'))
AndyGlx commented 7 months ago

I currently have a student looking at this. His project is almost finished, so I don't want to offer too much advice here without speaking to him. But we'll certainly be able to help. I'll reply again as soon as I can.

qlqlo commented 7 months ago

I currently have a student looking at this. His project is almost finished, so I don't want to offer too much advice here without speaking to him. But we'll certainly be able to help. I'll reply again as soon as I can.

That is awesome. I can't wait for your reply.

Renush-Vigneswaran commented 7 months ago

Hi there @qlqlo, I'm the student @AndyGlx mentioned

It's great to hear you're exploring overhang testing for your 5-axis printer !

Could you share a bit more about your setup? I'm curious to know how you achieved the extra axis - is it a tilt bed/rotation bed/ printhead rotation etc ?

I've also been looking at overhangs and the various angles achievable, I've got a simplified version of my code on this Colab Page : https://colab.research.google.com/drive/1n6t9KyUTwaeUtU5lq1rR2WVu0pn4WsWa?usp=drive_link . While it might take a slightly different approach for testing overhangs, with some minor tweaks you should be able to achieve your intended outcome.

I use the helix function Fullcontrol offers and alter the end radius in comparison to the start radius to achieve an overhang on the outside edge, the radius' will change accordingly to the angles you input, but since I use trig to calculate the radius' some angles wont work, as for example Tan(90) = undefined, this can be overcome with conditional statements if the angle is undefined by telling it the length you'd like it to come out by 90 degrees to the last layer - if that makes sense?

Another method is to use points to create a curved line on the YZ plane and use those points as radius' of the helix by defining the centre.

I hope this helps, I look forward to your reply and assisting you further!

Kind regards, Renush

qlqlo commented 7 months ago

Hey! We use a 6-axis angular robot for large scale printing right now. We use regular gcode so far, but I want to experiment how the robot handles 5 axis gcode commands with this overhang test. We will build a 5-axis printer for printing high-end thermoplastics in the future, and we will most likely go with the printhead rotation, but it is possible that this will change. If you are interested I will keep you updated. I have requested an access to your colab page from my gmail account. Thanks for your willingness to help and good luck with your project.

Renush-Vigneswaran commented 7 months ago

Hey there @qlqlo , Thank you for sharing your intriguing project details with us, this is indeed of interest and fascinating for us, it would be great if you can keep us updated!

Ensuring the success of such projects are of utmost importance to us and are committed to providing support to ensure the quality of your G-code.

Would you be open to scheduling an online meeting with both myself and my supervisor @AndyGlx, the creator of Fullcontrol, to delve deeper into your objectives and requirements, it will be interesting to have a chat and see if we can offer our expertise. I am happy to set this up using your provided Gmail address ?

I've granted you access to the Colab page, you can view and utilise the code according to your interests now.

I look forward to your reply and the opportunity to collaborate further.

Kind regards, Renush

qlqlo commented 7 months ago

Thanks for letting me access your notebook. The notebook you provided goes in a different direction I want to go. The notebook you shared with me is not very useful since the design can be easily achieved by a regular slicer via vase mode. Do you have any notebook utilizing 5 axis gcode? I would be open to consultation once I get the hang of the 5-axis gcode a little.

AndyGlx commented 7 months ago

Ha we understand that - the simplified notebook deliberately replicates regular vase-mode as a baseline

The beauty of FullControl is that adding fc.Point(b=angle_#) before the helix command immediately gives us a multiaxis toolpath with nozzle tilt however we like, including inverse kinematics. A few other commands like that allow for 5th axis rotation too. But system-specific information and considerations are necessary, hence the suggestion to chat. In contrast, you can test the 3-axis one as an initial trial immediately.

We'll make the 5-axis stuff public soon, alongside the printer-hardware mod, once we've had time to add instructions, etc. However, Renush will finish working on his project in a few weeks so you may wish to embrace the amazing potential of that FullControl design before that time 😉