Gearchange component with gear 1 as high gear

More
15 Oct 2018 19:34 #118841 by blazini36
I just started rigid tapping which works well but I need to do some work arounds until I get LinuxCNC setup properly for it. I have an encoder on the BLDC spindle motor. "High gear" is the 1:1 with pulley ratio which I use almost exclusively except I must swap to low range to rigid tap which I set the 1:2 pulley.

For now, I've been finagling the Gcode to make this work. I set the spindle speed to double what I want it to run at and set the pitch for 1/2. For example, If I wanted to tap 5/16-18 @ 300rpm It would be:

S300
G33.1 Z-0.7500 K0.056

The work around is

S600
G33.1 Z-0.7500 K0.028

I wanted to use the Gearchange component to change the speed ratio when I swap belts. The problem is that Gearchange wants to assume that gear2 is higher than gear1. I have a 1000PPR encoder on the motor (x4) so the only thing I can think to to is make gear1 the 1:2 gear and gear2 the 1:1 gear. In this case I would have to change the hm2 encoder scale from 4000 to 8000 then set the gearchange.0.scale2 to 2 to get the velocity correct.

Does this sound right or is there an easier way to do this?

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

More
15 Oct 2018 20:32 #118844 by blazini36
Actually the above won't work since the Hm2 encoder scale can't be changed or the motor revs themselves won't be correct.

The only thing I can think of at the moment is to add a scale component in prior to the gearchange speed-in pin. Scaling the speed in to .5 would result in the gearchange seeing the low gear as 1/2 the speed of the motor and with the gearchange.0.scale2 pin set to 2 it will see high gear as the same speed of the motor. Still wondering if there is a better way to do this.

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

More
15 Oct 2018 21:52 #118850 by blazini36
Hmm actually I've been testing it and either I am misunderstanding the way the docs are worded or it's worded incorrectly. That or it's making an assumption that the feedback is at the spindle and the component is scaling feedback to the motor down.

I tried it as above with the extra scale component set at .5 and it resulted in all feedback being half of what was expected. With the extra scale set at 1 it was correct meaning that the scale was unnecessary.

So as of right now it works out of the box with the gerchange.0.scale2 set to 2 and the low gear reports back half the spindle speed the high gear does at the same motor rpm. In this scenario I suppose the component only works with a "low" gear which is the opposite of the docs which say it only works with a "high" gear.

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

More
15 Oct 2018 23:14 #118856 by blazini36
New problem (besides me constantly replying to my own thread lol)

I still have to split the pitch in half in gcode for the spindle synchronized tapping. I'm thinking this is because even though the encoder velocity is scaled with the gearchange component the encoder position is not. I'm thinking I should scale the position as well when low gear is selected.

I'm not sure how to handle this at the moment. Position will need scaling as well when low gear is selected.

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

More
18 Oct 2018 22:00 #119023 by andypugh
Where is the encoder?

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

More
18 Oct 2018 23:49 #119035 by blazini36
Encoder is on the spindle motor.

I haven't gotten a chance to test rigid tapping yet but I used a second instance of the gearchange component to scale the spindle position as well. I can't VNC into the mill at the moment to see exactly what I did in hal because it's running some parts but IIRC this is what I did:

I added a radio button to Gmoccapy for spindle high/low gear, as well as a button to turn the spindle monitor component off (the current pid takes a moment to catch up. High range is 1:1 so the gearchange.select pins go false. When low gear is selected gearchange.vel.select and gearchange.pos.sel are true. gearchange.speed-out pins are connected to the motion pins. Gearchange.scale2 is set to 2. Encoder position to BLDC is unchanged (using an 8i20 for spindle control)

I figure the velocity and position floats will be split in half when in low gear which should make motion happy with spindle syncronized moves. Any thoughts how this might work?

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

More
19 Oct 2018 01:00 #119043 by andypugh
It would be a good idea to move at least the index sensor to the actual tool spindle.

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

More
19 Oct 2018 03:22 #119049 by blazini36
I had to think about that for a moment...

The index is built into the motor encoder. I hadn't considered the index until you mentioned it. Is this because when the index-enable pin goes true the position is reset on the next index pulse? the spindle motor stalls well before belt slip so I'm not concerned about that.

I actually have a component that was written specifically to handle counting an index then resetting on the count. It was written for a completely different application and that application became too complicated for the component so I wrote a whole convoluted hal file for that. The component can skip the 1st encoder pulse and set a pin high on the 2nd. That should synk the spindle well enough for rigid tapping. If it doesn't work I'll slap a good NPN proximity switch on something in the spindle.

That'd almost be a good idea for a component. Basically merge 2 gearchange components with my index component and you'd probably have a good way of keeping a synchronized spindle with just the encoder from a spindle servo.

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

More
19 Oct 2018 09:29 #119062 by andypugh

I hadn't considered the index until you mentioned it. Is this because when the index-enable pin goes true the position is reset on the next index pulse? the spindle motor stalls well before belt slip so I'm not concerned about that.


The tapping cycle starts when the system sees the encoder index. If you want to do peck-tapping then you need the index to always be in same place relative to the tap.

Whatever encoder you are using won't care if the index pulse comes from the encoder on the motor or from some other sensor somewhere else, so triggering a proximity sensor from a keyway or an opto from a slot or any number of other ways will work well.

The index is only really important for multi-pass spindle-synch moves (it is critical for lathe threading) but if you wanted to use spindle-orient for a tool changer it would also be important.

is your belt drive by toothed belt? If it isn't a synchronous belt with an exact ratio then you might have problems tapping deep holes.
Is it even exactly 2:1? Typically ratios like that are set up with a "hunting tooth"

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

More
19 Oct 2018 17:15 #119082 by blazini36
My spindle uses a micro-v belt, it's like a small serpentine belt. It doesn't slip and I'm fairly certain that it is 1:1 and 2:1 exactly. The mill originally comes with a tach in the spindle and switching the belt always netted 1/2 the speed at the spindle for the same motor speed.

I kind of want to use the index component just to say I did but you're right, the index on the spindle would obviously be more accurate. Even if the pulleys are exact ratios I'm sure the spindle would drift away from the motor slightly. The MicroV belt is super quiet compared to a timing belt, otherwise I think switching to a timing set this should work pretty well.

I haven't needed multi pass or peck tapping yet. I didn't even think I'd be using single pass rigid tapping until I realized that I can't come up with a great way to tap certain holes perfectly straight otherwise. I'm sure it's good to have the option though.

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

Time to create page: 0.082 seconds
Powered by Kunena Forum