Hello Guest it is February 25, 2020, 04:33:39 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Fleck

Pages: 1 2 3 4 »

 opposite = adjacent * (((Sin(angleOpposite) *180 / (4 * Atn(1) / (Sin(angleAdjacent)* 180 / (4 * Atn(1))))

Trying to come up with working code to find length of opposite side of triangle. Works on calculator just cant get code correct.

What I have that is not working:

 opposite = adjacent * (((Sin(angleOpposite) * Atn(X / Sqr(-X * X + 1) / (Sin(angleAdjacent)* Atn(X / Sqr(-X * X + 1)))

Any help is appreciated

 this seems to work well.

Degrees = Degreesperloop
Degreesperloop = (360 / Degreesperloop)
Dim Countdown
Dim i,j

For i = 1 To  Degreesperloop

Degreeincrement = Degrees + Degreeincrement 'get degree input
Code "G01 A" & Degreeincrement & "F500"

For j = 1 To Cutnumber
IStock = Cutdepth-IStock
IStock = IStock * -1
Call SetUserDRO(1232,IStock)
IStock = GetUserDRO(1232)
While IsMoving ()

YEndcorrect = IStock - Partoff
Code "G01 Y" & Leadin &"F" & CutEngageFeed 'Tool Entry
Code "Y0" & "Z" & IStock 
Code "G01 Y" & Blanklength & "Z" & YEndcorrect &"F" & Roughfeed'Tool Pass
Code "G0 Y" & LeadIn & "Z" & GetUserDRO(1232) + Retract'Tool Retract

While IsMoving ()

Next j

IStock = (Stock-Finishdiameter)+Finishpass

While IsMoving ()

Next i

While IsMoving ()

 I am trying to write a boxing loop for Lathe type tool passes with a router to a A axis spindle.  I am used to a different scripter and would have used a While, Do, End While.
 I am reading the material and trying to figure this out with no real programming experience so I am sure its a mess. The Macro is either blowing through the code or infinite looping .

 Any info is appreciated.
 Also wondering, is declaring a As Double the same as declaring a Real number?

Dim Blanklength, Finishdiameter, Stock
Dim Roughfeed, Finishfeed
Dim Cutdepth
Dim Cutnumber
Dim XProgramlo,YProgramlo,ZProgramlo,AProgramlo
Dim XAbsolo, YAbsolo, ZAbsolo, AAbsolo
Dim Finishpass
Dim Retract
Dim IStock
Dim IFinishdiameter

Blanklength = GetUserDRO(1226)*-.1'get blank length input
Stock = GetUserDRO(1227)/2'get stock input
Finishdiameter = GetUserDRO(1229)/2'get blank diameter input
Roughfeed = GetUserDRO(818)'get Roughfeed length input
Finishfeed = GetUserDRO(818/2)'Get Finishfeed length Input
Cutnumber = GetUserDRO(1228)'get full cut depth
XProgramlo = GetDRO(83)'Current G54 X location
YProgramlo = GetDRO(84)'Current G54 Y location
ZProgramlo = GetDRO(85)'Current G54 Z location
AProgramlo = GetDRO(86)'Current G54 A location
XAbsolo = GetDRO(0)'Current G53 X location
YAbsolo = GetDRO(1)'Current G53 Y location
ZAbsolo = GetDRO(2)'Current G53 Z location
AAbsolo = GetDRO(3)'Current G53 A location
Cutdepth = SetUserDRO(1225,(Stock-Finishdiameter)/Cutnumber)
Finishpass = GetUserDRO(1230)'get finish pass depth
Retract = GetUserDRO(1231)'get retract distance
Cutdepth = GetUserDRO(1225)  
IStock = SetUserDRO(1232,(Stock-Finishdiameter))
Code "G90"
Code "M03"
While IsMoving ()
Code "G0 Y" & YProgramlo '& "X" & XProgramlo'Rapid to Program X and Y zero
Code "G0 Z" & Stock +.01'Rapid to tenth inch above rough stock  
Code "G52 Z" & Finishdiameter'Zero offset
While IsMoving ()

Do While IStock >= (0)
Code "G01Z" & Cutdepth & Roughfeed'Tool Entry
Code "G01Y" & Blanklength'Tool Pass
Code "G0Z" & Retract'Tool Retract
Code "G0 Y0"
IStock = GetUserDRO(1232)
IStock = SetUserDRO(1232,(IStock*1)-Cutdepth)

Code"G53 Z0"
Code "G52 Z0"
Code "M05"
Code "M30"      

General Mach Discussion / Re: Mach3 Sherline Rotary Magic Number
« on: June 21, 2014, 04:21:53 PM »
I may be wrong but I believe steps per for angular is. Steps*microsteps*Gear Ratio/360

 OK everything is doing what it should. This is cumulative build up of units/degrees. So motor needs to rotate from G01A-2306.667F150 to G01A360.0F150. I could enable Rot 360 Rollover and not ever go past 360° but then the code does not work.

 I am trying to rough simple blanks for a second op. lathe with multiple passes. Is there a good way to code this with angular settings?

Trying to learn A axis programming. I have just installed a second parallel  port built a G540 with power supply and activated A axis pins and ports. My motor is  200steps per rev.* 10microsteps per rev.*2 "for 2 to 1 gear ratio, 30 teeth headstock 15 teeth stepper"/360°= Steps per 11.1111 Motor Tuning

All seems to be working in MDI code input have not checked with indicator but 360° and 0° are 12:00 180° is 6:00 etc..., but when I run this code the "G01 A360.0 F150"  is over rotating by many times before continuing to next line.

 I have "use radius for feedrate", "A-rotations enabled" in Config/Toolpath, "A axis is angular", "Ang Short Rot on G0"Config/General Config, "Rotation Radius A.0010" Settings Alt-6

 Here is my troubled code.

G01A360.0F150 Over rotates by multiple full revolutions
 Any info is appreciated

Hi my name is Mike I am from Alaska
   I have been lurking on and off since 2010. This site has been a boon. I am working with a Sherline lathe, K2 gantry router with a 4th axis I just made, I am trying to figure it out and a OmniTurn GT75. I make guitar parts and guitars.

General Mach Discussion / 2 controllers, 2nd for 4th axis
« on: October 09, 2013, 02:42:43 AM »
I just upgraded my Lathe and have a extra controller. I have rewired the DB 25 connector to match Mach pin configuration to controller. I have moved the new controller "A axis" to Port 1 a known working port.  Moved my servos to new PCI parallel port 2. Router works well but I am not having success with the "A axis" stepper motor.  When I measure DC Voltage on step/Dir pin to pin 14 I get 4 V in one direction and 0 in the other.  Motor makes an initial step every now and then when jogged but stops.
 Thanks in advance for any advice.

General Mach Discussion / Re: G92 for a drifting offset?
« on: October 06, 2013, 03:20:19 AM »
Machine is good. I am just a bit obsessed with writing a macro in which part size data can be input and offsets are calculated IF off.

Pages: 1 2 3 4 »