7i96 Configuration Tool

More
6 years 11 months ago - 6 years 11 months ago #150937 by PCW
Replied by PCW on topic 7i96 Configuration Tool
Hey, didn't you add the velocity-rpm pin to the software and HM2 encoder?

That simplifies the PID setup
Last edit: 6 years 11 months ago by PCW.

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

More
6 years 11 months ago #150942 by andypugh
Replied by andypugh on topic 7i96 Configuration Tool

PCW wrote: Hey, didn't you add the velocity-rpm pin to the software and HM2 encoder?
That simplifies the PID setup


True, I did. But it isn't there on all LinuxCNC versions. .

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

More
6 years 11 months ago #150957 by jools
Replied by jools on topic 7i96 Configuration Tool

andypugh wrote: Y

Basically:
spindle-speed-command => PID command
spindle-speed-feedback => PID feedback
PID-output => PWM value

Be aware of units. Use a revs-per-second spindle speed command, as encoder velocity is in revs-per-second.


So

that would be something like

net spindle_speed spindle.0.speed-out => pid.3.command for the first one (got the pin name from the bit in my hal that links motion to output.
Then I need to look and find the name of the spindle feedback pin and the PID feedback pin
Find the name the PID out put pin and the pwm value pin

The above would come before the standard PID settings / values

Then below all that would come the pwmgen settings I all ready have?

On daddy duty now but if that's correct I'll hunt for pin names later and see if I can figure this out.

Cheers

Jools

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

More
6 years 11 months ago #151036 by jools
Replied by jools on topic 7i96 Configuration Tool

andypugh wrote: Yes, this is a perfect application for a PID controller.

There is an example here: wiki.linuxcnc.org/cgi-bin/wiki.pl?Closed...pindle_Speed_Control

But it isn't a very good one.... It adds the PID output on to the spindle speed command. I presume this is because it is old and dates to a time before the PID component included feed-forward terms.

Basically:
spindle-speed-command => PID command
spindle-speed-feedback => PID feedback
PID-output => PWM value

(ie, the PID is inserted between the spindle command out and the PID command in)

Start with P, I, D all zero and adjust FF0 to give the right speed under no-load. Then adjust I (mainly) and some P to get good stiff speed control.

Be aware of units. Use a revs-per-second spindle speed command, as encoder velocity is in revs-per-second.


How does this look
Code:
# Spindle setp hm2_7i96.0.pwmgen.00.output-type 1 setp hm2_7i96.0.pwmgen.00.scale [SPINDLE]MAX_RPM setp hm2_7i96.0.pwmgen.pwm_frequency [SPINDLE]PWM_FREQUENCY net spindle_on spindle.0.on hm2_7i96.0.pwmgen.00.enable hm2_7i96.0.ssr.00.out-05 net spindle_speed spindle.0.speed-out => pid.3.command net spindle-speed-feedback hm2_7i96.0.encoder.00.velocity-rpm pid.3.feedback net pid-output-command pid.3.output spindle.0.speed-out setp pid.3.Pgain [SPINDLE]P setp pid.3.Igain [SPINDLE]I setp pid.3.Dgain [SPINDLE]D setp pid.3.bias [SPINDLE]BIAS setp pid.3.FF0 [SPINDLE]FF0 setp pid.3.FF1 [SPINDLE]FF1 setp pid.3.FF2 [SPINDLE]FF2 setp pid.3.deadband [SPINDLE]DEADBAND setp pid.3.maxoutput [SPINDLE]MAX_RPM setp pid.3.maxerror [SPINDLE]MAX_ERROR

Jools

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

More
6 years 11 months ago - 6 years 11 months ago #151039 by jools
Replied by jools on topic 7i96 Configuration Tool
That didn't work so changed to this and linuxcnc loads now. Just need to hook the servo to the encoder input.

Does this look right?
Code:
# Spindle setp hm2_7i96.0.pwmgen.00.output-type 1 setp hm2_7i96.0.pwmgen.00.scale [SPINDLE]MAX_RPM setp hm2_7i96.0.pwmgen.pwm_frequency [SPINDLE]PWM_FREQUENCY net spindle_on spindle.0.on hm2_7i96.0.pwmgen.00.enable hm2_7i96.0.ssr.00.out-05 net spindle_speed spindle.0.speed-out => pid.3.command net spindle-speed-feedback hm2_7i96.0.encoder.00.velocity-rpm pid.3.feedback net pid-output-command pid.3.output hm2_7i96.0.pwmgen.00.value setp pid.3.Pgain [SPINDLE]P setp pid.3.Igain [SPINDLE]I setp pid.3.Dgain [SPINDLE]D setp pid.3.bias [SPINDLE]BIAS setp pid.3.FF0 [SPINDLE]FF0 setp pid.3.FF1 [SPINDLE]FF1 setp pid.3.FF2 [SPINDLE]FF2 setp pid.3.deadband [SPINDLE]DEADBAND setp pid.3.maxoutput [SPINDLE]MAX_RPM setp pid.3.maxerror [SPINDLE]MAX_ERROR



Jools
Last edit: 6 years 11 months ago by jools.

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

More
6 years 11 months ago #151581 by Leon82
Replied by Leon82 on topic 7i96 Configuration Tool
The io.hal file says if you make changes you are screwed.

How does one invert the io pin?

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

Moderators: PCW, jmelson
Time to create page: 0.161 seconds
Powered by Kunena Forum