configuring gearchange

More
23 Feb 2012 04:25 #17957 by chuck1024
I am trying to use gearchange to select a belt speed on my Emco lathe and I am not making much progress. I really need an example but cannot find one. Also it is not clear to me what units gear change expected for input and output (RPS or RPM)

I have a spindle speed panel from stepconf. The code looks like this which has been commented out for now

#setp scale.0.gain 60
#setp lowpass.0.gain 0.01
#net spindle-velocity => lowpass.0.in
#net spindle-rps-filtered <= lowpass.0.out
#net spindle-rps-filtered => abs.0.in
#net absolute-spindle-vel <= abs.0.out => scale.0.in
#net scaled-spindle-vel <= scale.0.out => pyvcp.spindle-speed

I have tried various things resembling this:
loadrt gearchange
#addf gearchange servo-thread (barfs on this)
setp gearchange.0.min1 50
setp gearchange.0.max1 1200
setp gearchange.0.min2 100
setp gearchange.0.max2 2000
setp gearchange.0.scale2 1.66
setp gearchange.0.sel 1

net spindle-velocity => gearchange.0.speed-in

setp scale.0.gain 60
setp lowpass.0.gain 0.01

net gearchange.0.speed-out => lowpass.0.in (error on this)

net spindle-rps-filtered <= lowpass.0.out
net spindle-rps-filtered => abs.0.in
net absolute-spindle-vel <= abs.0.out => scale.0.in
net scaled-spindle-vel <= scale.0.out => pyvcp.spindle-speed

SO.
1) does it need filtering?
2)does it need scaling?
3)how do I connect it to existing signals?

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

More
23 Feb 2012 10:44 - 25 Feb 2012 14:40 #17959 by ArcEye
Replied by ArcEye on topic Re:configuring gearchange
Hi

Couple of things that leap out:-

#addf gearchange servo-thread (barfs on this)

Should be gearchange.0

net spindle-velocity => gearchange.0.speed-in

You are attaching a RPS figure to a component you have set up to work in RPM

net gearchange.0.speed-out => lowpass.0.in (error on this)

Probably just because not loaded (and there is no signal here, just 2 pins)


regards
Last edit: 25 Feb 2012 14:40 by ArcEye.

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

More
25 Feb 2012 02:39 #18061 by chuck1024
Replied by chuck1024 on topic Re:configuring gearchange
I did this which now displays the speed on the panel.
but nothing changes when I change gearchange.0.sel from 0 to 1

For instance, I do M3 S500 and the spindle RPM is about 300 with the belt on low. So I conclude the PWM gen is still following the command setp pwmgen.0.scale 2000.0 It is setting the motor speed as if 2000 was top speed but in gear 0, 1200 is top speed.

I think all I really need to do to make the spindle RPM match the S word is change the pwmgen scale for each belt. How can I do that? I tried creating M codes M100-102 with a setp pwmgen.0.scale in each file but it did not seem to take affect.

I really need 3 speeds anyway. Should I scrap this and move on to a 3 speed spindle?
chuck

#setp scale.0.gain 60
#setp lowpass.0.gain 0.01
#net spindle-velocity => lowpass.0.in
#net spindle-rps-filtered <= lowpass.0.out
#net spindle-rps-filtered => abs.0.in
#net absolute-spindle-vel <= abs.0.out => scale.0.in
#net scaled-spindle-vel <= scale.0.out => pyvcp.spindle-speed

loadrt gearchange
addf gearchange.0 servo-thread

setp gearchange.0.min1 0
setp gearchange.0.max1 1200
setp gearchange.0.min2 0
setp gearchange.0.max2 2000
setp gearchange.0.scale2 1.66
setp gearchange.0.sel 0

setp scale.0.gain 60
setp lowpass.0.gain 0.01
net spindle-velocity => lowpass.0.in
net spindle-rps-filtered <= lowpass.0.out
net spindle-rps-filtered => abs.0.in

net absolute-spindle-vel <= abs.0.out => scale.0.in
net spindle-junk <= scale.0.out => gearchange.0.speed-in
net scaled-spindle-vel <= gearchange.0.speed-out => pyvcp.spindle-speed

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

More
25 Feb 2012 13:30 #18076 by ArcEye
Replied by ArcEye on topic Re:configuring gearchange
Apologies,

Think I had my head on backwards yesterday, I just followed your use of components regards displayed speed without actually looking at whether they were doing what you wanted.

If you have a spindle encoder index pulse of some sort, the RPS will always be correct, so you need to scale it to get RPM, remove the sign and put though a lowpass filter to stabilise it, then use it in your pyvcp speed display.
What is displayed will be the actual RPM, irrespective of what gear you are in.

When you use gearing, the speed figure to the motor needs scaling to reflect the effect of gearing upon the output spindle speed.
A commanded speed of S600 gives 600 RPM on a 1:1 drive but only 300 on a 1:2 drive

