# Orange Pi GPIO header # # ZHom Accel Xhom Stop X+ X- Strt Z+ Z- EndX EndZ Rel4 Rel3 # + + + + # 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 # 5V 5V GND PA13 PA14 PD14 GND PC4 PC7 GND PA2 PC3 PA21 PA18 GND PG8 GND PG9 PG6 PG7 # 3.3V PA12 PA11 PA6 GND PA1 PA0 PA3 3.3V PC0 PC1 PC2 GND PA19 PA7 PA8 PA9 PA10 PA20 GND # 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 # + + + + + + + + + + # XEn XDir XStp ZEn ZDir ZStp SPwr SDir SPwm EncA EncB EncZ HDet Rel1 Rel2. # load RT components loadrt [KINS]KINEMATICS loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS #loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS traj_period_nsec=[EMCMOT]TRAJ_PERIOD loadrt arisc pwm="p,p,p,f" in=PA13,PA14,PD14,PC4,PC7,PA2,PC3,PA21,PA19,PA18,PA7,PA8,PG8,PA9,PG9 out=PA12,PA11,PA6,PA1,PA0,PA3,PC0,PC1,PC2,PA10,PA20,PG6,PG7 encoders=1 loadrt near #loadrt and2 count=3 #loadrt or2 count=4 #loadrt mux2 count=1 # add RT functions to the servo thread addf arisc.gpio.read servo-thread addf arisc.pwm.read servo-thread addf arisc.encoder.read servo-thread addf motion-command-handler servo-thread addf motion-controller servo-thread addf arisc.gpio.write servo-thread addf arisc.pwm.write servo-thread addf near.0 servo-thread #addf and2.0 servo-thread #addf and2.1 servo-thread #addf and2.2 servo-thread #addf or2.0 servo-thread #addf or2.1 servo-thread #addf or2.2 servo-thread #addf or2.3 servo-thread #addf mux2.0 servo-thread #BUTTONS #Accel #setp mux2.0.in0 25 #setp mux2.0.in1 200 #net accel-speed-select opi_gpio.pin-10-in-not => mux2.0.sel #net accel-speed mux2.0.out => halui.jog-speed #Start, Pause and Resume by buttons #net cycle-start opi_gpio.pin-24-in-not => and2.0.in0 and2.1.in0 #net cycle-pause opi_gpio.pin-16-in-not => halui.program.pause #net cycle-idle halui.program.is-idle => and2.0.in1 #net cycle-ist-pause halui.program.is-paused => and2.1.in1 #net start and2.0.out => halui.program.run #net waiter and2.1.out => halui.program.resume #Home-Btns #net home-x opi_gpio.pin-12-in-not => axis.0.home-sw-in halui.joint.0.home #net home-z opi_gpio.pin-08-in-not => axis.1.home-sw-in halui.joint.2.home #End limits #net end-x opi_gpio.pin-32-in => axis.0.pos-lim-sw-in #net end-z opi_gpio.pin-36-in => axis.1.pos-lim-sw-in #X-Plus #net step-x-plus opi_gpio.pin-18-in-not => or2.0.in0 halui.jog.0.plus #net step-x-minus opi_gpio.pin-22-in-not => or2.0.in1 halui.jog.0.minus #net step-x-selected or2.0.out => axis.0.jog-enable #Z-Plus #net step-z-plus opi_gpio.pin-26-in-not => or2.1.in0 halui.jog.1.plus #net step-z-minus opi_gpio.pin-28-in-not => or2.1.in1 halui.jog.1.minus #net step-z-selected or2.1.out => axis.1.jog-enable #E-STOP #net estop-out iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in # axis 0 - X setup # PA6:STEP, PA11:DIR, PA12:EN setp arisc.pwm.0.pos-scale [JOINT_0]SCALE # number of PWM pulses per movement unit. Default is 1 #setp arisc.pwm.0.dc-scale 20 # simple scale multiplier for the desired duty cycle value. Default is 1 setp arisc.pwm.0.dc-cmd 0.5 # 50% setp arisc.pwm.0.dc-max-t 15000 # ns, maximum time (in nanoseconds) of a PWM pulse duration. If value is 0, value is ignored. Default is 0 #setp arisc.pwm.0.dc-offset 0 #arisc.pwm.0.dc-fb #real duty cycle feedback = dc-cmd / dc-scale + dc-offset. Then value will be limited by the dc-min, dc-max and dc-max-t values setp arisc.pwm.0.dir-hold 150000 # ns, minimal pause (in nanoseconds) between last PWM pulse and a DIR signal change. Default is 50000 ns setp arisc.pwm.0.dir-setup 150000 # ns, minimal pause (in nanoseconds) between DIR signal change and next PWM pulse. Default is 50000 ns setp arisc.pwm.0.dir-invert 1 setp arisc.pwm.0.dir-port 0 # PA -XDir setp arisc.pwm.0.dir-pin 11 setp arisc.pwm.0.pwm-port 0 # PA6 - XStep setp arisc.pwm.0.pwm-pin 6 setp arisc.pwm.0.pwm-invert 0 net x-pos-cmd joint.0.motor-pos-cmd arisc.pwm.0.pos-cmd net x-pos-fb joint.0.motor-pos-fb arisc.pwm.0.pos-fb net x-en joint.0.amp-enable-out arisc.pwm.0.enable arisc.gpio.PA12-out-not # axis 1 - Z setup # PA3:STEP, PA0:DIR, PA1:EN setp arisc.pwm.1.pos-scale [JOINT_1]SCALE setp arisc.pwm.1.dc-cmd 0.5 # 50% setp arisc.pwm.1.dc-max-t 15000 #pulse time setp arisc.pwm.1.dir-hold 150000 setp arisc.pwm.1.dir-setup 150000 setp arisc.pwm.1.pwm-port 0 # PA setp arisc.pwm.1.pwm-pin 3 setp arisc.pwm.1.dir-port 0 # PA setp arisc.pwm.1.dir-pin 0 net z-pos-cmd joint.1.motor-pos-cmd arisc.pwm.1.pos-cmd net z-pos-fb joint.1.motor-pos-fb arisc.pwm.1.pos-fb net z-en joint.1.amp-enable-out arisc.pwm.1.enable arisc.gpio.PA1-out-not # spindle setup # PC2:PWM, PC1:DIR, PC0:EN setp arisc.pwm.3.freq-cmd 100.0 # Hz setp arisc.pwm.3.dc-scale 2000.0 # max RPM setp arisc.pwm.3.dc-min 0.08 setp arisc.pwm.3.pwm-port 2 # PC setp arisc.pwm.3.pwm-pin 2 setp arisc.pwm.3.pwm-invert 0 setp arisc.pwm.3.dir-port 2 # PC setp arisc.pwm.3.dir-pin 1 setp arisc.pwm.3.dir-invert 0 net s-rpm spindle.0.speed-out arisc.pwm.3.dc-cmd near.0.in1 net s-en spindle.0.on arisc.pwm.3.enable arisc.gpio.PC0-out arisc.encoder.0.enable net s-at-speed near.0.out => spindle.0.at-speed #will not start processing until reach speed #Encoder # PA19:A, PA7:B, PA8:Z(index) setp arisc.encoder.0.pos-scale 1440 # 360p per phaze, * 2 phaze * 2 front setp arisc.encoder.0.A-port 0 # 0=PA #setp arisc.encoder.0.A-pin 19 # normal, parallel setp arisc.encoder.0.A-pin 7 # in front of spindle setp arisc.encoder.0.B-port 0 # 0=PA #setp arisc.encoder.0.B-pin 7 # normal setp arisc.encoder.0.B-pin 19 # in front of spindle. setp arisc.encoder.0.Z-port 0 # 0=PA setp arisc.encoder.0.Z-pin 8 # net s-position arisc.encoder.0.pos => spindle.0.revs net s-velocity arisc.encoder.0.vel => spindle.0.speed-in near.0.in2 net s-index-enable arisc.encoder.0.index-enable <=> spindle.0.index-enable # other IO setup net estop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in