<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Printhead Calculations
Pixel Pitch
$pixel_{Pitch} = \frac{25400\frac{\mu m}{inch}}{{Resolution}}$
$sub_pixel_{Pitch} = \frac{25400\frac{\mu m}{inch}}{{Resolution*NbrOfSubpixels}}$
Step1:  Error in Pixel Pitch $\Delta x_{Pitch}$because of substrate speed and clock frequency
$\Delta x_{Pitch} = v_{Substrate}∙\Delta t$
Error is the modulus of the achieved and the ideal pixel pitch.
$e = Rest(\frac{pixel_{Pitch}}{\Delta x_{Raster}})$
Step2:  Resolution
Step3:  Stitching
For Steinemann machine (KonicaMinolta KM1024i)
$pixel_{overlap} = \frac{ph_{resolution}}{2.54\frac{cm}{inch}* ph_{overlapping}}$
Step4:  Pixel distance
KonicaMinolta KM1024i & KM1024
$ pixel_{pitch} = \frac{25.4\frac{mm}{inch}}{ph_{resolution}} $
Printing Speed
$pixel_{pitch} = \frac{25.4\frac{mm}{inch}}{resolution_{ph}} = [mm]$
$freq_{adjusted} = \frac{freq_{ph}*percent_{speed}}{100} = [Hz]$
$speed = pixel_{pitch} * freq_{adjusted} * \frac{resolution_{ph}}{resolution_{job}} = [\frac{mm}{s}]$
Step7:  Printing Dimensions
For calculating the Printing dimensions in x and y axis. The following values are needed.
* section_witdh = Number of bytes of a section. Can be found in CoE Memory Organization 8040
Step8:  Techma 4
Step9:  Digiround
Step10:  RDA Multihead
Step11:  Fire Time
<ASSISTANT_TASK:>
Python Code:
import numpy as np
resolutions    = [150, 360, 600, 1200, 2400, 4800] # dpi
inch2cm        = 2.54 # cm/inch
nbrOfSubpixels = 32
# Calulation Pixel Pinch
pixel_pitch = np.empty(shape=[len(resolutions)], dtype=np.float64) # um
for i in range(len(resolutions)):
  pixel_pitch[i] = (inch2cm/resolutions[i])*10000
# Calculation Subpixel Pinch
sub_pixel_pitch = np.empty(shape=[len(resolutions)], dtype=np.float64) # um
for i in range(len(resolutions)):
  sub_pixel_pitch[i] = pixel_pitch[i]/nbrOfSubpixels
  
for i in range(len(resolutions)):
  print("Resolution: {:4} dpi   Pixel Pitch: {} um   Sub Pixel Pitch: {} um".format(resolutions[i], pixel_pitch[i], sub_pixel_pitch[i]))
  
Explanation: Printhead Calculations
Pixel Pitch
$pixel_{Pitch} = \frac{25400\frac{\mu m}{inch}}{{Resolution}}$
$sub_pixel_{Pitch} = \frac{25400\frac{\mu m}{inch}}{{Resolution*NbrOfSubpixels}}$
End of explanation
import numpy as np
import pylab as pl
pl.clf()
frequencies = [50e6, 100e6, 150e6, 200e6] # MHz
speed = np.linspace(0,10,50) # 50 x points from 0m/s to 10m/s
for freq in frequencies:
  delta_x_pitch = (speed*100000) * 1/freq # um/s / s
  #error = numpy.mod(pixel_pitch[1],delta_x_pitch)
  # Plot graph  
  pl.plot(speed,delta_x_pitch,label=str(int(freq/1000000))+" MHz")
