Representing a table full of numbers by 4 circles How ?

Beginner

Well-known member
Joined
Mar 12, 2008
Messages
114
Programming Experience
Beginner
As in first Picture I'll have to generate a code
to make a fixed invisible colum

For i = 0 to 360
Step 5


2000545622320924840_rs.jpg


Then Each time it itterates the value gets multiplied by Pi and divided by 180

and stored in a similar way like excel.


2000584877178128910_rs.jpg


As for the third Picture weve got 4 circles
Pitch
base
Outer
Root
and each one has X, Y

Equations are the same for all 4 circles
the only thing that differs is that.
For example lets consider the Base Circle as shown in 3d picture.
X1 = Base Circle value ( same one used for Y) * Cos ( The stored value from the second picture)
X2 = ......
X360 = .....

Y1 = Base Circle Value * Sin ( The stored Value from the second Picture)
Y2=.....
Y360=......


The remaining three construction circles are built in the same concept but the same concept and same equation but the only one difference is the for pitch circle we use the value from the table of pitch
in Root we use the value assigned for root and so on.

Once weve got the code for all 4 circles. we can draw the circle as a representation of that table.

2000586479785060223_rs.jpg




Any help would be welcomed :)
 
Once weve got the code for all 4 circles. we can draw the circle as a representation of that table.

If I understand you correctly, you are creating a set of points that effectively draw a circle. If that's the case, you dont need to do any of this in VB.NET - you just have to supply the circle centre and diameter/radius values that you appear to already have.

If you really want to do it using points, let us know and I'll post some code that will "point" you in right direction :D
 
The more points i use the more accurate my profile will be.

VB.NET:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Make your arrays
        Dim BaseX(72) As Double
        Dim BaseY(72) As Double
        Dim PitchX(72) As Double
        Dim PitchY(72) As Double
        Dim RootX(72) As Double
        Dim RootY(72) As Double
        Dim OuterX(72) As Double
        Dim OuterY(72) As Double

        'You're filling in these 4 from your other form.
        Dim Rbg_mm As Double
        Dim Rpg_mm As Double
        Dim Rrg_mm As Double
        Dim Rog_mm As Double

        'These are temporary variables to make the calculations easier.
        Dim dblSinTemp As Double
        Dim dblCosTemp As Double
        For i As Integer = 0 To 360 Step 5
            dblSinTemp = Math.Sin((i * Math.PI) / 180.0)
            dblCosTemp = Math.Cos((i * Math.PI) / 180.0)
            BaseX(i \ 5) = Rbg_mm * dblCosTemp
            BaseY(i \ 5) = Rbg_mm * dblSinTemp
            PitchX(i \ 5) = Rpg_mm * dblCosTemp
            PitchY(i \ 5) = Rpg_mm * dblSinTemp
            RootX(i \ 5) = Rrg_mm * dblCosTemp
            RootY(i \ 5) = Rrg_mm * dblSinTemp
            OuterX(i \ 5) = Rog_mm * dblCosTemp
            OuterY(i \ 5) = Rog_mm * dblSinTemp
        Next

        'That's it.  

    End Sub
End Class
 
The more points i use the more accurate my profile will be.

Only if you are drawing it as a set of points. It's a circle, so draw it as a circle - it saves doing ALL the calculations :D
 
VB.NET:
    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

        Dim RadiusBase As Single = 119.341
        Dim RadiusPitch As Single = 127
        Dim RadiusRoot As Single = 119.0625
        Dim RadiusOuter As Single = 133.35

        Dim WhatScale As Single = 2.0

        With e.Graphics
            .ScaleTransform(WhatScale, WhatScale)
            .TranslateTransform(150, 150)

            .DrawEllipse(New Pen(Color.Black, 1 / WhatScale), 0 - RadiusBase, 0 - RadiusBase, RadiusBase * 2, RadiusBase * 2)
            .DrawEllipse(New Pen(Color.Red, 1 / WhatScale), 0 - RadiusPitch, 0 - RadiusPitch, RadiusPitch * 2, RadiusPitch * 2)
            .DrawEllipse(New Pen(Color.Green, 1 / WhatScale), 0 - RadiusRoot, 0 - RadiusRoot, RadiusRoot * 2, RadiusRoot * 2)
            .DrawEllipse(New Pen(Color.Blue, 1 / WhatScale), 0 - RadiusOuter, 0 - RadiusOuter, RadiusOuter * 2, RadiusOuter * 2)
        End With
    End Sub
 
Beginner - I've just looked through all your posts (including on the other forums).

What formula do you use for defining the points of the apex and base of the tooth - for example, where the "Roll Angle to outside Diameter" perpendicular line meets the Outside circle depending on how many teeth there are?

Image showing tooth diagram

(BTW - I have 10 years experience of parametric programming of CNC routers :D)
 
Last edited:
Beginner - I looked through your code, and I think you're heading in the wrong direction. On that basis, I have re-written the code for you :)

Before I attach it, I would like you to look through this post about custom classes. It will give you an understanding as to why I felt it necessary to re-write it.

Let me know when you'd like it attached :D
 
Hello buddy how r ya ? been a while. 90% done. A couple of things to do and BTW heres my excel file:
http://www.zshare.net/download/85156640d56348

2006197942429932330_rs.jpg


2006148200319099889_rs.jpg


2006197942429932330_rs.jpg


2006175070027503269_rs.jpg




Random CNC Header code


BEGIN PGM FILENAE MM
BLK FORM 0.1 Z X+0 Y+0 Z – 40
BLK FORM 0.2 X+100 Y+100 Z+0
TOOL DEF 2 L+0 R+7
TOOL CALL 2 Z S1000
L M6
X+30 Y+30 R0 F100 M3
L Z+5 F 100
L Z-5 F 100
L Z+100 R0 F 100 M5
END PGM FILENAME MM


(BTW - I have 10 years experience of parametric programming of CNC routers :D)

I want to get equations regarding the optimization Process. What i really want to say in the Input Machining Parameters which i'll probably move to the CNC Code page.

For example when wood is selected I get this spindle speed and this tool diameter etc ,,, Similarly when steel or any other material is selected. I dont know any equations on how to do that may you tell me how are the input machining parameters selected for different material ?

All i know so far to obtain those two lines
BLK FORM 0.1 Z X+0 Y+0 Z – 40
BLK FORM 0.2 X+100 Y+100 Z+0
is this :

INPUT: Datum X....Y...Z

INPUT: Workpiece Length...Width...Height

1st line:
BLK FORM 0.1 Z X+0 Y+0 Z 40
X = Datum X, Y = Datum Y, Z = -(workpiece height+Datum Z)
2nd line:
BLK FORM 0.2 X+100 Y+100 Z+0
X= Datum X+workpiece length, Y= Datum Y+workpiece width
 
Back
Top