Orient component revised

More
16 Apr 2020 22:53 #164209 by giz
Replied by giz on topic Orient component
I'm in the process of upgrading to 2.9 and implementing Probe Basic - once I have that going then I can experiment with the code!

But unfortunately it will probably be some weeks out. Happy to help how I can though

Please Log in or Create an account to join the conversation.

More
15 Oct 2020 09:10 #186171 by Serg452
Replied by Serg452 on topic Orient component revised
Hello
Please give the working hal file and ini pid section ORIENT

Please Log in or Create an account to join the conversation.

More
21 Oct 2020 21:08 #186840 by alkabal
Replied by alkabal on topic Orient component revised
Hi

I think all is already here but i have attached my ini hal comp and pyvcp for reference;

Some parts of the oreint process are not really finished and need review, any help are really welcome.
Attachments:

Please Log in or Create an account to join the conversation.

More
25 Nov 2020 01:10 - 25 Nov 2020 23:09 #190236 by alkabal
Replied by alkabal on topic Orient component revised
New version that allow to use different spindle control type like :

-Analog with +-10v for speed and direction management like kbmg-212D
-Analog with 0/10v for speed and relay for swapp motor wire
-Analog with 0/10v for speed and one or two input for direction selection like Omron MX2
I think this can work with PWM spindle control

Please help is needed for do something better :
-Some issue with jog mode need/can be enhanced
-I'm sure the whole positionnement method can be better with more knowledge


Imo my attempt is mostly interesting for the safe and easy integration in existing config. (positonement is accurate)

Edit : updated revision with two relay management like Serg452 setup with Omron MX2
Attachments:
Last edit: 25 Nov 2020 23:09 by alkabal.

Please Log in or Create an account to join the conversation.

More
25 Nov 2020 01:13 - 25 Nov 2020 22:54 #190237 by alkabal
Replied by alkabal on topic Orient component revised
Add this to your ini and edit with your own value
#******************************************
# Orient Spindle
[ORIENT]
# PID, input is degree
P = 0.5
I = 10
D = 0.0
FF0 = 1
FF1 = 0.0
FF2 = 0.0
BIAS = 0
DEADBAND = 0
MAX_ERROR = 0.0
MAX_ERROR_I = 0.0
MAX_OUTPUT = 80
#MAX_OUTPUT = 80 can be increased to [SPINDLE_0]MAX_OUTPUT

ENCODER_GAIN = 360
VEL_SPEED = 12
AT_ANGLE_TOL = 2
SPEED_MAX_DIRCHANGE = 100
# Orient need really slow and accurate spindle
#******************************************
Last edit: 25 Nov 2020 22:54 by alkabal.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
25 Nov 2020 01:18 - 27 Nov 2020 02:15 #190238 by alkabal
Replied by alkabal on topic Orient component revised
Comment out something like this in your hal :

#net spindle-enable => [HMOT](CARD0).7i76.0.0.spinena
#netspindle-ccw-management => [HMOT](CARD0).7i76.0.0.output-xx
#net spindle-cw-management => [HMOT](CARD0).7i76.0.0.output-xx
#net spindle-vel-cmd-out => [HMOT](CARD0).7i76.0.0.spinout

So you need to remove all link needed to manage spindle to card for linking this signal to component input, and report the output to component out muxed (you can see the relation on the exemple hal in next post)


You also need to have a encoder output as RPM ABSOLUTE or RELATIVE depending on your setup :

RELATIVE only for controller using +-10v for direction with positive/negative PID
ABSOLUE IF USE WITH RELAY FOR DIRECTION or if DRIVE NEED INPUT = PID always positive
Last edit: 27 Nov 2020 02:15 by alkabal.

Please Log in or Create an account to join the conversation.

More
25 Nov 2020 01:27 - 27 Nov 2020 01:53 #190239 by alkabal
Replied by alkabal on topic Orient component revised
Add this to your hal and edit some link name to match your config : (in red)

#####################################################################
# Spindle orient mode
#####################################################################
loadrt orientv2 names=orient.orient-spindle
loadrt pid names=pid.orient-spindle

addf orient.orient-spindle servo-thread
addf pid.orient-spindle.do-pid-calcs servo-thread

