- Posts: 161
- Thank you received: 0
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.
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
Jools
Please Log in to join the conversation.
Does this look right?
Jools
Please Log in to join the conversation.
How does one invert the io pin?
Please Log in to join the conversation.
hm2_7i96.0.gpio.XXX.in
to
hm2_7i96.0.gpio.XXX.in_not
Please Log in to join the conversation.
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.
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.
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.
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.
forum.linuxcnc.org/24-hal-components/379...s-work-series#151551
Please Log in to join the conversation.
