Hi all.

I did not want to hijack the "Advice for mesa 5i20 servo drivers needed"
thread, but this thread may cover some of the same issues. I am having two
issues, the first I think is minor, the second I am not so sure. 

1> When I try to run Setting | Calibration from tkemc, or the equivalent
under axis I get an error of the form:

af: 0 .main.top.fpage0
(followed by 4 lines starting with the same text)

Error in startup script: Invalid argument
  While executing
"hal getp {hm2_[HOSTMOT2](BOARD).0.encoder.00.scale}"
  ("eval" body line 1)
  evoked from within
"eval hal $args"
etc. 

If it matters, I am still running 2.3.0 as I am using the smp packages, and
have not updated them to the subsequent minor releases.

2> Tuning the servo motors

I am using the 7i43 Anything I/O card with the 7i33 quad analog servo
interface.

I am having a devil of a time getting anything close to smooth motion from
the motors in the PID tuning. I start, as I usually do by bringing up P, but
I start to get oscillations with a P value of about 20. If I use this value
to have it move to a position, it will over or undershoot the position by
1/2" (2500 encoder counts or 6/10ths of a turn of the motor shaft). The
motor is not coupled to the load at this point. Increasing P to about 160
stiffens it up to the point where one would think it would get within an
encoder count or two of the demanded position, however there is still a
strong oscillation of about +/- 0.1" (500 encoder counts or roughly 1/10th
turn of the motor shaft).

I then try bringing up I and D, but it is generally making little difference
until the values are large enough that it makes it worse. The basic problem
is that it is so bad I am having trouble even establishing a starting point
from which it will get better or worse. This is a retrofit of a system which
previously used a Galil 1800 series motion controller, and where tuning with
that system was no big deal. Galil does have a rather nice piece of tuning
software, but I don't recall even needing that.

Additionally, about six months ago I replaced an EMC system using the VTI
board (plus a 5i20 which only drove the laser) to use exclusively the 5i20
and 7i33 with the hostmot2 drivers. With the VTI card, tuning was a snap
because it ran smoothly for a large range of PID values. When I switched it
over to the 5i20, I again had a devil of a time getting it tuned, but
finally got something reasonably acceptable, but never as good as when using
the VTI board. It will still occasionally hum at idle for example, which
never happened under the previous configuration.

At the time, I thought it might be due to the PWM frequency, which I had to
set to 25Khz, as that was the maximum frequency acceptable to the laser.
With this configuration, there is no laser, so I have pwm_frequency set to
193Khz and pdm_frequency set to 6Mhz.

I keep thinking it is some value other than the PID values which is throwing
me, but so far I do not see it. I have included the relevant sections of the
ini and hal files for the axis I am trying to tune below.

------------------------->ini file<---------------------------------
[AXIS_1]

TYPE =                                        LINEAR
HOME =                                        0.000
MAX_VELOCITY =                       10.0
MAX_ACCELERATION =           40.0
BACKLASH =                               0.000
INPUT_SCALE =                        -5555
OUTPUT_SCALE =                    1.000
OUTPUT_OFFSET =                      0.0
MIN_LIMIT =                                  0.0
MAX_LIMIT =                            180.0
FERROR =                                    100.0
MIN_FERROR =                             0.4
HOME_OFFSET =                        0.10
HOME_SEARCH_VEL =             0.10
HOME_LATCH_VEL =               -0.01
HOME_USE_INDEX =                  NO
HOME_IGNORE_LIMITS =        YES
MAX_OUTPUT =                           1.0
# PID tuning params
DEADBAND =                      0.000015
P =                                               150.00
I =                                                       0.0
D =                                                   0.00
FF0 =                                             0.000
FF1 =                                             1.000
FF2 =                               0.0
BIAS =                                           0.000
------------------------->ini file<---------------------------------

------------------------->hal file<---------------------------------
# standard components
loadrt pid num_chan=3

addf pid.0.do-pid-calcs                    servo-thread
addf pid.1.do-pid-calcs                    servo-thread
addf pid.2.do-pid-calcs                    servo-thread

setp hm2_7i43.0.pwmgen.pwm_frequency       193000
setp hm2_7i43.0.pwmgen.pdm_frequency       6000000


# ################
# Y [1] Axis
# ################

# axis enable chain
newsig emcmot.01.enable bit
sets emcmot.01.enable FALSE
net emcmot.01.enable => pid.1.enable
net emcmot.01.enable => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.enable
# net YEnable => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.enable
net emcmot.01.enable <= axis.1.amp-enable-out 

# encoder feedback
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.counter-mode 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.filter 1
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-invert 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-mask 0
setp hm2_[HOSTMOT2](BOARD).0.encoder.01.index-mask-invert 0

setp  hm2_[HOSTMOT2](BOARD).0.encoder.01.scale  [AXIS_1]INPUT_SCALE
net motor.01.pos-fb hm2_[HOSTMOT2](BOARD).0.encoder.01.position =>
pid.1.feedback
net motor.01.pos-fb => axis.1.motor-pos-fb #push copy back to Axis GUI

# set PID loop gains from inifile
setp pid.1.Pgain [AXIS_1]P
setp pid.1.Igain [AXIS_1]I
setp pid.1.Dgain [AXIS_1]D
setp pid.1.bias [AXIS_1]BIAS
setp pid.1.FF0 [AXIS_1]FF0
setp pid.1.FF1 [AXIS_1]FF1
setp pid.1.FF2 [AXIS_1]FF2
setp pid.1.deadband [AXIS_1]DEADBAND
setp pid.1.maxoutput [AXIS_1]MAX_VELOCITY

# position command signals
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.output-type 1 #pwm on pin1, dir on
pin2
setp hm2_[HOSTMOT2](BOARD).0.pwmgen.01.scale [AXIS_1]OUTPUT_SCALE

net emcmot.01.pos-cmd axis.1.motor-pos-cmd => pid.1.command
net motor.01.command  pid.1.output  =>
hm2_[HOSTMOT2](BOARD).0.pwmgen.01.value
# net YVel => hm2_[HOSTMOT2](BOARD).0.pwmgen.01.value
------------------------->hal file<---------------------------------

Any ideas would be appreciated,
Eric



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to