# Place legend, Axis and Title
pl.legend(loc='best')
pl.xlabel("Speed [m/s]")
pl.ylabel("$\Delta$ x_pitch or Error [um]")
pl.title("Pixel Pitch Errors @ {}dpi".format(resolutions[1]))
Explanation: Error in Pixel Pitch $\Delta x_{Pitch}$because of substrate speed and clock frequency
$\Delta x_{Pitch} = v_{Substrate}∙\Delta t$
Error is the modulus of the achieved and the ideal pixel pitch.
$e = Rest(\frac{pixel_{Pitch}}{\Delta x_{Raster}})$
End of explanation
pixel_pitch = 0.1692 # mm
inch2cm = 2.54 # cm/inch
resolution = (inch2cm/pixel_pitch)*10
print("Resolution: {:4} dpi   Pixel Pitch: {} um".format(resolution, pixel_pitch))
Explanation: Resolution
End of explanation
ph_resolution  = 360   # dpi
inch2cm        = 2.54  # cm/inch
ph_overlapping = 0.196 # cm
pixel_overlap = ph_resolution / inch2cm * ph_overlapping
print("{} dots".format(pixel_overlap))
Explanation: Stitching
For Steinemann machine (KonicaMinolta KM1024i)
$pixel_{overlap} = \frac{ph_{resolution}}{2.54\frac{cm}{inch}* ph_{overlapping}}$
End of explanation
resolution_job = 720  # dpi
resolution_ph  = 360  # dpi
f_ph           = 30e3 # Hz
speed_percent  = 100  # %
#-------------------------------------
inch2mm     = 25.4 # mm/inch
#-------------------------------------
pixel_pinch = inch2mm/resolution_ph          # (inch/mm)/(dot/inch) = mm/dot
adjusted_frequency = f_ph / 100 * speed_percent # Hz
speed = pixel_pinch * adjusted_frequency * resolution_ph/resolution_job # (mm/dot) * 1/s * (dot/inch)/(dot/inch) = mm/s
print("Pixel Pinch = {} mm".format(pixel_pinch))
print("Adjusted Frequency = {}% of {} Hz = {} Hz".format(speed_percent, f_ph, adjusted_frequency))
print("Speed = {} mm/s".format(speed))
print("Speed = {} m/s".format(speed/1000))
Explanation: Pixel distance
KonicaMinolta KM1024i & KM1024
$ pixel_{pitch} = \frac{25.4\frac{mm}{inch}}{ph_{resolution}} $
Printing Speed
$pixel_{pitch} = \frac{25.4\frac{mm}{inch}}{resolution_{ph}} = [mm]$
$freq_{adjusted} = \frac{freq_{ph}*percent_{speed}}{100} = [Hz]$
$speed = pixel_{pitch} * freq_{adjusted} * \frac{resolution_{ph}}{resolution_{job}} = [\frac{mm}{s}]$
End of explanation
import math
def printing_dimensions(section_width, section_depth, section_numbers, number_of_channels, ph_dpi):
  
  printing_dimensions calculates the printing width and length of a printhead with the available memory
  :param section_width      : (bytes^=pixel/channel) Can be found in CoE Memory Organization 8040:1
  :param section_depth      : (bytes => 1 byte=2 px) Can be found in CoE Memory Organization 8040:2
  :param section_numbers    : Can be found in CoE Memory Organization 8040:3
  :param number_of_channels : Equals number of colors per board
  :param ph_dpi             : Dpi of the printheads
  :return print_width       : height (cross print axis) in mm of the printable width per printhead
  :return print_length      : length (print axis) in mm of the printable job
  
  # Constants
  inch2m     = 0.0254 # m/inch
  pixel_byte = 2      # pixel/byte
  
  # Calc Pixel Pitch
  pixel_pitch = inch2m/ph_dpi # in m
  
  # Calc Print width = Y Axis = Crossprint Axis
  section_width_pixel = section_width # this is already in bytes (1 byte = 1 px)
  print_width = section_width_pixel*pixel_pitch
  
  # Calc Print length = X Axis = Print Axis
  section_depth_pixel = section_depth * pixel_byte
  print_length = section_depth_pixel*section_numbers*pixel_pitch
  
  # Calc memory size
  memory_size_byte  = section_width*section_depth*section_numbers*number_of_channels
  memory_size_pixel = memory_size_byte * pixel_byte
  
  # Print
  print("Memory Size              : {} MBytes = {} MPixels".format((memory_size_byte/1000/1000), (memory_size_pixel/1000/1000)))
  print("PixelPitch @ {:3}dpi     : {} um".format(ph_dpi,pixel_pitch*1000*1000))
  print("Image width              : {} mm".format(print_width*1000))
  print("Print length             : {} m".format(print_length))
  
  # m_number_of_sections=MEMORY_SIZE/(Memory_Section::get_width()*Memory_Section::get_depth()*anheads);
  # m_memory_depth=m_number_of_sections*Memory_Section::get_depth();
  
  return print_width, print_length