# setup Orient Spindle PID
setp pid.orient-spindle.Pgain [ORIENT]P
setp pid.orient-spindle.Igain [ORIENT]I
setp pid.orient-spindle.Dgain [ORIENT]D
setp pid.orient-spindle.FF0 [ORIENT]FF0
setp pid.orient-spindle.FF1 [ORIENT]FF1
setp pid.orient-spindle.FF2 [ORIENT]FF2
setp pid.orient-spindle.bias [ORIENT]BIAS
setp pid.orient-spindle.deadband [ORIENT]DEADBAND
setp pid.orient-spindle.maxerror [ORIENT]MAX_ERROR
setp pid.orient-spindle.maxerrorI [ORIENT]MAX_ERROR_I
setp pid.orient-spindle.maxoutput [ORIENT]MAX_OUTPUT

# Set the spindle Orient speed and the angular accepted tolerance
setp orient.orient-spindle.vel-speed [ORIENT]VEL_SPEED
setp orient.orient-spindle.tolerance [ORIENT]AT_ANGLE_TOL
setp orient.orient-spindle.vel-max-for-direna [ORIENT]SPEED_MAX_DIRCHANGE

# encoder full rev connections feedback + orient feedback cmd and position
net spindle-pos => orient.orient-spindle.position # from encoder.00.position to spindle.0.revs to orient 1 per rev
net spindle-pos-deg <= orient.orient-spindle.angle-scaled-out # USED FOR VCP DISPLAY allways 0 to 360 to 0
net spindle-pos-cmd <= orient.orient-spindle.angle-asked-out # USED FOR VCP DISPLAY muxed from spindle.0.orient-angle and orient.orient-spindle.counts-from-jog

# Index connection
net spindle-index-enable <=> orient.orient-spindle.index-enable
net spindle-index-enable => pid.orient-spindle.index-enable

# Optionnal Spindle homing link for homing spindle with machine homing immediatly after Z homed
net machinehomed <= joint.2.homed
net machinehomed => orient.orient-spindle.machine-is-homed
net machine.is-on => orient.orient-spindle.machine-is-on

# If spindle is not homed report msg to user
net spindle-orient-error <= orient.orient-spindle.error
net spindle-orient-error => spindle.0.orient-fault
net spindle-orient-msg1 <= orient.orient-spindle.mdi-msg-unhomed1
net spindle-orient-msg1 => halui.mdi-command-xx #(MSG, !!! Orient Homing before asked angle, MOVES TWO TIME !!!)
net spindle-orient-msg2 <= orient.orient-spindle.mdi-msg-unhomed2
net spindle-orient-msg2 => halui.mdi-command-xx #(MSG, !!! Orient Spindle Auto Homing !!!)
net spindle-orient-msg3 <= orient.orient-spindle.mdi-msg-unhomed3
net spindle-orient-msg3 => halui.mdi-command-xx #(MSG, !!! Reverse Spindle do forward Auto Homing before run reverse !!!)

# Spindle orient enable control signals
net spindle-orient-enable <= spindle.0.orient
net spindle-orient-enable => orient.orient-spindle.enable

# Pid enable from orient component used for homing spindle from component
net spindle-orient-pid-ena <= orient.orient-spindle.ena-to-pid-orient
net spindle-orient-pid-ena => pid.orient-spindle.enable

# enable out for controler from regular spindle or orient mode
net spindle-enable => orient.orient-spindle.ena-from-velocity # link from spindle setup enable control
net spindle-orient-enable-out <= orient.orient-spindle.ena-out-muxed
net spindle-orient-enable-out => [HMOT](CARD0).7i76.0.0.spinena # moved in the orient input/output but initially in spindle setup

# direction out for controler from regular spindle or orient mode
#comment out unused signal if not use direction management exemple : +-10V drive does not need this or some drive need only one for reverse
net spindle-ccw-management => orient.orient-spindle.spindir-ccw-from-velocity # link from spindle setup direction control
net spindle-ccw-orient-out <= orient.orient-spindle.spindir-ccw-out-muxed
net spindle-ccw-orient-out => [HMOT](CARD0).7i76.0.0.output-xx # moved in the orient input/output but initially in spindle setup
net spindle-cw-management => orient.orient-spindle.spindir-cw-from-velocity # link from spindle setup direction control
net spindle-cw-orient-out <= orient.orient-spindle.spindir-cw-out-muxed
net spindle-cw-orient-out => [HMOT](CARD0).7i76.0.0.output-xx # moved in the orient input/output but initially in spindle setup