This link shows my solution to spindle gearing.

I have a user M code routine which changes the scale for each pulley position.
This is a second scale component, is linked to the stepgen which controls the spindle velocity.

www.linuxcnc.org/index.php/english/compo...id=10&id=15717#15762

The exact scale was determined by using a optical tachometer and incrementing the scale value,
to get the exact rpm required for the most commonly used speed in each pulley range

regards

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

More
25 Feb 2012 16:48 #18085 by chuck1024
Replied by chuck1024 on topic Re:configuring gearchange
Thanks. I added a scale to my pwmgen

# add scale for gear changes
# pwm configured for middle belt 0-2000
setp scale.1.in 0
setp scale.1.gain 1
setp scale.1.offset 0
addf scale.1 servo-thread

net spindle-cmd <= motion.spindle-speed-out => scale.1.in
net spindle-value <= scale.1.out => pwmgen.0.value
net spindle-enable <= motion.spindle-on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm

setp pwmgen.0.pwm-freq 50.0
setp pwmgen.0.scale 2000.0
setp pwmgen.0.offset 0.0
setp pwmgen.0.dither-pwm true
net spindle-cw <= motion.spindle-forward

I was kind of lazy and use 3 M codes structured like this in files M100 to M102
!/bin/bash
# file to set gear 1 0-1200RPM
halcmd setp scale.1.gain 1.55;
exit 0

I created some soft buttons on the screen modeled over big Johns toolchange buttons
<labelframe text="Gear Change">
<font>("Helvetica",16)</font>
<hbox>
<button>
<halpin>"gear-1"</halpin>
<text>"G1"</text>
<bd>3</bd>
</button>
<button>
<halpin>"gear-2"</halpin>
<text>"G2"</text>
<bd>3</bd>
</button>
<button>
<halpin>"gear-3"</halpin>
<text>"G3"</text>
<bd>3</bd>
</button>
</hbox>

</labelframe>

and added the gear change command to the machine.ini
[HALUI]
# add halui MDI commands here (max 64)
MDI_COMMAND = T1 M6 G43
MDI_COMMAND = T2 M6 G43
MDI_COMMAND = T3 M6 G43
MDI_COMMAND = T4 M6 G43
MDI_COMMAND = T5 M6 G43
MDI_COMMAND = T6 M6 G43
MDI_COMMAND = M100
MDI_COMMAND = M101
MDI_COMMAND = M102

IT WORKS!
thanks

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

More
26 Feb 2012 18:54 #18104 by chuck1024
Replied by chuck1024 on topic Re:configuring gearchange
I found a simpler solution.

I removed the scale element show in the previous post and put

halcmd setp pwmgen.scale1200 in M100 file
halcmd setp pwmgen.scale 2000 in M101 file
halcmd setp pwmgen.scale 3000 in M102 file

Now when I change belt positions, I just click on the right gear button and the pwmgen scale
is changed so that S word generate the correct speed.

All three M commands could be combined in one file as shown by the link, but I like to start simple.

Life is good. Smile!
chuck

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

More
10 Jul 2012 15:45 #21747 by LAIR82
Replied by LAIR82 on topic Re:configuring gearchange
After following the posts about the gearchange option, I am not sure where I connect my gear input to let the gearchange function work, I have set up an M141/M142 command to shift the transmission and have a pressure switch on both speeds to let me know it is in its respective gear, and I think i need to connect to the gearchange.0.sel input but am not sure how, I assume it is a net command of some sort.


I hope I am not repeating anyone elses questions, I am just extremely green when it comes to this software, but am picking it up quickly as I go along.


Thanks

Rick

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

More
10 Jul 2012 16:51 #21755 by andypugh
Replied by andypugh on topic Re:configuring gearchange
LAIR82 wrote:

After following the posts about the gearchange option, I am not sure where I connect my gear input to let the gearchange function work, I have set up an M141/M142 command to shift the transmission and have a pressure switch on both speeds to let me know it is in its respective gear, and I think i need to connect to the gearchange.0.sel input but am not sure how, I assume it is a net command of some sort.


I think gearchange only pays any attention to one switch (probably on the high gear) so it would be:

net high-gear-selected parport.0.pin-NN-in => gearchange.0.sel

Assuming you are using a parport, and of course the NN needs to be an actual number.

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

More
11 Jul 2012 15:12 #21790 by LAIR82
Replied by LAIR82 on topic Re:configuring gearchange
Worked great.

Thanks

Rick

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

More
10 Jun 2013 22:38 #35487 by viski
Replied by viski on topic configuring gearchange
Have you tryed constant surface speed? Does it automaticaly gear change?

I have two speed and electronic coupling gear change and i would like to do it automaticaly when in constant surface speed .

High gear 1:1 = 1000 rpm, lower gear 1:5 = 200 rpm

How to automaticaly change scale from 200 to 1000 ?

Regards

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

Time to create page: 0.100 seconds
Powered by Kunena Forum