23
Open Source Mo,on Control Based on the Etherlab open source EtherCAT master (www.etherlab.org) Anders Sandström Torsten Bögershausen ESS Mo,on Control and Automa,on Group www.europeanspalla,onsource.se

Open Source Mo,on Control

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

OpenSourceMo,onControl BasedontheEtherlabopensourceEtherCATmaster(www.etherlab.org)

AndersSandströmTorstenBögershausen

ESSMo,onControlandAutoma,onGroup

www.europeanspalla,onsource.se

Outline

•  EtherCATfieldbus•  Architecture

•  AxisObject •  TrajectoryObject •  MonitoringObject •  BasicKinema,cs•  Opportuni,es/Challenges•  Summary

•  Acknowledgments 2

EtherCATFieldbus

• EtherCAT=EthernetforControlAutoma,onTechnology • OpenfieldbusstandardoriginallydevelopedbyBeckhoffGmbH • MaintainedbyEtherCATTechnologyGroup(www.EtherCAT.org). • Hardwarerequirements:

– Master:standardcomputerhardware(NIC) – Slaves:dedicatedhardware,EtherCATSlaveController(ESC)

• Masters:Severalcommercialandopensourcemastersavailable • Slaves:Several100manufacturersofslaves(drives,I/O,sensors,robots) • Topologies:Line,Star,Ring • Media:Cat5cable,plas,cfiber,glassfiber • SupportsDistributedClock(DC)inslaves • Bandwidthu,liza,on:80%-97%(100Mbit/s,Ethernet,Full-Duplex) • Applica,ons:MoBon,largeorlongdistancesystems,synchronizedsystems • Cycle,mes>50μs

LinuxController(Centos)

4

Architecture

ChannelAccess

HMI(CSS,BOY)

EPICSIOC

EtherCATTerminals

EtherCATTerminals

EtherCATDrive

EtherCAT IghopensourceEtherCATmaster (www.etherlab.org)

Model3driver,Asyn

Driv

e A

nalo

g D

igita

l X

XX

X

Driv

e A

nalo

g D

igita

l X

XX

X

MoBonControl

(ECMC)

Mo,onController

5

Controller(Linux)

Mo,onController(ECMC)

Communica)onThread

Mo)onThread(1kHz) Axis1

AxisN

Commandparser

EpicsIOC

Model3driver,ASYN

EtherCATmaster(IghopensourceEtherCATmasterwwwetherlab.org)

Master0

MasterN

EtherCAT

EtherCAT

Mo,onThread

Mo,onThread(1kHz)

Axis2

Encoder

Trajectory

PID-Control

Monitor

Drive

Axis3

Encoder

Trajectory

PID-Control

Monitor

Drive

AxisN

Encoder

Trajectory

PID-Control

Monitor

Drive

Axis1

Encoder

Trajectory

PID-Control

Monitor

Drive

Structure:Axisobject

7

Encoder

PID-Control

Monitor

Drive

Axis

ECPdoEntry ECPdoEntry

ECPdoEntry

ECPdoEntry ECPdoEntry

ECPdoEntry

ECPdoEntry ECPdoEntry

ECPdoEntry

ECmaster

ECmaster

ECmaster

•  Executesandlinksobjects: •  Encoder •  TrajectoryGenera,on •  PID-Controller •  Monitor •  Drive

•  Sequences •  Homing(differenttypes)

EncoderY

TrajectoryZ Op,onallink:

Sync.External Op,onallink: Sync.Trajectory

“Cfg.CreateAxis(…)” Types:Normal,Virtual,Trajectory,Encoder Transform/

Expression

Transform/Expression

Trajectory

Trajectoryobject

•  Trapezoidaltrajectories•  FeedForward(posi,onandvelocityset-point)•  MotorRecordSupport

•  Constantvelocity•  Rela,veposi,oning•  Absoluteposi,oning•  Homing•  Hardandsoilimits

•  Synchroniza,on/Kinema,cs•  Absolute/Rela,ve•  Gear•  Expressions

•  Otheraxisencoder•  Otheraxistrajectoryset-point

Trajectoryx

Axisx

EncoderY

TrajectoryZ Op,onallink:

Sync.External Op,onallink: Sync.Trajectory

Transform/Expression

Transform/Expression

Monitorobject

•  Posi,onlagmonitoring •  “AtTarget”Monitoring

•  Limitswitches

•  OverSpeedMonitoring

Monitor

Axis

ECPdoEntry ECPdoEntry

ECPdoEntry

Kinema,cs

•  Synchroniza,onofaxesbyexpressions(exprTK*) •  Set-points •  Actualvalues •  Amplifierenable •  Interlocks(stopatproblem)

•  Updateofexpressionatrun,mepossible•  Expressionsevaluatedin1kHz(synchroniza,on)

trajx = Trajectorygeneratedsetpointforaxisx encx = Actualposi,onofaxisx enx = Enableofaxisx ilx = Interlockofaxisx

Example: traj1:=10*sin(traj2+enc3); il1:=il2andil5andenc4>enc3; 10 *hpp://www.partow.net/programming/exprtk/)

