spindle with encoder

More
1 year 6 months ago #326237 by vre
spindle with encoder was created by vre
I have a spindle that has motor pulley belt pulley
after has a geartrain with 2 positions-speeds.
I want to mount encoder to second pulley shaft before geartrain.
Iam confused how to set ini file values
max_speed min_speed encoder_scale output_scale etc


 

Please Log in to join the conversation.

More
1 year 6 months ago #326320 by vre
Replied by vre on topic spindle with encoder
Motor has inverter that controls rpm of motor via -10V+10V analog signal (mesa 7i33 card).
No can't remove the geartrain. I need encoder for rigid taping.
My problem is how to configure because it is not easy to mount encoder on spindle
shaft must mount it before geartrain of spindle so before 2 selectable speeds reduction is done.
So the problem is that motor has X rpm, encoder has a*X rpm and spindle has b*X rpm or c*X rpm.
What must put in ini file spindle section ?
Code:
MAX_OUTPUT = ? ENCODER_SCALE = ? OUTPUT_SCALE = ? OUTPUT_MIN_LIMIT = ? OUTPUT_MAX_LIMIT = ?

Please Log in to join the conversation.

More
1 year 6 months ago #326321 by JohnnyCNC
Replied by JohnnyCNC on topic spindle with encoder
If you can squeeze a disc with a notch in it somewhere you can use a slotted optical sensor.  This is my setup and rigid tapping works great.

 

Attachment not found


 

Please Log in to join the conversation.

More
1 year 6 months ago #326324 by vre
Replied by vre on topic spindle with encoder
I will do rigid taping in slow gears speed..
For 2 speeds selection i will use this hal file
Code:
#M64 and M65 digital outputs net sp-shift-high motion.digital-out-12 mesacard_pin net sp-shift-low motion.digital-out-13 mesacard_pin #M66 Digital Inputs net spindle-stoped motion.digital-in-09 mesacard_pin net sp-is-high motion.digital-in-12 mesacard_pin net sp-is-low motion.digital-in-13 mesacard_pin

