In [2]:
import math
def grad_to_mm(diameter, grad_dist):
return diameter/2 * grad_dist/180 * math.pi
# Machine Settings
Machine_speed = 24000 # Bottles/hr
Carroussel_diameter = 2400.0 # mm
Bottles_per_carroussel = 60.0 # pcs
Resolution = 810.00 # dpi
DPD = 1.00
Image_length = 80.00 # mm
Print_station_spacing = 6.4 # °
Print_restart_time = 30 # ms
# Speed
Carroussel_speed = Machine_speed / (Bottles_per_carroussel * 60) # rev/min
Print_linear_speed = (math.pi * Carroussel_diameter) / 1000 * Carroussel_speed / 60 # m/s
Print_frequency = 1/1000 * DPD * Print_linear_speed / (0.0254 / Resolution) # kHz
# Positioning
Bottle_spacing = 360 / Bottles_per_carroussel # °
Bottle_spacing_linear = grad_to_mm(Carroussel_diameter, Bottle_spacing) # mm
Print_station_spacing_linear = grad_to_mm(Carroussel_diameter, Print_station_spacing) # mm
Print_length = Image_length + (Print_station_spacing_linear - Bottle_spacing_linear) # mm
Bottle_spacing = math.pi * Carroussel_diameter / Bottles_per_carroussel # mm
Idle_space = Bottle_spacing - Print_length # mm
# Timings
Idle_time = Idle_space * 1 / Print_linear_speed # ms
Spare_time = Idle_time - Print_restart_time # ms
print("Calculations")
print("----------------------------------")
print("Machine settings")
print("------------------")
print("Machine speed = {:<8} [Bottles/hr]".format(Machine_speed))
print("Carroussel diameter = {:<8} [mm]".format(Carroussel_diameter))
print("Bottels per carroussel = {:<8} [pcs]".format(Bottles_per_carroussel))
print("Resolution = {:<8} [dpi]".format(Resolution))
print("DPD = {:<8} [-]".format(DPD))
print("Image length = {:<8} [mm]".format(Image_length))
print("Print station spacing = {:<8} [°]".format(Print_station_spacing))
print("Print restart time = {:<8} [ms]".format(Print_restart_time))
print("")
print("Speed calculations")
print("----------")
print("Carroussel speed = {:<8.4f} [rev/min]".format(Carroussel_speed))
print("Print linear speed = {:<8.4f} [m/s]".format(Print_linear_speed))
print("Print frequency = {:<8.4f} [kHz]".format(Print_frequency))
print("")
print("Positioning")
print("----------")
print("Bottle spacing = {:<8.2f} [°]".format(Bottle_spacing))
print("Bottle spacing linear = {:<8.2f} [mm]".format(Bottle_spacing_linear))
print("PrintSt. lin. spacing = {:<8.2f} [mm]".format(Print_station_spacing_linear))
print("Print length = {:<8.2f} [mm]".format(Print_length))
print("Bottle spacing = {:<8.2f} [mm]".format(Bottle_spacing))
print("Idle space = {:<8.2f} [mm]".format(Idle_space))
print("")
print("Timings")
print("----------")
print("Idle time = {:<8.3f} [ms]".format(Idle_time))
print("Spare time = {:<8.3f} [ms]".format(Spare_time))