5i25 + 7i85s +....

More
9 years 11 months ago #83115 by casetero
Replied by casetero on topic 5i25 + 7i85s +....
Hi,

Dont know exactly how to check that. With HAL configuration i can see that

hm2_5i25.0.pwmgen.00.value

Shows negative values when going anticlock-wise and positive values when going clock-wise.

Can i see in some way the state of DIR ( out1 of pwmgen ) via HAL configurator or something?

I check it with the voltimeter and i see that TX6 ( out1 of pwmgen) is always HIGH, no matter if the pwmgen is enabled or the direction (clock or anti-clokwise).

Thank you!

Please Log in to join the conversation.

More
9 years 11 months ago #83116 by andypugh
Replied by andypugh on topic 5i25 + 7i85s +....
I think that you should be able to see the state of the DIR output as a GPIO pin. (If I recall correctly the FPGA output states are readable as inputs)

Please Log in to join the conversation.

More
9 years 11 months ago #83118 by casetero
Replied by casetero on topic 5i25 + 7i85s +....
Yes, it works.

I can see the state of the GPIO PIN hm2_5i25.0.gpio.003.in (TX6 -> DIR) changing in the HAL configurator when i switch from clock-wise to anti-clockwise. But testing with the voltimeter the state doesnt switch in TX6. It remains always HIGH. In fact when go i clockwise the voltimeter shows something weird, like if it was trying to change to LOW but very fast it goes HIGH again.

Maybe something wrong with the threads?? Do u want to see my hole HAL file??

I have tested with the voltimeter TX7 too (PWM), and it gives me 3.75 V ( i guess that is a false meassure as it is a PWM out) when the spindle is in STOP and clockwise, and 0 V when is anticlock-wise.

I have tested the the hm2_5i25.0.gpio.002.in ( TX7 -> PWM) with the HAL scope, and it shows variable waves when changing the velocity of the spindle. It always shows a positive cuadrature wave no matter if clock or anticlockwise.

So i guess the PIN TX7->PWM works nice too.

Thank you.

Please Log in to join the conversation.

More
9 years 11 months ago #83119 by andypugh
Replied by andypugh on topic 5i25 + 7i85s +....
Have you tested the DIR pin when not connected to external hardware?

Please Log in to join the conversation.

More
9 years 11 months ago #83120 by casetero
Replied by casetero on topic 5i25 + 7i85s +....
Yes, it is unwired.

I have test the hm2_5i25.0.gpio.003.in ( TX6->DIR) with the hal scope and it remains always LOW. Although in the HAL configurator it switches.

EDIT= Sorry, it changes in HAL scope too, from HIGH to LOW as shows the HAL configurator.

Please Log in to join the conversation.

More
9 years 11 months ago #83121 by casetero
Replied by casetero on topic 5i25 + 7i85s +....
Here is my HAL file. Maybe i have to add some threads or something.

# Mesa driver hecho por Pablo Grupo Volund S.A.


loadrt trivkins



loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES

# loadrt threads name1=pablo period1=40000000

loadrt hostmot2

loadrt hm2_pci config="num_encoders=4 num_stepgens=3 num_pwmgens=1 sserial_port_0=000xxx"

loadrt pid num_chan=3

loadrt lincurve count=4 personality=6,4,6,4

#loadrt pwmgen output_type=0

setp hm2_5i25.0.watchdog.timeout_ns 10000000



# Salidas GPIO y PWM para SPIN1x

setp hm2_5i25.0.gpio.001.is_output 1

net spindle-enable motion.spindle-on => hm2_5i25.0.gpio.001.out hm2_5i25.0.pwmgen.00.enable

net spindle-speed-cmd motion.spindle-speed-out => hm2_5i25.0.pwmgen.00.value

# net spindle-pwm pwmgen.0.value =>

setp hm2_5i25.0.pwmgen.00.scale 17500





# ################################################
# THREADS
# ################################################

addf hm2_5i25.0.read servo-thread

addf motion-command-handler servo-thread
addf motion-controller servo-thread


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

addf hm2_5i25.0.write servo-thread


addf lincurve.0 servo-thread
addf lincurve.1 servo-thread

addf lincurve.2 servo-thread
addf lincurve.3 servo-thread

# addf pwmgen.update servo-thread
# addf pwmgen.make-pulses base-thread



# Eje X

# timing parameters

setp hm2_5i25.0.stepgen.00.dirsetup 20000
setp hm2_5i25.0.stepgen.00.dirhold 20000

setp hm2_5i25.0.stepgen.00.steplen 5000
setp hm2_5i25.0.stepgen.00.stepspace 5000

setp hm2_5i25.0.stepgen.00.position-scale 1400

