I can now run EMC2 and it kind of "works"

Right, that means you need to do the servo tuning. See

formatting link
some info. This was written for my PWM servo amps, but almost everything there will be perfect for velocity servos, too.

Jon

Reply to
Jon Elson
Loading thread data ...

Impossible. It is possible in EMC2 to set an acceleration higher than your servo can deliver, but it will accelerate at whatever rate you have specified in the .ini file. It is impossible to command a move without acceleration. Even if you give the MDI command G01 X25 F200000, it will ignore the ridiculous feedrate and move at the specified max velocity, and accelerate and decelerate from max vel at the max_accel rate.

If Iggy's servo tuning has too low a gain, then there will be a greater servo lag as speed increases. The longer you move, the farther the axis lags behind, eventually tripping the following error limit. Increasing the proportional gain in the PID function's P term will reduce the error. Also, the axis' MAX_VEL must be set right so that a commanded velocity will generate nearly the right DAC output without waiting for position feedback.

Jon

Reply to
Jon Elson

One thing is for absolutely certain and that is that there is no issue with operating system latency.

Even without dismissing unnecessary BIOS functions and running the realtime kernel latency test, I can tell from here that the computer returns from the System Management Interrupt in *plenty* of time to keep track of encoder values.

(Yes, I will try anything.)

--Winston

Reply to
Winston

Ignoramus2398 fired this volley in news:pMWdnefHsPu-paPRnZ2dnUVZ snipped-for-privacy@giganews.com:

That's what he just said, Iggy. Even the motor mass is excessive if you have no acceleration time.

LLoyd

Reply to
Lloyd E. Sponenburgh

Well, I do have max_acceleration set.

i
Reply to
Ignoramus2398

Ignoramus2398 fired this volley in news:CfCdnX-G5tOZx6PRnZ2dnUVZ snipped-for-privacy@giganews.com:

The operative question would be, "To what?"

It may be excessive, even for the motors own inertia.

LLoyd

Reply to
Lloyd E. Sponenburgh

Tuned your amps yet?

Now is the time.

Gunner

One could not be a successful Leftwinger without realizing that, in contrast to the popular conception supported by newspapers and mothers of Leftwingers, a goodly number of Leftwingers are not only narrow-minded and dull, but also just stupid. Gunner Asch

Reply to
Gunner Asch

Indeed..as am I

Gunner, OmniTurn CNC field tech

One could not be a successful Leftwinger without realizing that, in contrast to the popular conception supported by newspapers and mothers of Leftwingers, a goodly number of Leftwingers are not only narrow-minded and dull, but also just stupid. Gunner Asch

Reply to
Gunner Asch

O.K. Where does SMI start being used?

One of the major benefits of tach feedback. I'm glad that you went back to it.

With tach feedback, your computer only has to be fast enough to tell it when to change velocity, and is not needed to constantly monitor velocity. Worst case is probably when stepper pulses are being generated directly in the software.

Sounds good.

Out of curiosity -- do you have a good photo of the belt housing for the Y-axis servo? I'm going to have to make something like it to complete my conversion of my Bridgeport BOSS-3 (started life as steppers run by a LSI-11) to servos. The stepper motor is shorter than the servos, and was mounted directly under the Y-axis leadscrew, with the stepper protruding into a cast-in cavity in the knee. The servo has to be moved to the right of the knee instead of under it, because of the extra length.

Good Luck, DoN.

Reply to
DoN. Nichols

Isn't this close to the minimum resolution of your encoders?

Let's see -- 4000 PPR, and 0.200"/R with the ball screws you have (I think), which means that you have 0.000050" per pulse. There has to be a little back and forth as long as the axis is active. Remember that drift with no input control signal? This will move the axis until the encoder tells the system about it, at which the system will command a very slow motion in the other direction and it will drift through the desired point until it overshoots in the other direction.

However -- I don't think that you will be able to measure 50 uInch on your system anyway. Have you checked what backlash is in your ballscrews?

Absolutely. You will need to be physically present for that, however -- you can't push the limit switches with ssh from rooms or miles away. :-)