def biggest_multipage_job(print_length, max_image_size):
  
  calculates the max number of multipages in job with a given substratesize (max_image_size).
  :param print_length       : max length of the job according to printing_dimensions() return value
  :param max_image_size     : max size of one image
  :return nbr_of_multipages : max number of multipage in the entire job
  
  nbr_of_multipages = print_length*1000/max_image_size
  print("Max Number of Multipages : {} pages = {} pages".format(nbr_of_multipages, int(math.floor(nbr_of_multipages))))
  return nbr_of_multipages
Explanation: Printing Dimensions
For calculating the Printing dimensions in x and y axis. The following values are needed.
* section_witdh = Number of bytes of a section. Can be found in CoE Memory Organization 8040:1
* section_depth = Number of bytes of a section. Can be found in CoE Memory Organization 8040:2
* Number of sections = Number of bytes of a section. Can be found in CoE Memory Organization 8040:3
* Number_of_channels = Equals number of colors per board
* Resolution of the Printhead
$print_{width} = section_{width} * 2\frac{pixel}{byte} * \frac{0.0254\frac{m}{inch}}{ph_{dpi}} = [m]$
$print_{length} = section_{depth} * section_{numbers} * 2\frac{pixel}{byte} * \frac{0.0254\frac{m}{inch}}{ph_{dpi}} = [m]$
End of explanation
section_width      = 3072  # bytes = pixel
section_depth      = 16384 # bytes (1 bytes = 1 px)
section_numbers    = 21    # Nbr per Channel (Color)
number_of_channels = 1     # Number of printheads per board
ph_dpi             = 600   # dpi
print_width, print_length = printing_dimensions(section_width, section_depth, section_numbers, number_of_channels, ph_dpi)
# For 4 GB of RAM
print_length = print_length *4
print("Print length (4GB)       : {} m".format(print_length))
Explanation: Techma 4
End of explanation
section_width      = 1536  # bytes ^= pixel per channel
section_depth      = 8192  # bytes => 1bytes = 2 pixel (by 4bpp)
section_numbers    = 21    # Nbr per Channel (Color)
number_of_channels = 4     # Number of printheads per board
ph_dpi             = 360   # dpi
subrate_length     = (281.94, 125.56) # (x, y) in mm (DART_24PX_SHORT_CMYK)
print_width, print_length = printing_dimensions(section_width, section_depth, section_numbers, number_of_channels, ph_dpi)
nbr_of_multipages = biggest_multipage_job(print_length,subrate_length[0] )
Explanation: Digiround
End of explanation
section_width      = 1536  # bytes ^= pixel per channel
section_depth      = 8192  # bytes => 1bytes = 2 pixel (by 4bpp)
section_numbers    = 21    # Nbr per Channel (Color)
number_of_channels = 4     # Number of printheads per board
ph_dpi             = 360   # dpi
subrate_length     = (115.5822, 80) # (x, y) in mm
print_width, print_length = printing_dimensions(section_width, section_depth, section_numbers, number_of_channels, ph_dpi)
nbr_of_multipages = biggest_multipage_job(print_length,subrate_length[0] )
Explanation: RDA Multihead
End of explanation
def calc_fire_time(speed=10, dpi=1200): # speed = [m/min] dpi = [dpi]
  inch2m      = 0.0254
  pixel_pitch = inch2m/dpi # m
  fire_time = float(pixel_pitch) / (float(speed)/float(60))
  print("Speed       = {} m/min".format(speed))
  print("Resolution  = {} dpi".format(dpi))
  print("Fire Time   = {} s = {} kHz".format(fire_time, 1/fire_time/1000))
  fire_time_act = 0.000131
  dif = fire_time_act - fire_time
  dist = float(speed)/float(60)*dif
  print("Distance    = {} ".format(dist))
  print("")
calc_fire_time(speed=10,dpi=1200)
calc_fire_time(speed=10,dpi=600)
calc_fire_time(speed=10,dpi=150)
calc_fire_time(speed=50,dpi=600)
calc_fire_time(speed=50,dpi=150)
Explanation: Fire Time
End of explanation
<END_TASK>