setp hm2_5i25.0.stepgen.00.maxvel [AXIS_0]MAX_VELOCITY
setp hm2_5i25.0.stepgen.00.maxaccel [AXIS_0]MAX_ACCELERATION

setp hm2_5i25.0.stepgen.00.step_type 0

setp hm2_5i25.0.stepgen.00.control-type 1

net xenable axis.0.amp-enable-out => hm2_5i25.0.stepgen.00.enable => pid.0.enable

# Parafernaria made in volund

net xpos-fb axis.0.motor-pos-fb <= hm2_5i25.0.encoder.00.position => pid.0.feedback
net xpos-cmd axis.0.motor-pos-cmd => pid.0.command
net xpos-out pid.0.output => hm2_5i25.0.stepgen.00.velocity-cmd lincurve.0.in lincurve.1.in

# Parametros del PID

#setp pid.0.Pgain 7
setp pid.0.Igain 0
#setp pid.0.Dgain 0
setp pid.0.bias 0.0
setp pid.0.FF0 0.0
setp pid.0.FF1 0
setp pid.0.FF2 0
setp pid.0.deadband 0.0075
setp pid.0.maxoutput 16



setp hm2_5i25.0.encoder.00.scale 200

#lincurve para eje x

setp lincurve.0.x-val-00 -10
setp lincurve.0.x-val-01 -0.07
setp lincurve.0.x-val-02 -0.03
setp lincurve.0.x-val-03 +0.03
setp lincurve.0.x-val-04 +0.07
setp lincurve.0.x-val-05 +10

setp lincurve.0.y-val-00 0.5
setp lincurve.0.y-val-01 5
setp lincurve.0.y-val-02 100
setp lincurve.0.y-val-03 100
setp lincurve.0.y-val-04 5
setp lincurve.0.y-val-05 0.5


setp lincurve.1.x-val-00 -16.0
setp lincurve.1.x-val-01 -0.1
setp lincurve.1.x-val-02 +0.1
setp lincurve.1.x-val-03 +16.0

setp lincurve.1.y-val-00 0
setp lincurve.1.y-val-01 0
setp lincurve.1.y-val-02 0
setp lincurve.1.y-val-03 0


# net x-vel axis.0.joint-vel-cmd => lincurve.0.in lincurve.1.in

# net x-vel pid.0.output => lincurve.0.in lincurve.1.in

net x-Pgain lincurve.0.out-io => pid.0.Pgain

net x-Dgain lincurve.1.out-io => pid.0.Dgain

# Eje y

# timing parameters

setp hm2_5i25.0.stepgen.01.dirsetup 20000
setp hm2_5i25.0.stepgen.01.dirhold 20000

setp hm2_5i25.0.stepgen.01.steplen 5000
setp hm2_5i25.0.stepgen.01.stepspace 5000

setp hm2_5i25.0.stepgen.01.position-scale 1400

setp hm2_5i25.0.stepgen.01.maxvel [AXIS_0]MAX_VELOCITY
setp hm2_5i25.0.stepgen.01.maxaccel [AXIS_0]MAX_ACCELERATION

setp hm2_5i25.0.stepgen.01.step_type 0

setp hm2_5i25.0.stepgen.01.control-type 1

net yenable axis.1.amp-enable-out => hm2_5i25.0.stepgen.01.enable => pid.1.enable

# Parafernaria made in volund

net ypos-fb axis.1.motor-pos-fb <= hm2_5i25.0.encoder.01.position => pid.1.feedback
net ypos-cmd axis.1.motor-pos-cmd => pid.1.command
net ypos-out pid.1.output => hm2_5i25.0.stepgen.01.velocity-cmd lincurve.2.in lincurve.3.in

# Parametros del PID

#setp pid.1.Pgain 9
setp pid.1.Igain 0
setp pid.1.Dgain 0
setp pid.1.bias 0.0
setp pid.1.FF0 0.0
setp pid.1.FF1 0
setp pid.1.FF2 0
setp pid.1.deadband 0.0075
setp pid.1.maxoutput 16



setp hm2_5i25.0.encoder.01.scale 200

#lincurve para eje y

setp lincurve.2.x-val-00 -10
setp lincurve.2.x-val-01 -0.07
setp lincurve.2.x-val-02 -0.03
setp lincurve.2.x-val-03 +0.03
setp lincurve.2.x-val-04 +0.07
setp lincurve.2.x-val-05 +10

setp lincurve.2.y-val-00 0.5
setp lincurve.2.y-val-01 5
setp lincurve.2.y-val-02 100
setp lincurve.2.y-val-03 100
setp lincurve.2.y-val-04 5
setp lincurve.2.y-val-05 0.5


setp lincurve.3.x-val-00 -16.0
setp lincurve.3.x-val-01 -0.1
setp lincurve.3.x-val-02 +0.1
setp lincurve.3.x-val-03 +16.0

