Elumatec SBZ 130/01 retrofit

More
19 Jan 2017 15:21 #86154 by tommylight
loadrt [KINS]KINEMATICS
#autoconverted trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_pci config="ssi_chan_1=xencoder%12e num_encoders=6 num_pwmgens=0 num_stepgens=0 sserial_port_0=000xxx sserial_port_0=00010000 sserial_port_1=00200000"
setp hm2_5i25.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.y,pid.z,pid.a,pid.s




setp hm2_5i25.0.dpll.01.timer-us -200
##X-axis
setp hm2_5i25.0.ssi.01.frequency-khz 200
setp hm2_5i25.0.ssi.01.timer-number 1
setp hm2_5i25.0.ssi.01.xencoder.scale 4096
#setp hm2_5i25.0.ssi.01.xencoder.index-enable 1
#setp hm2_5i25.0.ssi.01.xencoder.counts-per-rev 4096


addf hm2_5i25.0.read servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf pid.x.do-pid-calcs servo-thread
addf pid.y.do-pid-calcs servo-thread
addf pid.z.do-pid-calcs servo-thread
addf pid.a.do-pid-calcs servo-thread
addf pid.s.do-pid-calcs servo-thread
addf hm2_5i25.0.write servo-thread

This is what i have in the hal file, still no joy. At a certain angle of the spindle i get no reading ( 1/4 turn of the spindle ), the other 3/4 turn it just keeps counting up by itself, while the spindle is stationary.
And this is feedback for the X axis


#*******************
# AXIS X
#*******************

setp pid.x.Pgain [JOINT_0]P
setp pid.x.Igain [JOINT_0]I
setp pid.x.Dgain [JOINT_0]D
setp pid.x.bias [JOINT_0]BIAS
setp pid.x.FF0 [JOINT_0]FF0
setp pid.x.FF1 [JOINT_0]FF1
setp pid.x.FF2 [JOINT_0]FF2
setp pid.x.deadband [JOINT_0]DEADBAND
setp pid.x.maxoutput [JOINT_0]MAX_OUTPUT
setp pid.x.error-previous-target true
setp pid.x.maxerror .0005

net x-index-enable <=> pid.x.index-enable
net x-enable => pid.x.enable
net x-pos-cmd => pid.x.command
net x-vel-cmd => pid.x.command-deriv
net x-pos-fb => pid.x.feedback
net x-output => pid.x.output

# ---PWM Generator signals/setup---

setp hm2_5i25.0.7i77.0.1.analogout0-scalemax [JOINT_0]OUTPUT_SCALE
setp hm2_5i25.0.7i77.0.1.analogout0-minlim [JOINT_0]OUTPUT_MIN_LIMIT
setp hm2_5i25.0.7i77.0.1.analogout0-maxlim [JOINT_0]OUTPUT_MAX_LIMIT

net x-output => hm2_5i25.0.7i77.0.1.analogout0
net x-pos-cmd joint.0.motor-pos-cmd
net x-enable joint.0.amp-enable-out
# enable _all_ sserial pwmgens
net x-enable hm2_5i25.0.7i77.0.1.analogena

# ---Encoder feedback signals/setup---

# setp hm2_5i25.0.encoder.00.counter-mode 0
# setp hm2_5i25.0.encoder.00.filter 1
# setp hm2_5i25.0.encoder.00.index-invert 0
# setp hm2_5i25.0.encoder.00.index-mask 0
# setp hm2_5i25.0.encoder.00.index-mask-invert 0
# setp hm2_5i25.0.encoder.00.scale [JOINT_0]ENCODER_SCALE

# net x-pos-fb <= hm2_5i25.0.encoder.00.position
# net x-vel-fb <= hm2_5i25.0.encoder.00.velocity
# net x-pos-fb => joint.0.motor-pos-fb
# net x-index-enable joint.0.index-enable <=> hm2_5i25.0.encoder.00.index-enable
# net x-pos-rawcounts <= hm2_5i25.0.encoder.00.rawcounts

# ---Encoder feedback signals/setup---added for SSI
net x-pos-fb <= hm2_5i25.0.ssi.01.xencoder.position
net x-pos-fb => joint.0.motor-pos-fb
net x-pos-rawcounts <= hm2_5i25.0.ssi.01.xencoder.rawcounts

Regards,
Tom

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

More
19 Jan 2017 15:37 - 19 Jan 2017 15:39 #86158 by PCW
Replied by PCW on topic Elumatec SBZ 130/01 retrofit
Did you try reversing both the clock and the data?
Did you try binary instead of gray code?

