Steve,
Here is the diff -
--- gear4_cinci.comp 2008-05-29 07:45:52.000000000 -0500
+++ gear4_GL.comp 2008-06-03 16:20:01.000000000 -0500
@@ -1,6 +1,6 @@
-component gear4_cinci "Select gear range from requested spindle speed";
+component gear4_GL "Select gear range from requested spindle speed";
/* This component if for a 4 speed gearbox with a separate tram shifter.
- This has 5 solenoids to shift the gears and 4 limit switches to
indicate the gearbox state. Tram state is not indicated by limit
switch
+ This has 6 solenoids to shift the gears and 4 limit switches to
indicate the gearbox state. Tram state is not indicated by limit
switch
It will sense the spindle speed near zero from the encoder
feedback and inhibit the shifting until the spindle is slow enough.
* It will drive the spindle very slow to allow the gears to mesh.
*/
@@ -15,21 +15,24 @@
pin in float shiftspeed "spindle speed to be considered zero for tram
and gear shifting";
pin in float gain "numerator of voltage ratio";
-pin in bit ls31 "solenoid 31 limit switch";
-pin in bit ls32 "solenoid 32 limit switch";
-pin in bit ls33 "solenoid 33 limit switch";
-pin in bit ls34 "solenoid 34 limit switch";
+pin in bit ls1 "solenoid 1 limit switch";
+pin in bit ls2 "solenoid 2 limit switch";
+pin in bit ls3 "solenoid 3 limit switch";
+pin in bit ls4 "solenoid 4 limit switch";
+pin in bit ls5 "solenoid 5 limit switch";
+pin in bit ls6 "solenoid 6 limit switch";
+pin in bit spinzero "spindle at zero";
pin in bit tram "tram select input";
pin in bit tramallow "allow tram - connect to motion.spindle-brake output";
pin out float spinon "spindle speed command to VFD";
pin out float feedadapt "adjust feed for spindle speed";
-pin out bit sol31 "shifting solenoid";
-pin out bit sol32 "shifting solenoid";
-pin out bit sol33 "tram solenoid";
-pin out bit sol34 "shifting solenoid";
-pin out bit sol35 "shifting solenoid";
-
+pin out bit sol1 "shifting solenoid";
+pin out bit sol2 "shifting solenoid";
+pin out bit sol3 "shifting solenoid";
+pin out bit sol4 "shifting solenoid";
+pin out bit sol5 "tram on";
+pin out bit sol6 "tram off";
function _;
license "GPL";
;;
@@ -41,14 +44,17 @@
if (tram && tramallow) {
Scale = 0.0;
spinon = 0.0;
- if (abs(spinspeed) < shiftspeed) {
- sol33 = 1;
+ if (spinzero) {
+ sol5 = 1;
+ sol6 = 0;
feedadapt = 1;
} else {
- sol33 = 0;
+ sol5 = 0;
+ sol6 = 1;
}
} else {
- sol33 = 0;
+ sol5 = 0;
+ sol6 = 1;
// set desired gear ////////////////////
if (abs(spincmd) >= minspeed && abs(spincmd) <= gear4max) {
if (abs(spincmd) <= gear1max) {
@@ -67,37 +73,41 @@
if (CurrentGear != Gear) {
InGear = 0;
// shift gears
- if (abs(spinspeed) < shiftspeed) {
+ if (spinzero) {
switch (Gear) {
case 0:
break;
case 1:
-
sol31=1;
- sol32=0;
- sol33=0;
- sol34=1;
- sol35=0;
+
sol1=0;
+ sol2=1;
+ sol3=0;
+ sol4=1;
+ sol5=0;
+ sol6=1;
break;
case 2:
-
sol31=1;
- sol32=0;
- sol33=0;
- sol34=0;
- sol35=1;
+
sol1=1;
+ sol2=0;
+ sol3=0;
+ sol4=1;
+ sol5=0;
+ sol6=1;
break;
case 3:
-
sol31=0;
- sol32=1;
- sol33=0;
- sol34=1;
- sol35=0;
+
sol1=0;
+ sol2=1;
+ sol3=1;
+ sol4=0;
+ sol5=0;
+ sol6=1;
break;
case 4:
-
sol31=0;
- sol32=1;
- sol33=0;
- sol34=0;
- sol35=1;
+
sol1=1;
+ sol2=0;
+ sol3=1;
+ sol4=0;
+ sol5=0;
+ sol6=1;
break;
case 5:
Scale = 0.0;
@@ -106,17 +116,17 @@
} else {
}
//////////////////////////////////////////
- if (Gear == 1 && ls31 &&
ls33 && !sol33) {
- Scale = 15.2;
+ if (Gear == 1 && ls2 && ls4
&& !sol5 && sol6) {
+ Scale = 48.233695652;
InGear = 1;
- } else if (Gear == 2 && ls31 &&
ls34 && !sol33) {
- Scale = 8.0;
+ } else if (Gear == 2 && ls1 && ls4
&& !sol5 && sol6) {
+ Scale = 19.293478261;
InGear = 1;
- } else if (Gear == 3 && ls32 &&
ls33 && !sol33) {
- Scale = 1.9;
+ } else if (Gear == 3 && ls2 && ls3
&& !sol5 && sol6) {
+ Scale = 7.717391304;
InGear = 1;
- } else if (Gear == 4 && ls32 &&
ls34 && !sol33) {
- Scale = 1.0;
+ } else if (Gear == 4 && ls1 && ls4
&& !sol5 && sol6) {
+ Scale = 3.086956522;
InGear = 1;
} else {
InGear = 0;
@@ -125,11 +135,11 @@
}
//////////////////////////////////////////
if (InGear && !tramallow) {
- spinon = spincmd * Scale * gain / gear4max;
+ spinon = abs(spincmd) * Scale * gain / gear4max;
CurrentGear = Gear;
- if (spincmd == 0 &&
abs(spinspeed) >= shiftspeed) {
+ if (spincmd == 0 && !spinzero) {
feedadapt = 0;
- } else if (spincmd ==
0 && abs(spinspeed) < shiftspeed) {
+ } else if (spincmd ==
0 && spinzero) {
feedadapt = 1;
} else {
feedadapt =
spinspeed / spincmd;
s
thanks
Stuart
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users