Hardinge HC Bandit Retrofit

More
09 Dec 2017 19:49 #102839 by mclausen
The resolvers are belt driven off of the motor.

Here is the section of my Hal file:
Is this trying to drive by position?

net x-index-enable <=> pid.x.index-enable
net x-enable joint.0.amp-enable-out => pid.x.enable
net x-pos-cmd joint.0.motor-pos-cmd => pid.x.command
net x-vel-cmd => pid.x.command-deriv
net x-pos-fb => pid.x.feedback
net x-enable => hm2_5i24.0.pwmgen.00.enable
net x-output pid.x.output => hm2_5i24.0.pwmgen.00.value
setp hm2_5i24.0.pwmgen.00.scale [JOINT_0]OUTPUT_SCALE


# ---Resolver feedback signals/setup---

setp hm2_5i24.0.resolver.excitation-khz 5
setp hm2_5i24.0.resolver.00.scale [JOINT_0]RESOLVER_SCALE
net x-pos-fb hm2_5i24.0.resolver.00.position => joint.0.motor-pos-fb
net x-vel-fb <= hm2_5i24.0.resolver.00.velocity
net x-index-enable joint.0.index-enable <=> hm2_5i24.0.resolver.00.index-enable

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

More
09 Dec 2017 19:54 #102840 by andypugh
I don't see anything setting the PID gains in that HAL snippet.

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

More
09 Dec 2017 19:57 #102841 by mclausen
#*******************
# 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 1

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

More
09 Dec 2017 19:58 - 09 Dec 2017 19:58 #102842 by PCW
Replied by PCW on topic Hardinge HC Bandit Retrofit
Yes that's a position mode loop and looks OK

Crazy behaviour in one direction suggests that the PWM mode is not set correctly
The 7I48 and 7I49 require that the PWM mode be up/down (output_type = 2)
Last edit: 09 Dec 2017 19:58 by PCW.

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

More
09 Dec 2017 19:58 #102843 by mclausen
Andy,

I started with a copy of your Holbrook files and modified them.

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

More
09 Dec 2017 20:01 #102844 by andypugh
I think that PCW has spotted the problem, we have seen this before.

Set the output_type and then start adjusting P, I and D until it works properly.

There is no specific setting for the control mode of the system, but if you know what it is it can give you some ideas what the PID tuning is likely to look like. But you nearly always start with P-gain.

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

More
09 Dec 2017 20:08 - 09 Dec 2017 20:10 #102845 by mclausen
Currently there is no call out for PWM.

Should I just add loadrt pwmgen output_type=2?

Or do I change this line : loadrt hm2_pci config="num_encoders=2 num_pwmgens=2 num_resolvers=2"
Last edit: 09 Dec 2017 20:10 by mclausen.

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

More
09 Dec 2017 20:22 - 09 Dec 2017 20:23 #102846 by PCW
Replied by PCW on topic Hardinge HC Bandit Retrofit
No, you set the mode of the existing hardware pwmgens like this:

setp hm2_5i24.0.pwmgen.00.output-type 2
setp hm2_5i24.0.pwmgen.01.output-type 2

(man hostmot2)

also

halcmd show all

to get a list of all available pins and parameters
Last edit: 09 Dec 2017 20:23 by PCW. Reason: change set to setp

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

More
09 Dec 2017 21:00 #102848 by mclausen
Success! The x axis now moves smooth in both directions. I did have to change the OUTPUT_SCALE to positive. It was negative to match the direction before.
Speaking of OUTPUT_SCALE, what should this be set at?

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

More
09 Dec 2017 21:02 #102849 by andypugh

Speaking of OUTPUT_SCALE, what should this be set at?


Whatever works :-)

Normally you would scale it to 10V but to be honest it can be in any units at all, you just end up with different PID gains to compensate.

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

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