Difference between revisions of "Cut To Length (Punching) Application"

From SoftMC-Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Languages}}
+
{{Languages|Cut_To_Length_(Punching)_Application}}
= 简介 =
+
= Introduction =
偏心冲床(曲柄压力机)正在由凸轮到轮的角位置的伺服驱动的进给装置进给。 轮位置是由被连接到驱动器作为外部位置信号(PEXT)的外部反馈装置(旋转变压器,编码器等)进行测定。
+
An eccentric press (crank press) is being feed by a servo-driven feeding device cammed to the angular position of the wheel. The wheel position is measured by an external feedback device (resolver, encoder, etc.) that is connected to a drive as an external position signal (PEXT).
  
= 应用图 =
+
= Application Diagram =
 
[[File:cut2len1.png]]
 
[[File:cut2len1.png]]
  
轮的角位置是在其运行期间连续增加的主源信号。 在轮的每一圈,在一个起始和终止角度值之间进给轴应该停止。
+
The angular position of the wheel is the master source signal that continuously increases during its operation. On each turn of the wheel, there is a start and end angle value where the feed axis should stop.
  
= 运动曲线 =
+
= Motion profile =
进给轴的运行曲线看起来像:
+
The feed axis operation looks like:
  
 
[[File:cut2len2.png]]
 
[[File:cut2len2.png]]
  
构建此应用程序的主要任务是根据以下参数设计凸轮:
+
The main task in building this application is to design a cam according to the following parameters:
轮转角,轮转一整圈所需的pext值。
+
Total wheel turn angle, value of pext needed for one full turn of the wheel.
起始角度,冲孔开始时的轮的角度。
+
Start angle, wheel angle where the punching starts
终止角度,材料移动时轮转过角度或冲孔结束时的轮的角度。
+
End angle, wheel angle where the material can be moved or when the punching ends.
切割长度,在终止角度到下一个起始角度从轴位置的距离。
+
Length of the cut, the distance of slave position between the last end-angle to the next start-angle of the wheel.
从轴的最大加速度和速度,在凸轮运动过程中不能超过这些值。
+
Maximum acceleration and velocity of the slave axis, these values can not be exceeded during camming.
另外一个限制是决定采用速度梯形曲线来进行从动。 可以采用另一个运动曲线,但方程式将不同。
+
An additional limitation is the decision to take velocity trapezoidal profile for the slave motion. Another profile could be taken, but the equations would differ.
假设轮速度是恒定的,对于计算而言是已知的。 现在,要从给定的A,L,T值计算运动曲线,请参见示例末尾的附录。
+
The wheel velocity is assumed to be constant and known for the computations. Now, to compute a motion profile from the given A, L, T values, see Appendix at end of example.
  
= 程序 =
+
= Program =
 
<syntaxhighlight lang="vb">
 
<syntaxhighlight lang="vb">
 
common shared c1 as cam
 
common shared c1 as cam
Line 171: Line 171:
 
'''
 
'''
  
= 记录曲线 =
+
= Profile recording =
主轮旋转两圈(切割长度20 mm):
+
Two turns of the master wheel (cut length 20 mm):
  
 
[[File:cut2len4.PNG]]
 
[[File:cut2len4.PNG]]
  
长度35mm,接近三角形曲线:
+
A 35 mm length close to triangular profile:
  
 
[[File:cut2len5.png]]
 
[[File:cut2len5.png]]
  
= 用已知的A,L,T计算速度曲线 =
+
= Computing velocity profile with known A, L, T =
  
 
[[File:cut2len3.PNG]]
 
[[File:cut2len3.PNG]]

Latest revision as of 15:36, 27 November 2017

Language: English  • 中文(简体)‎

Introduction

An eccentric press (crank press) is being feed by a servo-driven feeding device cammed to the angular position of the wheel. The wheel position is measured by an external feedback device (resolver, encoder, etc.) that is connected to a drive as an external position signal (PEXT).

Application Diagram

cut2len1.png

The angular position of the wheel is the master source signal that continuously increases during its operation. On each turn of the wheel, there is a start and end angle value where the feed axis should stop.

Motion profile

The feed axis operation looks like:

cut2len2.png

The main task in building this application is to design a cam according to the following parameters: • Total wheel turn angle, value of pext needed for one full turn of the wheel. • Start angle, wheel angle where the punching starts • End angle, wheel angle where the material can be moved or when the punching ends. • Length of the cut, the distance of slave position between the last end-angle to the next start-angle of the wheel. • Maximum acceleration and velocity of the slave axis, these values can not be exceeded during camming. An additional limitation is the decision to take velocity trapezoidal profile for the slave motion. Another profile could be taken, but the equations would differ. The wheel velocity is assumed to be constant and known for the computations. Now, to compute a motion profile from the given A, L, T values, see Appendix at end of example.