and this function
Code:
;Erik Salo January 2018 ;Okada VM500 Spindle Gearchange program LinuxCNC ;Two speed gearbox. Selects proper range for commanded speed ;Stops spindle prior to gear change ;Special handling for zero, don;t shift down for zero command if in high speed ;Two sensors, one for high and one for low ;Two hydraulic solenoids high and low, turnsoff unselected solenoid o<setspeed> sub o300 IF [#<speed> GT 1250] ;Check to see if speed selected is too high o010 IF [#<speed> GT 5001] (abort, Speed exceeds rated rpm) o010 ENDIF M66 P12 ;Check if High Gear = True o301 if [#5399 GT 0] M66 P13 ;Make sure Low Gear = False o302 if [#5399 GT 0] (abort, spindle still in low gear) o302 endif S#<speed> ;Set spindle speed with no scaling factor o301 endif M66 P13 ;Check if Low Gear = True o305 if [#5399 GT 0] M66 P12 ;Make sure High Gear = False o306 if (#5399 GT 0] (abort, spindle still in high gear) o306 endif S0 ; Stop spindle M66 P9 L3 Q4 ;Check for spindle stopped - wait up to 4 seconds for digital input 9 to turn on o307 if [#5399 LT 0] (abort, spindle not stopped) o307 endif M65 P13 ; Turn off low gear shift solenoid M64 P12 ; Turn on high gear shift solenoid M66 P13 L4 Q4 ;Wait for Low Gear = False o308 if [#5399 GT 0] (abort, spindle still in low gear) o308 endif M66 P12 L3 Q4 ;Wait for High Gear = True o310 if [#5399 LT 0] (abort, spindle not in high gear) o310 endif S#<speed> ;Set spindle speed with no scaling factor o305 endif o300 ENDIF ;Low Gear Section o400 IF [#<speed> LT 1250.1] ;Check if requested speed is less than 1250 o410 IF [4<speed> GT 0.1] Check to see if requested speed is greater than 0.1 M66 P13 ;Check if Low Gear = True o420 if (#5399 GT 0] M66 P12 ;Make sure High Gear = False o421 if [#5399 GT 0] (abort, spindle still in high gear) o421 endif S[#<speed>*2.56] ;Set spindle speed with 4x scaling factor o420 endif M66 P12 ;Check if High Gear = True o430 if [#5399 GT 0] M66 P13 ;Make sure Low Gear = False o431 if (#5399 GT 0] (abort, spindle still in high gear) o431 endif S0 ; Stop spindle M66 P9 L3 Q5 ;Check for spindle stopped o432 if [#5399 LT 0] (abort, spindle not stopped) o432 endif M65 P12 ; Turn off high gear shift solenoid M64 P13 ; Turn on low gear shift solenoid M66 P12 L4 Q4 ;Wait for High Gear = False o433 if (#5399 GT 0] (abort, spindle still in low gear) o433 endif M66 P13 L3 Q4 ;Wait for Low Gear = True o434 if (#5399 LT 0] (abort, spindle not in high gear) o434 endif S[#<speed>*2.56] ;Set spindle speed with 4x scaling factor o430 endif o410 endif o450 IF [#<speed> EQ 0] S0 ; Set spindle speed to zero o450 ENDIF o400 ENDIF o<setspeed> endsub [1]

How can set also encoder for rigid tapping ?

Please Log in to join the conversation.

More
1 year 6 months ago #326329 by JohnnyCNC
Replied by JohnnyCNC on topic spindle with encoder
My top spindle speed is 5400 RPM and that plate is .032" aluminum. If it does cause vibrations, they are too small for me to notice.

Please Log in to join the conversation.

More
1 year 6 months ago #326397 by vre
Replied by vre on topic spindle with encoder
more notches are better but how can i set encoder
if encoder can only positioned before geartrain ?

Please Log in to join the conversation.

More
1 year 6 months ago #326413 by JohnnyCNC
Replied by JohnnyCNC on topic spindle with encoder
Hold on a second. I lied. Not intentionally. My spindle motor is a DYN4 servo motor geared 1:1.8 and it has a simulated encoder signal generated by the servo driver. That is the signal I am using for the coordination for rigid tapping. The sensor on the slotted plate it just for measuring RPM.
It's been a few years since I set this up and when you mentioned more slots I thought "I knew that, why didn't I do that?" Then I looked deeper and remembered how it really works.

To actually do this with a slotted plate and sensors you would want more slots and two sensors. Read up on how quadrature encoders work.

As long as you know the ratio between the spindle and encoder you can make almost any arrangement work.

These are my .ini settings.
[SPINDLE_0]
P = 2.0
I = 4.0
D = 0.0
FF0 = 1.08
FF1 = 0.0
FF2 = 0.0
BIAS = 0.0
DEADBAND = 0.0
OUTPUT_MIN_LIMIT = -5400.0
OUTPUT_MAX_LIMIT = 5400.0
OUTPUT_SCALE = -10800
ENCODER_SCALE = 4551.111111
#((2048 * 4) / 1.8) = 4551.111111
#The maximum spindle speed (in rpm)
MAX_FORWARD_VELOCITY = 5400
#The minimum spindle speed (in rpm)
MIN_FORWARD_VELOCITY = 50
#This setting will default to MAX_FORWARD_VELOCITY if omitted.
MAX_REVERSE_VELOCITY = 5400
#The minimum spindle speed (in rpm)default to MIN_FORWARD_VELOCITY if omitted.
MIN_REVERSE_VELOCITY = 50

Sorry for the confusion. I hope this helps.

Please Log in to join the conversation.

More
1 year 6 months ago #326415 by vre
Replied by vre on topic spindle with encoder
This helps..
What is OUTPUT_SCALE = -10800 ?
This config is for fixed motor:spindle transmition ratio.
I have 2 selectable speeds after encoder-motor
These 2 speeds are selected by hydraulic electrovalve that switches gears
position 1 max rpm is 760rpm and position 2 max rpm 3060

Please Log in to join the conversation.

More
1 year 6 months ago #326495 by JohnnyCNC
Replied by JohnnyCNC on topic spindle with encoder
I'm not really sure exactly what is does, but this is where it is used in my hal file.
It looks like it is set to -10800 because 5400 to -5400 is -10800.

# ---Analog output signals/setup---
setp hm2_7i76e.0.7i83.0.1.analogout5-scalemax [SPINDLE_0]OUTPUT_SCALE
setp hm2_7i76e.0.7i83.0.1.analogout5-minlim [SPINDLE_0]OUTPUT_MIN_LIMIT
setp hm2_7i76e.0.7i83.0.1.analogout5-maxlim [SPINDLE_0]OUTPUT_MAX_LIMIT
net spindle-output => hm2_7i76e.0.7i83.0.1.analogout5

Please Log in to join the conversation.

More
1 year 6 months ago #326585 by andypugh
Replied by andypugh on topic spindle with encoder
Note that unless the index pulse is from the spindle shaft, or the gear ratio is exactly 1:1, you can't peck-tap with the encoder on the motor shaft. This probably isn't a problem in most cases, but is worth being aware of.

Please Log in to join the conversation.

Time to create page: 0.407 seconds
Powered by Kunena Forum