setp lincurve.3.y-val-00 0
setp lincurve.3.y-val-01 0
setp lincurve.3.y-val-02 0
setp lincurve.3.y-val-03 0


# net x-vel axis.0.joint-vel-cmd => lincurve.0.in lincurve.1.in

# net x-vel pid.0.output => lincurve.0.in lincurve.1.in

net y-Pgain lincurve.2.out-io => pid.1.Pgain

#net y-Dgain lincurve.3.out-io => pid.1.Dgain




# Eje Z

# timing parameters

setp hm2_5i25.0.stepgen.02.dirsetup 20000
setp hm2_5i25.0.stepgen.02.dirhold 20000

setp hm2_5i25.0.stepgen.02.steplen 5000
setp hm2_5i25.0.stepgen.02.stepspace 5000

setp hm2_5i25.0.stepgen.02.position-scale 1380

setp hm2_5i25.0.stepgen.02.maxvel [AXIS_0]MAX_VELOCITY
setp hm2_5i25.0.stepgen.02.maxaccel [AXIS_0]MAX_ACCELERATION

setp hm2_5i25.0.stepgen.02.step_type 0

setp hm2_5i25.0.stepgen.02.control-type 1

net zenable axis.2.amp-enable-out => hm2_5i25.0.stepgen.02.enable => pid.2.enable

# Parafernaria made in volund

net zpos-fb axis.2.motor-pos-fb <= hm2_5i25.0.encoder.02.position => pid.2.feedback
net zpos-cmd axis.2.motor-pos-cmd => pid.2.command
net zpos-out pid.2.output => hm2_5i25.0.stepgen.02.velocity-cmd

# Parametros del PID

setp pid.2.Pgain 8
setp pid.2.Igain 0
setp pid.2.Dgain 0
setp pid.2.bias 0.0
setp pid.2.FF0 0.0
setp pid.2.FF1 0.8
setp pid.2.FF2 0
setp pid.2.deadband 0.005
setp pid.2.maxoutput 16

setp hm2_5i25.0.encoder.02.scale 200


# Finales de Carrera

net X-lim- hm2_5i25.0.encoder.03.input-a => axis.0.neg-lim-sw-in
net X-lim+ hm2_5i25.0.encoder.03.input-b => axis.0.pos-lim-sw-in

net Y-lim- hm2_5i25.0.encoder.03.input-index => axis.1.neg-lim-sw-in
net Y-lim+ hm2_5i25.0.encoder.02.input-index => axis.1.pos-lim-sw-in

net Z-lim- hm2_5i25.0.encoder.00.input-index => axis.2.neg-lim-sw-in
net Z-lim+ hm2_5i25.0.encoder.01.input-index => axis.2.pos-lim-sw-in

# Basura final

net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

Please Log in to join the conversation.

More
9 years 11 months ago #83124 by PCW
Replied by PCW on topic 5i25 + 7i85s +....
Dont know if its your issue but at the minimum you should set the PWM output type ( to 1 )
and PWM frequency ( to 5000 for the Spinx1 ) in your hal file

Please Log in to join the conversation.

More
9 years 11 months ago #83130 by casetero
Replied by casetero on topic 5i25 + 7i85s +....
Hi,

I have set that two things in the HAL file, but continues doing the same. I didnt set the control-type in the HAL file because i checked with HAL configuration and it showed 1 , so i guessed that was the predeterminated value.

With the configuration i have the TX6 of the 7i85s should change its state by changing the direction of rotation, shouldnt it??

Thank you.

Please Log in to join the conversation.

More
9 years 11 months ago #83134 by casetero
Replied by casetero on topic 5i25 + 7i85s +....
If i wire the DIR to non-TX6 it works, because this PIN is always LOW, so it works clock-wise all the time.

But now i have the problem with the TX7, the SPIN1X is always sending 10 V ( the reference of my VFD), no matter which value has pwmgen.00.value. Furthermore, if i push the stop button, TX7 continues HIGH ( the voltimeter reads 3,7 V ), no matter what i do in linuxcnc, TX7 is always HIGH, like TX6.

I think my problem is that TX6 and TX7 are not controlable by linuxcnc. My version of linuxcnc is 2.7.4, should i upgrade??

Thank you.

Please Log in to join the conversation.

More
9 years 11 months ago #83141 by PCW
Replied by PCW on topic 5i25 + 7i85s +....
Are you sure you have a 7I85S, not a 7I85?
(check label on back of card)

This is very unlikely to be a LinuxCNC version dependent problem
(None of the PWM/driver code has changed for many years)

How is the 7I85S powered?

Please Log in to join the conversation.

Time to create page: 0.095 seconds
Powered by Kunena Forum