Functional overview
Re: Functional overview
Hi YEs... But this wont be relased for a couple days yet...
myser.SendData("xxxxxxxxxx");
Art
myser.SendData("xxxxxxxxxx");
Art
Re: Functional overview
Hi Guys:
Download version of Auggie is updated to 1.43 and includes the new serial class as described..
Art
Download version of Auggie is updated to 1.43 and includes the new serial class as described..
Art
Re: Functional overview
I dont know how to Thank You ...
but now I have to go for 5 days to hospital and they do not like, that i bring my VfD with me :-[.
but now I have to go for 5 days to hospital and they do not like, that i bring my VfD with me :-[.
Regards Michael
Re: Functional overview
Take care, lots of time when you return. :)
Art
Art
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
some question re Serial()
I have the laser licked, time to tackle the RS 485 VfD
I assume creates a serial instance on pin 7 ? is it an input or an output ?
[where is pin 7 on a 57cnc ? but that's another adventure]
the only reference to outputting data I can find is
myser.SendData("data")
so what pin would that use ?
I have the laser licked, time to tackle the RS 485 VfD
Code: Select all
myser = Serial();
myser.Open(7,9600);
[where is pin 7 on a 57cnc ? but that's another adventure]
the only reference to outputting data I can find is
myser.SendData("data")
so what pin would that use ?
Re: Functional overview
Wow, you found serial and are dicking with that? Your not one to be trifled with.
I dont think anyone has hooked a vfd up as yet. But I did make sure the commands worked as
I put them together. Unfortunatley though, thats not a cnc57 command. Its a true serial channel open
on your PC. Thats OK if your close enough I guess and can hook a usb serial channel to your machine,
but there is no serial hookup yet available to the pokeys board that Ive allowed a channel to. Im
afraid Im one of those people that prefrers to control my vfd by hand, so I havent put much into vfd
control..
Art
I dont think anyone has hooked a vfd up as yet. But I did make sure the commands worked as
I put them together. Unfortunatley though, thats not a cnc57 command. Its a true serial channel open
on your PC. Thats OK if your close enough I guess and can hook a usb serial channel to your machine,
but there is no serial hookup yet available to the pokeys board that Ive allowed a channel to. Im
afraid Im one of those people that prefrers to control my vfd by hand, so I havent put much into vfd
control..
Art
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
[I looked for it everywhere with the logic probe ;D]Its a true serial channel open
on your PC.
That's plenty good enough , findings so far
sending these data sets
1,5,3,0x27,0x10,0,crc sets spindle to 6000rpm
1,5,3,0x47,7,0,crc sets spindle to 10000rpm
1,4,3,0,crc will read set freq
1,4,3,1,crc will read actual freq
1,3,1,1,crc will turn spindle on cw
1,3,1,8,crc will turn spindle off
just need to code freq to rpm calc's and dro updates
an a crc routine
the huanyung vfd 485 port is not really Modbus at all ,no real time out constraints or refresh requirements at all. it looks to be quite easy
[famous last words]
Re: Functional overview
Very cool, great to see this :) Excellent development
Are the speeds based on your VFD spindle ranges, or are these values based on some internal data point range?
guess i'm not seeing a linearity
Also, have to assume your running the VFD direct from a usb serial port
1,5,3,0x27,0x10,0,crc sets spindle to 6000rpm
1,5,3,0x47,7,0,crc sets spindle to 10000rpm
Are the speeds based on your VFD spindle ranges, or are these values based on some internal data point range?
guess i'm not seeing a linearity
Also, have to assume your running the VFD direct from a usb serial port
1,5,3,0x27,0x10,0,crc sets spindle to 6000rpm
1,5,3,0x47,7,0,crc sets spindle to 10000rpm
Last edited by Ya-Nvr-No on Tue Jan 03, 2017 3:21 am, edited 1 time in total.
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
it was based on looking at what the mach3 vfd dll sends to the vfd with a logic analyser .Are the speeds based on your VFD spindle ranges, or are these values based on some internal data point range?
guess i'm not seeing a linearity
and I agree the data looks incorrect . I believe the correct result is 55rpm per 1Hz of vfd freq
so :-
0x2710 = 10000 (freq x 100 ) ie 100.00 Hz and is really 5500 rpm
0x4707 = 18183 181.83 Hz 10000 rpm
the vfd display verifies this
correct [elcheapo ebay rs485 stick] I will try it with auggie todayAlso, have to assume your running the VFD direct from a usb serial port
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
fallen at first hurdle,can't figure out how to send a table via serial or infact anything but const ascii string
Code: Select all
// Library Vfd-Spindle
// Created Wednesday, January 04, 2017
// Author rc -- Do not edit above this line
// Enter Global vars below this line.
// the librarian no matter where they are, but its easier
// to find and edit them in one spot.
// vfd stuff
global myser = Serial();
//
//
//
// called from OnEnable
global Vfd_Open = function()
{
myser.Open(6,9600);
print( "VFD opened");
};
//this is a relay spindle control,
//it will use only the OC output #1
//to control a relay to turn a simple
//on/off spindle, on or off.
global SpindleOn = function()
{
data =table();
data[0]=1;
data[1]=3;
data[2]=1;
data[3]=1;
data[4]=0x31;
data[5]=0x88;
//[font=Verdana] this fails[/font]
//myser.SendData(data[0],data[1]);
// [font=Verdana]this works [/font]
myser.SendData("010301013188");
//FreeSetSpeed( MySpindleAxis, GlobalGet("SpindleSpeed")); //turn on spindle
print("Vfd Spindle was turned on");
print("Set to Frequency " + GlobalGet("SpindleSpeed"));
};
//this is a relay spindle control,
//it will use only the OC output #1
//to control a relay to turn a simple
//on/off spindle, on or off.
global SpindleOff = function()
{
//FreeSetSpeed( MySpindleAxis,0); //turn off spindle
print("Spindle speed zeroed");
};
Re: Functional overview
how about something like this
Code: Select all
global myser = Serial();
//global vfd={"0x01,","0x03,","0x01,","0x01,","0x31,","0x88,"}; No luck
global vfd={0x01,0x03,0x01,0x01,0x31,0x88};
global VFDOpen = function()
{
myser.Open(6,9600); //port 6 baud 9600
print( "VFD opened");
return;
};
global SpindleOn = function()
{
// sendData=(vfd[0]+vfd[1]+vfd[2]+vfd[3]+vfd[4]+vfd[5]);
sendData=(vfd[0]+","+vfd[1]+","+vfd[2]+","+vfd[3]+","+vfd[4]+","+vfd[5]);
debug();
myser.SendData(sendData);
print("Set to Frequency " + GlobalGet("SpindleSpeed"));
return;
};
global VFDSpindle = function(control)
{
FreeSetSpeed( MySpindleAxis,control); //turn on/off spindle
if(control ==1){
print("Spindle On");
SpindleOn();
}
else
{
print("Spindle Off");
//SpindleOff(); // need to call/Create the Off function
}
};
VFDOpen();
VFDSpindle(1); //1 is on 0 is off
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
I really want to send
sendData=(vfd[0]+vfd[1]+vfd[2]+vfd[3]+vfd[4]+vfd[5]);
myser.SendData(sendData);
error is
expecting param 0 as string, got int
if I
sd=vfd[0].string()
myser.SendData(sd);
it sends 0x31 not 1
so I can't even send 1 element at a time :-[
really need to see function template of SendData() or something
sendData=(vfd[0]+vfd[1]+vfd[2]+vfd[3]+vfd[4]+vfd[5]);
myser.SendData(sendData);
error is
expecting param 0 as string, got int
if I
sd=vfd[0].string()
myser.SendData(sd);
it sends 0x31 not 1
so I can't even send 1 element at a time :-[
really need to see function template of SendData() or something
Re: Functional overview
Hi Richard:
I think its done as follows..
global vfd={0x01,0x03,0x01,0x01,0x31,0x88,0x00}; //terminated with zero for string conversion..
global myser = Serial();
myser.Open(6,9600); //port 6 baud 9600
line = ToString(vfd);
myser.SendData(line);
myser.Close();
Ill dig in the code to be sure..
Art
I think its done as follows..
global vfd={0x01,0x03,0x01,0x01,0x31,0x88,0x00}; //terminated with zero for string conversion..
global myser = Serial();
myser.Open(6,9600); //port 6 baud 9600
line = ToString(vfd);
myser.SendData(line);
myser.Close();
Ill dig in the code to be sure..
Art
Re: Functional overview
Richard:
While that compiles, it doesnt work as expected.. Ill trace it down and report the fix..
Art
While that compiles, it doesnt work as expected.. Ill trace it down and report the fix..
Art
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
that sendsToString(vfd);
table:0x13bd9fc4
looks like an address
Who is online
Users browsing this forum: No registered users and 3 guests