7i96 Configuration Tool

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 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 to join the conversation.

More
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

Please Log in 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 to join the conversation.

More
6 years 11 months ago #151583 by PCW
Replied by PCW on topic 7i96 Configuration Tool
By changing

hm2_7i96.0.gpio.XXX.in

to

hm2_7i96.0.gpio.XXX.in_not

Please Log in to join the conversation.

More
6 years 11 months ago #151584 by Leon82
Replied by Leon82 on topic 7i96 Configuration Tool

PCW wrote: By changing

hm2_7i96.0.gpio.XXX.in

to

hm2_7i96.0.gpio.XXX.in_not


Ah, the underscore got me
One of my axis is reversed. In not quite sure the best way to invert it

Please Log in to join the conversation.

More
6 years 11 months ago #151585 by PCW
Replied by PCW on topic 7i96 Configuration Tool
If you are in doubt about pin or parameter names you can run

halcmd show all > all.txt

(with linuxcnc running) to get a list of all parameters, pins and signals

There are many ways to reverse a step motor direction:

1. swap one motor winding
2. reverse the direction pin wiring (use DIR- instead of DIR+ for example)
3. invert the direction pin in hal ( setp hm2_7i96.0.stepgen.XX.direction.invert_output true )
4. invert the stepgen scale

Please Log in to join the conversation.

More
6 years 11 months ago #151587 by Leon82
Replied by Leon82 on topic 7i96 Configuration Tool

PCW wrote: If you are in doubt about pin or parameter names you can run

halcmd show all > all.txt

(with linuxcnc running) to get a list of all parameters, pins and signals

There are many ways to reverse a step motor direction
hm2_7i95.0.stepgen.00.direction.invert_output
1. swap one motor winding
2. reverse the direction pin wiring (use DIR- instead of DIR+ for example)
3. invert the direction pin in hal ( setp hm2_7i96.0.stepgen.XX.direction.invert_output true )
4. invert the stepgen scale


Thank you, I inverted the scale

Please Log in to join the conversation.

More
6 years 11 months ago #151594 by Leon82
Replied by Leon82 on topic 7i96 Configuration Tool
When setting the external estop on input 0 I left the joint as select.

It is not tied to CNC however. Other hal files I have found had a couple extra lines under the estop section but I got a pin already defined error when I added them.

I've found some other Hal examples where an external estop was referenced but they were for a plasma machine

Please Log in to join the conversation.

More
6 years 11 months ago #151596 by PCW
Replied by PCW on topic 7i96 Configuration Tool
You might take a look at Samco's Estop video:

forum.linuxcnc.org/24-hal-components/379...s-work-series#151551

Please Log in to join the conversation.

Time to create page: 0.166 seconds
Powered by Kunena Forum