Changing Servo Axis Direction

More
21 May 2016 03:22 #74902 by Sparky961
Can someone tell be which parameters need to be inverted to change the direction of a linear servo axis?

I've found a few answers already but so far only for stepper systems. I've tried negating ENCODER_SCALE for the heck of it, but as expected this causes a runaway condition. At this point I'm just trying random combinations of negation and it isn't getting me very far.

I imagine I'll have to change the limit/home switches in the HAL file too, eh?

Thanks!

Here's the section from my INI file for the axis in question:
#********************
# Axis Y
#********************
[AXIS_1]

# GEAR RATIO: 1:3
# SCREW PITCH: 3MM
# MAX VELOCITY: 54 IPM (0.9 IPS)

BACKLASH = 0.022
TYPE = LINEAR
FERROR = 0.075
MIN_FERROR = 0.005
MAX_VELOCITY = 0.9
MAX_ACCELERATION = 4

VEL_P =             10
VEL_I =             0
VEL_D =             0
VEL_FF0 =           0
VEL_FF1 =           0
VEL_FF2 =           0
VEL_MAX_OUTPUT =    10
POS_P=              200
POS_I =             50
POS_D =             0
POS_BIAS =          0
POS_FF0 =           0
POS_FF1 =           0
POS_FF2 =           0
POS_DEADBAND=       0.00001
POS_MAX_OUTPUT =    1

ENCODER_SCALE = 101981
OUTPUT_SCALE = 10.0
OUTPUT_MIN_LIMIT = -10.0
OUTPUT_MAX_LIMIT = 10.0

MIN_LIMIT = -0.0500
MAX_LIMIT = 6.1250
HOME = 3.0000
HOME_OFFSET = -0.1000
HOME_SEARCH_VEL = -0.75
HOME_LATCH_VEL = 0.05
HOME_FINAL_VEL = 0.75
HOME_SEQUENCE = 0
HOME_USE_INDEX = YES
HOME_IGNORE_LIMITS = YES

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

More
21 May 2016 12:05 - 21 May 2016 12:06 #74907 by Todd Zuercher
Change
ENCODER_SCALE = 101981
OUTPUT_SCALE = 10.0

to
ENCODER_SCALE = -101981
OUTPUT_SCALE = -10.0
Last edit: 21 May 2016 12:06 by Todd Zuercher.
The following user(s) said Thank You: Sparky961

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

More
21 May 2016 12:25 #74908 by Todd Zuercher
Alternatively you can revers an axis be swapping a couple of wires around at your interface card to Linuxcnc. For example If you are using a Mesa 7i77 you could reverse the wires on one of the encoder to revers that (QB0 with /QB0) and then change the analog polarity. Also I'm pretty sure most servo drives for linear motors would have configuration settings to allow reversal of direction without making any wiring or controller settings.

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

More
21 May 2016 14:37 #74911 by Sparky961

Change
ENCODER_SCALE = 101981
OUTPUT_SCALE = 10.0

to
ENCODER_SCALE = -101981
OUTPUT_SCALE = -10.0


Worked perfectly, thanks. I had tried inverting both as you suggest but also figured (incorrectly) that the OUTPUT_MIN_LIMIT and OUTPUT_MAX_LIMIT also needed swapped.

To whom it concerns: It would be helpful to add a sentence or two in the man page on these parameters regarding changing axis travel direction.

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

More
23 May 2016 17:56 #74999 by samammar
I have inherited a machine running LinuxCNC version 2.3.1 and I'm seeing the same issue, both the X and Y are reversed. I looked in the config file (i'm assuming it's the one named motenc.ini) but I don't see the same settings- probably due to the old version we're running. Here's the AXIS1 section of the ini file. I need to try and resolve this without the ability to A) rewire anything and b) upgrade to the current release. I'm guessing that the "input scale" should be a positive number. Would it be safe to assume this and just change it for both axis 0 (x) and axis 2 (y)?
TYPE =                  LINEAR
HOME =                  0.000
MAX_VELOCITY =          2.0
MAX_ACCELERATION =      4.0
BACKLASH =              0.000
INPUT_SCALE =           -20000
OUTPUT_SCALE =          10
OUTPUT_OFFSET =         0
MIN_LIMIT =             -0.25
MAX_LIMIT =             17.5
FERROR =                1.0
MIN_FERROR =            0.05  // was 0.005
HOME_OFFSET =           0.00
HOME_SEARCH_VEL =       -1.00
HOME_LATCH_VEL =        0.01
HOME_USE_INDEX =        NO
HOME_IGNORE_LIMITS =    NO
MAX_OUTPUT =            1
# PID tuning params
DEADBAND =              0.000015
P =                     80
I =                     80
D =                     1
FF0 =                   0
FF1 =                   0
BIAS =                  0

thanks
SKA

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

More
23 May 2016 21:05 #75007 by andypugh
If it is a servo config then you need to change both the encoder scale and the output scale.

But before you do that, are you absolutely sure that it is wrong? A moving-workpiece config might look wrong at first.

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

More
23 May 2016 21:16 - 23 May 2016 21:51 #75009 by samammar
I have confirmed that it is a servomotor system. The whole thing works fine but I'm used to seeing X increase as the spindle moves right and the Y increase as the spindle moves away from me (back towards the machine). Currently, it does the opposite.

So, according to your reply, I would need to change from:
INPUT_SCALE = -20000
OUTPUT_SCALE = 10
to
INPUT_SCALE = 20000
OUTPUT_SCALE = -10

am I correct? I do not see the setting for "encoder scale" in my file (see the code in my first post)

Regards-
Sam
Last edit: 23 May 2016 21:51 by samammar.

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

More
23 May 2016 21:49 - 23 May 2016 21:50 #75011 by andypugh

I'm used to seeing X increase as the spindle moves right and the Y increase as the spindle moves away from me (back towards the machine).

Yes, that's normal. If it is the other way on both axes it will at leasy not make mirrored parts, but might be confusing.

INPUT_SCALE = 20000
OUTPUT_SCALE = -10


Yes, but start at mid-travel and keep your hand near the e-stop.
Last edit: 23 May 2016 21:50 by andypugh.
The following user(s) said Thank You: samammar

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

Time to create page: 0.078 seconds
Powered by Kunena Forum