Great, DoN.

Reply to
DoN. Nichols
[ ... ]

What inches-per-minute are those -- 20 and 10 inches per minute? At 20 IPM, that would be 100 motor revolutions in a minute, or 400K pulses per second (PPM) -- 6666 PPS. That is 150 uS per pulse. Have you looked at the pulse waveform with a scope to see what the rise time is? And whether there is overshoot or undershoot from an impedance mismatch?

Anything which loses you index pulses will cause errors of this sort. Get there with a scope, monitor the waveform at the board which is counting the pulses, and see what the waveform looks like -- then increase speed by about 10% at a time and see what the waveform looks like when the errors start to appear.

Yes -- you do need to tune the servo amps -- but not until you get the belts on so you are moving the cast iron.

Good Luck, DoN.

Reply to
DoN. Nichols

DoN, I got that jitter fixed, there is none any more. I changed a couple of settings. Now the mill finds a "position" quite accurately.

i
Reply to
Ignoramus2398

Egg-zactly.

I took some pictures for you.

Save these pictures on your hard drive, as they could be gone in a month or so.

formatting link
My current job, which is CNC retrofit on an old mill, amounts to connecting wires in the right places, most of the time. This is the activity that is a lot like computer programming, something with which I am comfortable.

I know that I personally would not take on any retrofit job where substantial modifications to hardware are involved. For example, I rejected any ideas of adding a knee lifting axis or anything like that.

i
Reply to
Ignoramus12838

It is a fun project, if it was only not as warm in the garage. As of now, I feel that things are under control.

i
Reply to
Ignoramus12838

I will look into it today. For yesterday, I set maximum position error to 10 inches, just to work on other issues.

I have a question for you Jon, may be related. The power supply produces 72 volts. But the servo amps only output the max of 44. The voltage on your DAC, is also never about 6 volts or so. I would like to know why, there is probably some setting that I am not doing right. Thanks a lot.

Here's my ppmc.ini file:

# EMC controller parameters for generic controller. Make these what you need # for your system.

# General note: Comments can either be preceded with a # or ; - either is # acceptable, although # is in keeping with most linux config files.

# General section ------------------------------------------------------------- [EMC]

# Version of this INI file VERSION = $Revision: 1.4 $

# Name of machine, for use with display, etc. MACHINE = EMC-PPMC

# Name of NML file to use, default is emc.nml NML_FILE = emc.nml

# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others DEBUG = 0 # DEBUG = 0x00000007 # DEBUG = 0x7FFFFFFF

# Sections for display options ------------------------------------------------ [DISPLAY]

# Name of display program, e.g., xemc # DISPLAY = axis # DISPLAY = usrmot

DISPLAY = tkemc # Cycle time, in seconds, that display will sleep between polls CYCLE_TIME = 0.100

# Path to help file HELP_FILE = tkemc.txt

# Initial display setting for position, RELATIVE or MACHINE POSITION_OFFSET = RELATIVE

# Initial display setting for position, COMMANDED or ACTUAL POSITION_FEEDBACK = ACTUAL

# Highest value that will be allowed for feed override, 1.0 = 100% MAX_FEED_OVERRIDE = 1.2

# Prefix to be used PROGRAM_PREFIX = /home/ichudov/emc2/nc_files

# Introductory graphic INTRO_GRAPHIC = emc2.gif INTRO_TIME = 2

# Enable popup balloon help BALLOON_HELP = 1

# Task controller section ----------------------------------------------------- [TASK]

# Name of task controller program, e.g., milltask TASK = milltask

# Cycle time, in seconds, that task controller will sleep between polls CYCLE_TIME = 0.010

# Part program interpreter section -------------------------------------------- [RS274NGC]

# File containing interpreter variables PARAMETER_FILE = ppmc.var

# Motion control section ------------------------------------------------------ [EMCMOT]

EMCMOT = motmod

# Timeout for comm to emcmot, in seconds COMM_TIMEOUT = 1.0

# Interval between tries to emcmot, in seconds COMM_WAIT = 0.01

# Servo task period, in nanoseconds SERVO_PERIOD = 1000000