# Set asked mode from M19 P0/1/2
net spindle-orient-mode <= spindle.0.orient-mode
net spindle-orient-mode => orient.orient-spindle.mode

# Is oriented near signal + link position asked to component
net spindle-orient-degree-cmd <= spindle.0.orient-angle
net spindle-orient-degree-cmd => orient.orient-spindle.angle
net spindle-is-oriented <= orient.orient-spindle.is-oriented
net spindle-is-oriented => spindle.0.is-oriented

# # Command from component velocity to PID + velocity feedback from encoder to component need change according to your setup Abs or REL
#net spindle-orient-vel <= orient.orient-spindle.cmd-to-pid-orient # RELATIVE only for controler using +-10v for direction with positive/negative PID
net spindle-orient-vel <= orient.orient-spindle.cmd-to-pid-orient-abs # ABSOLUE IF USE WITH RELAY FOR DIRECTION or if DRIVE NEED INPUT = PID allways positive
net spindle-orient-vel => pid.orient-spindle.command
#net spindle-vel-rpm => pid.orient-spindle.feedback # RELATIVE only for controler using +-10v for direction with positive/negative PID
#net spindle-vel-rpm => orient.orient-spindle.vel-feedback # RELATIVE only for controler using +-10v for direction with positive/negative PID
net spindle-vel-rpm-abs => pid.orient-spindle.feedback # ABSOLUE IF USE WITH RELAY FOR DIRECTION or if DRIVE NEED INPUT = PID allways positive
net spindle-vel-rpm-abs => orient.orient-spindle.vel-feedback # ABSOLUE IF USE WITH RELAY FOR DIRECTION or if DRIVE NEED INPUT = PID allways positive

# Input speed velocity from normal mode inside component, the component passthru the spindle velocity to the Card signal generator or send orient velocity
net spindle-orient-pid-in-out <= pid.orient-spindle.output
net spindle-orient-pid-in-out => orient.orient-spindle.cmd-from-pid-orient
net spindle-vel-cmd-out => orient.orient-spindle.cmd-from-pid-velocity # link from spindle setup speed out from pid
net spindle-orient-ctrl-out <= orient.orient-spindle.cmd-out-muxed
net spindle-orient-ctrl-out => [HMOT](CARD0).7i76.0.0.spinout # moved in the orient input/output but initially in spindle setup

# Jog dedicated signal for pendant
net pdnt.axis.c.jog-scale => orient.orient-spindle.counts-scale-jog # whb.axis.c.jog-scale
net pdnt.axis.c.jog-counts => orient.orient-spindle.counts-from-jog # whb.axis.c.jog-counts
net pdnt.axis.c.jog-enable => orient.orient-spindle.enable-from-jog # whb.axis.c.jog-enable
Last edit: 27 Nov 2020 01:53 by alkabal.
The following user(s) said Thank You: Haarie

Please Log in or Create an account to join the conversation.

More
25 Nov 2020 01:36 #190241 by alkabal
Replied by alkabal on topic Orient component revised
Bonus

For tune pid you can add this panel :

edit you ini :

[HAL]
PYVCP = pid-orient-pyvcp.xml

[DISPLAY]
PYVCP = pid-orient-pyvcp.xml
Attachments:
The following user(s) said Thank You: Aciera

Please Log in or Create an account to join the conversation.

More
25 Nov 2020 10:48 #190250 by Serg452
Replied by Serg452 on topic Orient component revised
Thanks, I will test. I use 0/10v for speed and 2 relay output for dir selection

Please Log in or Create an account to join the conversation.

More
25 Nov 2020 12:15 - 25 Nov 2020 12:16 #190254 by alkabal
Replied by alkabal on topic Orient component revised
Please send feadback if you try.

I suspect a possible missing couple of pin for the forward relay because i use only one for reverse direction with my unit. i need to think about that !

For confirmation :
you use 2 different relay for manage the drive with different input for dir selection ?

Can you attach spindle controller datasheet ?

Br
Last edit: 25 Nov 2020 12:16 by alkabal.

Please Log in or Create an account to join the conversation.

Time to create page: 0.220 seconds
Powered by Kunena Forum