Program

common shared c1 as cam

dim shared toolong as error "The given cut length is too long for the given slave accel."
dim shared toofast as error "Slave axis can not move that fast"

' Shared profile parameters:..............................................
dim shared lprof        as double  ' total length 
dim shared aprof        as double  ' acceleration used
dim shared vprof        as double  ' cruise velocity
dim shared t_acc_prof   as double  ' acceleration duration
dim shared t_dec_prof   as double  ' end of cruise phase
dim shared t_tot_prof   as double  ' total velocity trapeze duration
'.........................................................................

program
    ' Process data
    dim sangle      as double = 10  ' start to cut at this angle
    dim eangle      as double = 60  ' finish the cut at this angle
    dim rev         as double = 360 ' full turn of the wheel
    dim Vwheel      as double = 60  ' RPM - velocity of the wheel
    
    dim CutLength   as double = 20  ' mm of the slave motion
    dim CutAngle    as double
    dim CutTime     as double 
    dim i           as long
    
    ' Variables used in cam computation
    dim t           as double
    dim t_from_end  as double

    ' Creating 1000 points in the cam
     createcamdata 1000 c1  
                  
    ' Computing the next motion
    CutAngle = rev - (eangle-sangle)    ' The wheel passes this angel while it moves
    CutTime  = CutAngle/(Vwheel*360/60) ' Time needed to move to another cut (sec)
    with A1
    
        call ProfileLTA(CutLength,CutTime,Acc)
        
        ' Start computing the cam table
        ' t is relative time of velocity trapeze profile
        for i = 1 to c1.size
           c1.MasterData[i] = (i-1)*rev/c1.size ' Defining a uniform master axis
           
           select case (c1.MasterData[i])
              case is < sangle     ' it is a rotary axis in cases when master < start
                  ' we need to compute the relative time from the end    
                  t_from_end = (sangle - c1.MasterData[i])/(Vwheel*360/60)
                  t = CutTime - t_from_end
                  c1.SlaveData[i] = VTProfile(t)  - CutLength 
                  
              case is <= eangle    ' master is between start and end - no motion of slave:
                  c1.SlaveData[i] = 0.0
                  
              case is > eangle     ' Time passed after exit [start,end] master segment
                  t = (c1.MasterData[i]-eangle)/(Vwheel*360/60)
                  c1.SlaveData[i] = VTProfile(t)
                  
           end select 
        next
    end with
    
    with A2
        ' Setup the cam table
        c1.Cycle            = -1 ' endless camming
        Attach
           FirstCam         = c1
           MasterSource     = A1.Pcmd   'For example with 2 axes
'           MasterSource    = pext
           GearRatio        = 1
           Slave            = CAM
           SlaveDisconnect  = 0
           En               = ON
        Detach
         
    end with
    
    Print "Cut to length Ready"
    
end program


' Velocity Trapeze pre-calculation routine
' Input: Length, Total time, max Accleration
' Global used: Vmax

sub ProfileLTA(byval L as double ,byval T as double, byval A as double)
    dim sqr as double
    
    with A1
      aprof = A
      sqr = T^2 - 4*L/A
      select case (sqr)
      
        case is < -0.004 ' less then 4ms
            throw toolong
            
        case is < 0
            ' In cases of numeric computation errors (high accel. values) this could be a small
            ' negative number. In order to avoid math error the value is cut to zero.
            sqr = 0          
            
        case else
            sqr = sqrt(sqr)
      end select
      
      vprof = 0.5*A*(T - sqr)
      if vprof > vmax then
            throw toofast
      end if
      
      ' Compute fixed points in time (end of acceleration, begin of deceleration)
      t_acc_prof = vprof/A
      t_dec_prof = T - t_acc_prof
      t_tot_prof = T
      
    end with
end sub


'.................................................................................
' Velocity Trapeze gernal purpose profile function
' uses shared variables:
' t_acc - time where acceleration ends (cruise starts)
' t_dec - time where deceleration starts (cruise ends)
' t_tot - end of movement
' aprof - accleration/deceleration value
' vprof - cruise (max) velocity
' lprof - total movement length
function VTProfile(byval t as double) as double
  select case(t)          
     case is <=0
      VTProfile = 0 
     case is <= t_acc_prof
      VTProfile = 0.5*aprof*t^2
     case is <= t_dec_prof
      VTProfile = 0.5*vprof^2/aprof + (t-t_acc_prof)*vprof
     case is < t_tot_prof
      VTProfile = lprof - 0.5*aprof*(t_tot_prof-t)^2
     case else
      VTProfile = lprof
   end select
end function

Profile recording

Two turns of the master wheel (cut length 20 mm):

cut2len4.PNG

A 35 mm length close to triangular profile:

cut2len5.png

Computing velocity profile with known A, L, T

cut2len3.PNG