Proposal about encoder PWM connect

More
01 Oct 2010 14:47 #4470 by aike
Hi!
We are using servo drivers (servo motor with build-in encode + frequency amplifyer). The control moving STEP/DIR, but feebback via
encoder (2500 samples per round). To create configuration I need to select 3 encoders, 1 PWM and 2 step dir.
Every time the pncconf tell me "You foget ....". Can you make encoder and PWM independetly, theat pncconf not
check the coexist other part (encoder + pwm for example.
Let encoder, step and pwm wiil be separate parts of the configuration.
Make check box for it for example. :))

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

More
04 Oct 2010 03:03 #4503 by cmorley
What are you connecting the encoder signals to?
Your right pncconf does not support using encoders with step drives.
the best way to do this with pncconf as is - is to use custom signal names.
set up the axis as a stepper (because it is a step drive) then add a custom signal name to the encoder.
this makes pncconf add the encoder signals with your custom name (with different endings)
then in your custom HAL file connect the encoder signals to other signals.

BTW the warnings are just that- warnings - it doesn't actually stop you from moving on.
pncconf writes configs differently based on whether it is step driven or servo driven.
The config you are trying to build (steppers with encoders) is not common, not proven useful and
(most importantly ) i don't have the hardware to even basically test it.
If you do get this to work satisfactory please post your config and pncconf files and I will consider adding the capability.
In the mean time thank you for feedback about pncconf - it can't be better with out comments.
i hope otherwise it was useful to you.
Chris M

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

More
04 Oct 2010 03:17 #4504 by aike
Hi!
Here is the sample of my configuration (X axes for example). It works.
STEP/DIR servo control (not PWM) with feedback obtained by 2500 sample encoder.

#################### IT42.hal ########################
loadrt trivkins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

loadrt hostmot2
loadrt hm2_pci config="firmware=hm2/5i20/SVST8_4.BIT num_encoders=2 num_pwmgens=1 num_stepgens=2"

setp hm2_5i20.0.pwmgen.pwm_frequency 100000
setp hm2_5i20.0.pwmgen.pdm_frequency 100000
setp hm2_5i20.0.watchdog.timeout_ns 10000000

loadrt pid num_chan=2
loadrt abs names=abs.spindle

addf hm2_5i20.0.read servo-thread

addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf abs.spindle servo-thread


addf hm2_5i20.0.write servo-thread

addf hm2_5i20.0.pet_watchdog servo-thread

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


#*******************
#AXIS X
#*******************

#set PID loop gains from inifile
#PID
# set PID loop gains from inifile
setp pid.0.Pgain 40.0
setp pid.0.Igain 0.0
setp pid.0.Dgain 0.0
setp pid.0.bias 0.0
setp pid.0.FF0 0.0
setp pid.0.FF1 1.0
setp pid.0.FF2 0.0
setp pid.0.deadband 0.00015
setp pid.0.maxoutput [AXIS_0]MAX_VELOCITY


# Step Gen signals/setup
setp hm2_5i20.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
setp hm2_5i20.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
setp hm2_5i20.0.stepgen.00.steplen [AXIS_0]STEPLEN
setp hm2_5i20.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
setp hm2_5i20.0.stepgen.00.position-scale [AXIS_0]SCALE

setp hm2_5i20.0.stepgen.00.maxaccel 0
setp hm2_5i20.0.stepgen.00.maxvel 0
setp hm2_5i20.0.stepgen.00.step_type 0
setp hm2_5i20.0.stepgen.00.control-type 1

#encoder X
setp hm2_5i20.0.encoder.00.scale [AXIS_0]SCALE
setp hm2_5i20.0.encoder.00.filter 1

newsig Xenable bit
sets Xenable FALSE
net Xenable => pid.0.enable
net Xenable => hm2_5i20.0.stepgen.00.enable
net Xenable <= axis.0.amp-enable-out

net Xindex hm2_5i20.0.encoder.00.index-enable axis.0.index-enable

net Xpos-fb <= hm2_5i20.0.encoder.00.position <= pid.0.feedback
net Xpos-fb => axis.0.motor-pos-fb #push copy back to Axis GUI

net Xpos-cmd axis.0.motor-pos-cmd => pid.0.command

net Xpos-out pid.0.output => hm2_5i20.0.stepgen.00.velocity-cmd

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

More
04 Oct 2010 04:35 #4505 by cmorley
excellent.
Are there any problems with this set up?
have you used this to actually machine something?
Is this really better then just using an open loop config? (besides knowing when there is a following error)

Oh and i take back what I said about making a config as a stepdriven then using custom hal names.
I didn't realize you wanted PID control.
I will consider what it would take to add this option in pncconf.
Though it won't happen soon I'm pretty sure.
Chris M

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

More
04 Oct 2010 13:14 #4511 by aike
Hi!
All you see was done earlier by Gtom, he helped me in this HAL config.
We are testing it now in lather. I send you video soon and the snapshot of ferror.
We are controlling the behaving to this parameter. We need it to be less then 0.01 mm
during the all programm.
Ofcause, it's better then open loop, no missed samples (steps) and we made index pulses.
It help our worker to switch on lather morning :)
The author of this solution is gtom (Thomas from Germany)

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

More
05 Oct 2010 07:17 #4520 by cmorley
I'm thinking that adding a combo box with the options servo, open loop step drive, and closed loop step drive
on the axis page maybe the way to go for this, that allows each axis to be different. but that means pncconf wont catch
errors such as forgetting the pwm signal until the user tries to go past the axis page. not the end of the world I guess.

Does Thomas use closed loop steppers too?

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

More
05 Oct 2010 15:57 #4525 by aike
Yes. combo box is better.
Thomas has optical liner encoder, I found his message in this Forum.

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

More
21 Nov 2010 17:57 #5495 by aike
You can see video and HAL and INI files in this topick: www.linuxcnc.org/component/option,com_ku...7/lang,english/#5489
I create in pncconf the configuration only with PWM and with stepgen separate, then corrcted HAL and INI file by hand.
If you will add combobox in pncconf configuration, the writing of config files will be more comfortable, then now.

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

More
22 Nov 2010 04:04 #5518 by cmorley
I have started to add this feature on a development version of pncconf.
Instead of a combo box , Pncconf will assume if you ask to steppers and encoders that you want closed loop steppers.

A combo box for each axis seems clumsy.

Thank you for the video and the files for reference.

Chris M

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

Moderators: cmorley
Time to create page: 0.073 seconds
Powered by Kunena Forum