Changing Servo Axis Direction

More
10 years 5 months ago #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:
Code:
#******************** # 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 to join the conversation.

More
10 years 5 months ago #74907 by Todd Zuercher
Change
ENCODER_SCALE = 101981
OUTPUT_SCALE = 10.0

to
ENCODER_SCALE = -101981
OUTPUT_SCALE = -10.0

Please Log in to join the conversation.

More
10 years 5 months ago #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 to join the conversation.

More
10 years 5 months ago #74911 by Sparky961

Todd Zuercher wrote: 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 to join the conversation.

More
10 years 5 months ago #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)?
Code:
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 to join the conversation.

More
10 years 5 months ago #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 to join the conversation.

More
10 years 5 months ago #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

Please Log in to join the conversation.

More
10 years 5 months ago #75011 by andypugh

samammar wrote: 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.

Please Log in to join the conversation.

Time to create page: 0.096 seconds
Powered by Kunena Forum