Presentation on theme: "SPiiPlus Training Class"— Presentation transcript:
1 SPiiPlus Training Class Motion Profile Generation
2 What is Motion Profile Generation? Motion profile generation is the process by which the controller takes a high level command and creates a finely sampled motion profileAt a minimum the controller will calculate a new position every update cycleAdvanced controllers will also calculate velocity, acceleration, and jerk (acceleration/sec)High level command can be streamed by a host or executed directly by the motion controllerMany different algorithms can be used to generate the motion profile / trajectoryMotion profile / trajectory can be for a single or multi-axis move
4 Motion Generation: SPiiPlus MasterFormulaECATPosition(MPOS)Motion GeneratorAxis Position (APOS)CONNECT formulaReference Position (RPOS)Convert units to counts (EFAC)Convert counts to units (EFAC)Feedback Position (FPOS)User Commands / External SignalsFeedbackDrive CommandMPU
5 Important ACSPL+ Motion Variables VEL: Commanded VelocityMotor commanded velocity in user units / secondThis is the maximum velocity of the motion profileACC: Commanded AccelerationMotor commanded acceleration in user units / second2This is the maximum acceleration of the motion profileDEC: Commanded DecelerationMotor commanded deceleration in user units / second2This is the maximum deceleration of the motion profileJERK: Commanded JerkMotor commanded jerk in user units / second3This is the maximum jerk of the motion profileKDEC: Kill DecelerationUsed for the KILL command only
6 Important ACSPL+ Motion Variables APOS: Axis PositionLogical axis position in user-defined unitsCalculated directly from motion generator every MPU cycleComes before the CONNECT functionRPOS: Reference PositionMotor commanded position in user-defined unitsCalculated via the CONNECT function every MPU cycleSent to servo processor servo loop every MPU cycleTypically RPOS = APOSFPOS: Feedback PositionSensor feedback position in user-defined unitsRead from servo processor every MPU cyclePE: Position ErrorDifference between RPOS and FPOSUpdated every MPU cycle
7 Important ACSPL+ Motion Variables EFAC: Encoder FactorUsed to translate between encoder counts on the servo processor and user-defined units on the MPUEOFFS: Encoder OffsetOffset between zero position on the servo processor and zero position on the MPUUpdated whenever RPOS or FPOS is SET (homed).FPOS=𝐹𝑃∙EFAC+EOFFS𝑅𝑃= RPOS−EOFFS EFACNote: FP is feedback position stored in the Servo ProcessorRP is the reference position stored in the Servo Processor
8 Important ACSPL+ Motion Variables RVEL: Reference VelocityMotor commanded velocity in user units / secondCalculated as the first difference of RPOS, with optional smoothing, every MPU cycleFVEL: Feedback VelocitySensor feedback velocity in user units / secondCalculated as first difference of FPOS, with optional smoothing, every MPU cycleΔ 𝑅 = RPOS 𝑛 − RPOS 𝑛−1 𝑇RVEL 𝑛 = Δ 𝑅 ∙ 1− RVFIL RVEL 𝑛−1 ∙ RVFIL 100Δ 𝐹 = FPOS 𝑛 − FPOS 𝑛−1 𝑇FVEL 𝑛 = Δ 𝐹 ∙ 1− FVFIL FVEL 𝑛−1 ∙ FVFIL 100
9 Important ACSPL+ Motion Variables RACC: Reference AccelerationMotor commanded acceleration in user units / second2Calculated as the first difference of RVEL every MPU cycleFACC: Feedback AccelerationSensor feedback acceleration in user units / second2Calculated as the first difference of FVEL every MPU cycleRACC 𝑛 = RVEL 𝑛 − RVEL 𝑛−1 𝑇FACC 𝑛 = FVEL 𝑛 − FVEL 𝑛−1 𝑇
10 Important ACSPL+ Motion Variables GPHASE: Group Motion PhaseInteger value for current motion phase0: no motion1: acceleration buildup2: constant acceleration3: acceleration finishing4: constant velocity5: deceleration buildup6: constant deceleration7: deceleration finishingGRTIME: Group Remaining Motion TimeEstimated value of time (in milliseconds) until end of current motion
11 Important ACSPL+ Motion Variables MST: Motor StateBitwise encoded physical motor state informationBit 0: EnabledBit 1: Open LoopBit 5: In motionBit 6: AcceleratingAST: Axis StateBitwise encoded logical axis state informationBit 2: PEG is in progressBit 3: Data collection is in progress
12 Move vs. Move and SettleMove time: time it takes for commanded motion to finish Move and settle time: time it takes for commanded motion to finish AND physical axis to settle within a specified window
19 1st Order Profile: ACSPL+ Example Should not be run on real systems!
20 2nd Order Profile: Basics Quadratic position profileLinear velocity profileInstantaneous change in accelerationInfinite jerkComments:Not realisticSimple controllers use this type of interpolationResults in ‘jerky’ behavior of motion systems
29 CAM Motion: Basics CAM Motion: Multi-axis motion along a continuous path 2 or 3 dimensional spaceCan involved more than 3 axesCommon in CAD/CAM applications where motion profile is a tool path created from a CAD fileTypically composed of arc and line segments
30 CAM Motion: Equations Line Segment: Arc Segment: Constant linear velocity along an n-dimensional pathRequires knowledge of start point, end point, and velocity𝒙 = 𝒗 ∙𝒕Arc Segment:Constant angular velocity along circumference of a circleConfined to 2D planeRequires knowledge of start point, center point or end point (or equivalent)𝒙=𝒓∙ 𝐜𝐨𝐬 𝝎∙𝒕+𝝋 𝒚=𝒓∙ 𝐬𝐢𝐧 𝝎∙𝒕+𝝋
32 Master / Slave: Basics Master / Slave Motion: Axis is slaved to a master signalMaster signal could be an encoder, virtual axis, analog input, etcSlave is moved to track the masters position (position lock) or velocity (velocity lock) as best as possible without exceeding its maximum velocity or accelerationThere will always be a delay between the master and slaveCommon in applications where the master signal has unknown dynamics or controlled externally
34 Spline: Basics Spline: Catmull-Rom: B-Spline: Smooth piece-wise polynomial functionUsed for interpolating in between data points to any degree of interpolationDifferent types of splines have different propertiesCatmull-Rom:Guarantees motion through control pointsGuarantees continuous position and velocity profiles (does not guarantee continuous acceleration profile)B-Spline:Does not guarantee motion through control pointsGuarantees continuous position, velocity and acceleration profiles
35 Spline: PVT Motion PVT Motion: User provides position, velocity, and time pointsMotion generator interpolates between time points to determine position at each controller cycleAcceleration is implicitly defined by the PVT points
37 Kinematics: Basics Kinematics: Forward Kinematics: Inverse Kinematics: Relationship between actuators positions and end-effector positionsCommon with multi-axis applications where end-effector motion is dependent on multiple actuatorsForward Kinematics:Determining end-effector position as a function of actuator positionsInverse Kinematics:Determining actuator positions as a function of end-effector position
38 Kinematics: Inverse Kinematics Example For the flexible gantry table below, determine the actuator positions as a function of the end-effector X-q position. 𝑋 1 =𝑋+ 𝐿∙ tan 𝜃 2 𝑋 2 =𝑋− 𝐿∙ tan 𝜃 2
40 ACSPL+ Programming Example: 1 Load program “Programming 06 – SetMotionParams.prg” to the controllerShould populate buffer 19Open communication terminal and set it up to show DISP messagesFrom the communication terminal start buffer 19 at label ‘Begin’ (“START 19, BEGIN”). Follow the instructions on the screenWhat happens?
41 ACSPL+ Programming Example: 2 An application requires an axis to have two modes: slow and fast. The customer wants to use a digital input (IN(0).0) to toggle between the two modes (if ‘0’, set for slow mode, if ‘1’, set for fast mode). They will use a second digital input (IN(0).1) to toggle motion.Use buffer 20 to write the program. Once running program should not stop (hint: WHILE 1 loop).Anytime IN(0).0 is toggled the motion parameters should switch between a slow and fast mode (determine your own slow and fast parameters)Anytime IN(0).1 goes from low to high a new motion should be started. Use the motion command “PTP/r (axis), distance” for the motion.Run the program and test.