2101
General Mach Discussion / Re: Steppers have no torque.
« on: February 05, 2018, 06:05:31 AM »
a first step would be to meassure the voltage,
for Motor supply.
for Motor supply.
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.
Sub Main()
Set objFiles = CreateObject("Excel.Application")
Dim Filename As String
'set default open file folder
ChDrive "C:"
ChDir "C:\Mach3\GCode"
FileName = objFiles.Application.GetOpenFilename("GCodeFiles (*.TAP), *.tap")
If FileName = "False" Then Exit Sub
'find the last "\" in filename
For i = 1 To Len(FileName)
If Mid(FileName,i,1) = "\" Then
last = i
End If
Next i
'extract filename
myfilename = Mid(FileName,last+1,Len(FileName)-last)
'find the extension in filename
For i = 1 To Len(myfilename)
If Mid(myfilename,i,1) = "." Then
last = i
End If
Next i
'seperate filename and extension
blancfilename = Mid(myfilename,1,last-1)
extension = Mid(myfilename,last,Len(FileName)-last)
'open input file
FNumInput = FreeFile 'Determine next file number.
Open FileName For Input As FNumInput
'open output file
FNumOutput = FreeFile 'Determine next file number.
Open "C:\Mach3\GCode\" + blancfilename + "_filtered" + extension For Output As FNumOutput
'go through To hole file
Do While Not EOF(FNumInput)
Line Input #FNumInput, FileData ' Read a line of data.
If InStr(FileData,"G43") = 0 Then
Print #FNumOutput, FileData
Else
Print #FNumOutput, "( " + FileData + " )"
End If
Loop
Close ' Close all open files.
End Sub
'calculate the actual value from laser
'based on (rawvalue * multiplicator) - offset
actmm = GetUserDro(1000) * GetUserDro(1150)
SetUserDro(1151, actmm )
SetUserDro(1154, 1000.0 - actmm -GetUserDro(1153))