Kinema,csExample:2axesslitset

•  2virtualaxes

•  Slitcenterposi,on•  Slitgap

•  2normalaxes(bladeposi,ons)

Blade Axis3

Blade Axis4

Axis4(Normal:Bladeposi,on) Axis3(Normal:Bladeposi,on)

Axis1(Virt:Centerposi,on) Axis2(Virt:Gap)

ForwardKinemaBcs: traj3:=traj1-traj2/2; traj4:=traj1+traj2/2; InverseKinemaBcs: enc1:=(enc3+enc4)/2; enc2:=(enc4-enc3);Amplifierenable:En3:=En1orEn2;En4:=En1orEn2;

Kinema,csExample:2Axesslitset

Axis 4

Axis 1 (Centre)

Axis 2 (Gap)

Axis 3

Configura,on/howtouse

The motion system is precompiled as an EEE-module (ESS Epics Environment module) and only needs configuration. Configuration directly in EPCIS startupfile (“st.cmd”): ecmcConfigController ”asynport” “command” Example 1: Create Axis object: ecmcConfigController ”asynport” ”Cfg.CreateDefaultAxis(1)” Example 2: Set position controller gain for axis 1 to 0.1 ecmcConfigController ”asynport” ”Cfg.SetAxisCntrlKp(1,0.1)”

13

Challenges

1.Epicsanddrivers:•  None(maybesomestrangebehaviorofmotorrecord)•  In-houseexper,seavailable2.EtherlabEtherCATmaster:•  Func,onality:

•  DC-clocksynchroniza,onissues•  Solu,on:Patchesexist

•  Hardwarecompa,bility:•  Failtocommunicatewithaslave(EL7211)•  Solu,on:Compile,meop,on

•  Goodsupportforum/mailinglist•  Wideusercommunity3.ExprTK:•  Noissues.

14

Open/Proprietysource:Pros/Cons

15

Pros Cons

Flexibility Need for development

No Licenses Ownership

Avoids Vendor Lock-In

Certifications/Safety

Fast Bug Fixes

No bug fixes (risk)

Free Support

Support availability

Pros Cons

Support Licenses

Stability Stability

Certifications/Safety

Software Opacity

Compliance to standards

Dependency/Vendor lock in

Education Slow bug fixes

Open Source Propriety Source

Summary

•  Anopensourcemo,oncontrolframeworkforusewith

EPICSbasedonopensourceEtherCATmaster(www.etherlab.org)andExprTKexpressionparserhavebeensuccessfullydeveloped.

•  Manyopportuni,eswithopensourcemo,oncontrolhoweveralsosomechallenges.

16

Acknowledgments

•  IghopensourceEtherCATmaster(www.etherlab.org) •  EPICScommunity(base,motor,asyn,streamdevice) •  ExprTKC++Mathema,calExpressionLibrary

(www.partow.net/programming/exprtk) Ques,ons?

17

Encoderobject

• Actualposi,onvaluelinkstoanyinputprocessvalueinEtherCATprocessimage. • Scaling • 1-64bit • Handlesover/underflow(1-63bit) • Calculatesvelocity • Filter

Encoder

Axis

ECmaster

ECPdoEntry ECPdoEntry

ECPdoEntry

Controllerobject

• PIDcontroller • Feedforwardfunc,onality • Setpointfromtrajectoryobject • Actualvaluefromencoderobject

Controller

Axis

Driveobject

• LinkVelocitySetpointtoEtherCATprocessimage • LinkEnabletoEtherCATprocessimage • Scaling • 1-64bit

Drive

Axis

ECPdoEntry ECPdoEntry

ECPdoEntry

ExampleApplica,on

EPICS(ChannelAccess)

HMI(CSS,BOY)

EPICSIOC MoBonControl

(Linux)

Drive

Analog

Digital

EtherCAT X

XXX

Drive

Analog

Digital

EtherCAT X

XXX

EtherCATDrive

EtherCAT

Slitblades

EtherCATMo,on:ControlModes

Act.posi)on Velocitysetp.

Velocitymode

Control: • Velo. • Torque

Controller

Control: -Pos.

EtherCATHardwareConfigura,onTree

ECSlave0

ECMaster

ECPdoEntry ECPdoEntry

EC

PdoEntry

ECSM0

ECSM1

ECPDO0

ECPDO1

ECPDO0

ECPDO1

ECPdoEntry ECPdoEntry

EC

PdoEntry

ECPdoEntry ECPdoEntry

EC

PdoEntry

ECPdoEntry ECPdoEntry

EC

PdoEntry

ECSlaveN

ECPdoEntry ECPdoEntry

EC

PdoEntry

ECSMX

ECPDOY

ECPDOZ

ECPdoEntry ECPdoEntry

EC

PdoEntry

ECSlave…

“Cfg.EcAddSlave(…)”

“Cfg.EcAddSyncManager(…)”

“Cfg.EcAddPdo(…)”

“Cfg.EcAddPdoEntry(…)”