# Hardware Abstraction Layer section

-------------------------------------------------- [HAL]

# The run script first uses halcmd to execute any HALFILE # files, and then to execute any individual HALCMD commands. #

# list of hal config files to run through halcmd # files are executed in the order in which they appear HALFILE = ppmc_load.hal

HALFILE = ppmc_servo.hal HALFILE = ppmc_motion.hal HALFILE = ppmc_io.hal

# list of halcmd commands to execute # commands are executed in the order in which they appear #HALCMD = save neta

# Trajectory planner section -------------------------------------------------- [TRAJ]

AXES = 4 # COORDINATES = X Y Z R P W COORDINATES = X Y Z A HOME = 0 0 0 0 LINEAR_UNITS = inch ANGULAR_UNITS = degree CYCLE_TIME = 0.010 DEFAULT_VELOCITY = 0.15 MAX_VELOCITY = 1.20 DEFAULT_ACCELERATION = 1.5 MAX_ACCELERATION = 1.5

# Axes sections ---------------------------------------------------------------

# Scaling: The OUTPUT_SCALE should be the speed # in UNITS/second (inches/sec or mm/sec) that would be # reached if the PWM duty cycle was 100%. It depends on # the power supply voltage, motor RPM/Volt factor, and # gearing/screw pitch. For example: # # Power supply voltage 50V # Motor RPM/V 1000RPM/24V # Gearing: 2 motor revs per 1 screw rev # Screw pitch: 0.2" per turn # # Max motor speed = 50V * 1000RPM/24V = 2083 RPM # Max screw speed = 2083RPM * 1(screw)/2(motor) = 1041RPM # Max table speed = 1041RPM * 0.2"/turn = 208 in/min # Max table speed = 208 in/min / 60 seconds = 3.47 inches/sec # # Since max speed is reached at 100% duty cycle, OUTPUT_SCALE # should be 3.47

# First axis [AXIS_0]

TYPE = LINEAR HOME = 0.000 MAX_VELOCITY = 1.20 MAX_ACCELERATION = 1.25 PID_MAX_VEL = 1.2 BACKLASH = 0.000 INPUT_SCALE = -128000.0 OUTPUT_SCALE = -2.06 MIN_LIMIT = -10.0 MAX_LIMIT = 10.0

FERROR = 0.001 MIN_FERROR = 0.005

HOME_OFFSET = 0.0 HOME_SEARCH_VEL = 0.0 HOME_LATCH_VEL = 0.0 HOME_USE_INDEX = NO HOME_IGNORE_LIMITS = NO DEADBAND = 1e-06 P = 800.0 I = 25.0 D = 20.0 BIAS = 0.0 FF0 = 0.0 FF1 = 1.0 FF2 = 0.0

# Second axis [AXIS_1]

TYPE = LINEAR HOME = 0.000

# Igor # MAX_VELOCITY = 1.20 # Igor # MAX_ACCELERATION = 1.25 MAX_VELOCITY = 2 MAX_ACCELERATION = 2

PID_MAX_VEL = 10 BACKLASH = 0.000

# Igor # INPUT_SCALE = -128000.0 # Igor # OUTPUT_SCALE = -1.0 INPUT_SCALE = 40000.0 OUTPUT_SCALE = 1

MIN_LIMIT = -40.0 MAX_LIMIT = 40.0

# MAX_OUTPUT = 10

# Igor # FERROR = 0.001 # Igor # MIN_FERROR = 0.005 FERROR = 10.13 MIN_FERROR = 10.13

HOME_OFFSET = 0.0 HOME_SEARCH_VEL = 0.0 HOME_LATCH_VEL = 0.0 HOME_USE_INDEX = NO HOME_IGNORE_LIMITS = NO DEADBAND = 1e-06 P = 800.0 I = 25.0 D = 10.0 BIAS = 0.0 FF0 = 0.0 FF1 = 1.0 FF2 = 0.0

# Third axis [AXIS_2]

TYPE = LINEAR HOME = 0.0 MAX_VELOCITY = 1.20 MAX_ACCELERATION = 1.25 PID_MAX_VEL = 1.2 BACKLASH = 0.000