If nothing works you may need a oscilloscope to figure out whats going on


And this is feedback for the X axis


Not sure what you mean by this I thought you said the spindle encoder was 1 turn/4096 counts (so 12 bits is correct)
but the x axis is 4096 counts/turn and 4096 turns so 24 bits should be correct (you cant use the same ssi setup for both, each ssi channel needs to be setup to match the encoder)
Last edit: 19 Jan 2017 15:39 by PCW.

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

More
19 Jan 2017 15:46 #86159 by tommylight
Yes i did try reversing the wires:
revering clock>stops reading anything
reversing data>still works but on the scope i do not get clear pulses

I have the spindle encoder wired to X axis as i can not move the other motors/encoders by hand.
Thanks for the prompt reply.

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

More
19 Jan 2017 17:10 #86171 by tommylight
Oh well, just checked the encoder wiring and found some wonky wires there, so i will have to start from the beginning.
Will take the Tektronix scope also to check what is going on.
After checking the wiring, got some more sensible readings, but i had to finish for the day, so more to come..............and go !!! :) :) :)
Will have to dismantle one of the axis motors to check them also, i do not want to enable the drives as they might take flight, and they have brakes so i would have to configure that too.
Now, regarding brakes, i could not find an example of that is to be handled in hal, but i assume ( no jokes about assumptions, please ) using enable for each axis would do the trick, but that would release all the breaks as soon as enabled, so how do i go about engaging the brake only for the axis that has to actually move? More research is in order, as usual.
Stay tuned.........

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

More
20 Jan 2017 13:16 #86242 by tommylight
SUCCESS !!!
After fixing the wiring it counts up and down as it should.
Thank you all very much, going to feel happy for about 5 minutes and move on to wiring the rest.
Now on to figure out the 5th encoder that uses another wire labelled "direction" or "richtung" in German.

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

More
20 Jan 2017 13:27 #86243 by andypugh
As far as I can tell, that wire is just to switch the count direction of the encoder. It just needs to be connected to either GND or 5V

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

More
20 Jan 2017 13:43 #86246 by tommylight
I read somewhere that some need that to be sent from controller to encoder, but will check on that in a bit.
Either way i do not consider that a problem, it can be done in hal, even if the encoder sends that signal back it can be done in hal.
The problem i have now is i have 5 of these encoders and only 4 SSI inputs on the 7i74. That leaves 2 options:
1. PCW can do another magic and do a firmware for 5 or 6 SSI ( just a thought, i do not want to bother him again, he and some other member here deserves a truck load of beer if and when i get to US)
2. Change the encoder on the spindle or Z axis as i have access to them without dismantling the machine, i got my eye on the spindle, already have plenty of incremental encoders.
Anyway, thank you all, much appreciated.

P.S.
Andy i know you're in England, somewhere...... alas they did not grant me entry even though i had a business schengen visa.

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

More
22 Jan 2017 15:58 #86411 by tommylight
Took the day off today, having a coffe watching a movie thinking about the machine. I wish i had a switch for that, i keep thinking about the job 24 hours a day.
Well i got to test almost everything and all looks good so far so will wire the rest in the next days while testing each connection and function and adding the functions in hal.
Will have to add a bunch of small relays as the brakes draw 0.68A and the 7i71 can deliver 0.3A per output, no big deal at all just more wires. That would take care of the field power having 28.6V and 7i71 has 5 to 28V outputs and i do not like pushing electronics to it's limits, much safer this way.
Inputs on 7i70 can handle 32V so all is good there.
Not changing the encoder on the spindle as PCW generously offered to make a config for 6 SSI and 2 SSerial, very much apreciated and very happy for the extreemly good support.
Still have not test anything about the double X axis, i got some advice from forum members and as usual it is very much apreciated. One of the ideas was to have a sum of X and U used as X, but if i remember correctly U does not comply to velocity on G0 and G1 same as X or Y or Z moves, and that is no good so i will have to actually test that and see how it works out later on.
Also will have to figure out the toolchanger, so far i only found out it has something ( sensors, most probably) for tool 1,2,4,8 .
More fun, for sure.
Thank you all for everything.
P.S.
Took pictures of the wiring just in case anyone needs them.

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

More
22 Jan 2017 19:44 #86415 by PCW

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

More
22 Jan 2017 20:07 #86418 by tommylight
PCW, is it monday already???
Thank you very much.

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

Moderators: cncbasher
Time to create page: 0.107 seconds
Powered by Kunena Forum