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

On Wed, 14 Jul 2010 15:43:40 -0500, Ignoramus2398


Tuned your amps yet?
Now is the time.
Gunner
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Yay, I figured it out, it works great!
I am still away from home, but I am sure the servo motor is spinning etc. I executed my first G codes! I will verify it when I get home.
thanks!!
i
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On 7/14/2010 1:00 PM, Ignoramus2398 wrote:
(...)

Kewl!
--Winston
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Ignoramus2398 wrote:

If you had your netcam pointed at the motor, you could see it spinning :) Of course if it wasn't spinning you wouldn't be getting encoder counts, so you can be sure it's spinning.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

The motor's shaft is smooth. I could not see it spin unless I put a sticker on it.

exactly!
Any idea what could cause a following error at higher speeds (f20 instead of f10)?
i
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Gizmo - AKA gremlins...
...Seriously though, good luck.
--


Regards,
Joe Agro, Jr.
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On 7/14/2010 1:44 PM, Ignoramus2398 wrote:
(...)

Winston > ...and caused the dreaded "following Winston > error" to disappear.
A 'following error' you say?
Sounds serious. Can anyone help Iggy with this?
--Winston
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I was thinking, and I think that I know what is happening, not yet exacatly how to fix it.
I tell EMC what is my speed at max voltage, and EMC is measuring actual position.
I did not correctly specify the speed and thus EMC expects a wrong position.
i
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Ignoramus2398 wrote:

Acceleration rate. You probably have it trying to go from stopped to the specified speed with no acceleration ramp. You get away with it when specifying a low speed since you only have the motor mass to spin up currently, but even then when you try to do 0-20 IPM it can't accelerate fast enough and errors. The same will apply to your deceleration rate. Both of those rates will also be a lot lower when you have actual machine mass to get moving or stopped.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

but my motor is not connected to the milling table, it spins by itself!
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

That's what he just said, Iggy. Even the motor mass is excessive if you have no acceleration time.
LLoyd
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On 2010-07-15, Lloyd E. Sponenburgh <lloydspinsidemindspring.com> wrote:

Well, I do have max_acceleration set.
i
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

The operative question would be, "To what?"
It may be excessive, even for the motors own inertia.
LLoyd
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Pete C. wrote:

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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On 7/14/2010 3:51 PM, Jon Elson wrote:

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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Ignoramus12838 wrote:

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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Yes. Y axis only.

I believe that the speed at 70v will be more like 70 or so IPM, but I am not sure. I tried to set max velocity so that the drive would "try hard".

I think that you got it.

Jon, seems easy enough, I will try it tonight. I did not see PID_MAX_VEL in EMC docs and did not set it. I will set PID_MAX_VEL to 10.
I have yet to find a good page on PID tuning.
Thanks a lot.
i
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On 7/15/2010 10:45 PM, Ignoramus12838 wrote:

Not sure what information you are looking for, but here is one of my favorite authors on the subject:
<http://electronicdesign.com/article/analog-and-mixed-signal/what-s-all-this-p-i-d-stuff-anyhow-6131.aspx
Kevin Gallimore
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

You can also find some good info by searching for PID on the Nuts and Volts magazine web site.
Dan
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.