INPUT_SCALE = 128000.0 OUTPUT_SCALE = 1.0

MIN_LIMIT = -10.0 MAX_LIMIT = 10.0 FERROR = 0.001 MIN_FERROR = 0.005 HOME_OFFSET = 0.0 HOME_SEARCH_VEL = 0.0 HOME_LATCH_VEL = 0.0 HOME_USE_INDEX = NO HOME_IGNORE_LIMITS = NO DEADBAND = 8e-05 P = 800.0 I = 25.0 D = 10.0 BIAS = 0.0 FF0 = 0.0 FF1 = 1.0 FF2 = 0.0

# Fourth axis [AXIS_3]

TYPE = ANGULAR HOME = 0.0 MAX_VELOCITY = 65 MAX_ACCELERATION = 20.0 PID_MAX_VEL = 66.0 BACKLASH = 0.000 INPUT_SCALE = 1111.111 OUTPUT_SCALE = 5.0 MIN_LIMIT = -3600.0 MAX_LIMIT = 3600.0 FERROR = 1.010 MIN_FERROR = 1.001 HOME_OFFSET = 0.0 HOME_SEARCH_VEL = 0.0 HOME_LATCH_VEL = 0.0 HOME_USE_INDEX = NO HOME_IGNORE_LIMITS = NO DEADBAND = 0.046 P = 150.0 I = 100.0 D = 0.1 BIAS = 0.0 FF0 = 0.0 FF1 = 1.0 FF2 = 1.0

# section for main IO controller parameters ----------------------------------- [EMCIO]

# Name of IO controller program, e.g., io EMCIO = io

# cycle time, in seconds CYCLE_TIME = 0.100

# tool table file TOOL_TABLE = ppmc.tbl

# section for external NML server parameters ---------------------------------- [EMCSERVER] # Uncomment the following line if you need to run a remote GUI. # EMCSERVER = emcsvr

Reply to
Ignoramus12838

I've snipped a few things from your .ini file, I think you are working on the Y axis [AXIS_1} so I'll discuss those values, the significant ones listed above. MAX_VELOCITY = 2 means

2 user units/second, or 120 IPM. Is that the actual max velocity you are setting up for, and does it equal about 10 V at the command input to the servo amp? But, your [TRAJ] section sets global MAX_VELOCITY to 1.20. So, depending on how you get your 6 V maximum, then (1.2/2) * 10 = 6 exactly. So, if that is the limit with the motor spinning, it is perfectly explained. If you were to grab the motor and force it off the servo null, however, or do this with the servo amps disabled, you should get the full 10 V output if you move the shaft enough. PID_MAX_VEL seems to be horribly wrongly named, it sets a maximum output from the PID output so it can be passed to the DAC, but 10 is the right value, ie. to send 10 V max out from the DAC. OUTPUT_SCALE should also be 1.0, a larger number reduces available output. Fine tuning is done with the P term of the PID.

Jon

Reply to
Jon Elson
[ ... ]

Thanks! Apparently, this version puts the servo motor to the left of the knee, instead of to the right -- and it bolts onto the side of the knee instead of just attaching to the points which would have supported the hand crank and dial as the older BOSS-3 one did. (Four screws, IIRC.)

What is that rod which comes out between the servo motor and the knee?

Understood.

Again, understood. If I had known what the problems would be with servos in that one axis (the other two drop in easily) I might have opted to stick with the steppers. But I may go with the mount bolted to the left side of the knee instead of the angled belt guard/motor mount which apparently some systems used in the past. This would be easier -- and just make a lightweight belt guard to go over it, instead of having to make a really complex weldment (since I don't have welding capability anyway).

Thanks, DoN.

Reply to
DoN. Nichols

Great! Settings in the servo amp, or in the EMC configuration file?

Glad that worked out. DoN.

Reply to
DoN. Nichols

Mostly EMC file, bit I fiddled with gain on the amplifier also.

i
Reply to
Ignoramus12838

I do not understand your question.

i
Reply to
Ignoramus12838

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.