Functional overview
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
thanks I will give a try
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
still in a bit of trouble, very nearly works
data returned @6000 rpm is 0x2a,0x9d for table[4],table[5] :) very good
but table[5] is interpreted as signed so 0x2a * 256 =10752 + 0x9d needs to be 10909 not 10653
I think this is happening to the setspeed calcs too
how can I get to use unsigned values ?
code
global GetVfdSpeed = function( )
{
CRC=0xffff;
vfd={1,4,3,1,0,0};
for (inx=0;inx<tableCount(vfd);inx+=1)
{
CRC=Crc16(CRC,vfd[inx]);
};
// print("the CRC " + CRC);
vfd[7]=ToInt(CRC/256);
vfd[6]=ToInt(CRC%256);
myser.Table = vfd;
myser.SendTable();
//sleep(1);
while( myser.DataWaiting() <8) { yield();};
print("buff depth " + myser.DataWaiting() );
//str = myser.GetData();
//print( "buffer "+str );
bd=myser.DataWaiting();
string = myser.ReadData(bd );
vfdrpm=(myser.Table[bd-4]*256+myser.Table[bd-3])*55/100;
print("high " + myser.Table[4] + " low " + myser.Table[5] );
print("Rpm read " + vfdrpm );
return vfdrpm;
};
data returned @6000 rpm is 0x2a,0x9d for table[4],table[5] :) very good
but table[5] is interpreted as signed so 0x2a * 256 =10752 + 0x9d needs to be 10909 not 10653
I think this is happening to the setspeed calcs too
how can I get to use unsigned values ?
code
global GetVfdSpeed = function( )
{
CRC=0xffff;
vfd={1,4,3,1,0,0};
for (inx=0;inx<tableCount(vfd);inx+=1)
{
CRC=Crc16(CRC,vfd[inx]);
};
// print("the CRC " + CRC);
vfd[7]=ToInt(CRC/256);
vfd[6]=ToInt(CRC%256);
myser.Table = vfd;
myser.SendTable();
//sleep(1);
while( myser.DataWaiting() <8) { yield();};
print("buff depth " + myser.DataWaiting() );
//str = myser.GetData();
//print( "buffer "+str );
bd=myser.DataWaiting();
string = myser.ReadData(bd );
vfdrpm=(myser.Table[bd-4]*256+myser.Table[bd-3])*55/100;
print("high " + myser.Table[4] + " low " + myser.Table[5] );
print("Rpm read " + vfdrpm );
return vfdrpm;
};
Re: Functional overview
lol.. my bad. Ill probably have to do that for you when I pack them. Ill check it out.
Art
Art
Re: Functional overview
Richard:
Just uploading now a proper unsigned int version..
Art
Just uploading now a proper unsigned int version..
Art
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
downloaded new version and tried again this morning, its no different . did I jump the gun ?
Re: Functional overview
Richard:
I doubt it, it likely just didnt work. ( I have no serial device so Im writing the code a bit blind).
Ill do an internal trace and get back to you..
Art
I doubt it, it likely just didnt work. ( I have no serial device so Im writing the code a bit blind).
Ill do an internal trace and get back to you..
Art
Re: Functional overview
Richard:
Try it now, Ive tested it sends proper integers..
Art
Try it now, Ive tested it sends proper integers..
Art
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
fixed , thanks art
do you have any thoughts re a pendant/mpg for auggie ?
I have a vista_cnc mach3 pendant, could auggie ever support 3rd party addons like that as mach3 does ?
one of the things that led me down the auggie track was that the Chinese motion controller I was using did not support probing g31,g38 [afaikr] style via mach3 and the pokeyscnc57 does . probing just one more thing to think about I don't think a script alone could get the timing correct for accurate position at contact
do you have any thoughts re a pendant/mpg for auggie ?
I have a vista_cnc mach3 pendant, could auggie ever support 3rd party addons like that as mach3 does ?
one of the things that led me down the auggie track was that the Chinese motion controller I was using did not support probing g31,g38 [afaikr] style via mach3 and the pokeyscnc57 does . probing just one more thing to think about I don't think a script alone could get the timing correct for accurate position at contact
Re: Functional overview
I tried my Huanyang VFD spindle controller and a 485 USB interface, and thou it connects I never found a way to control it with the hex data. I must be missing something here. The photo is the options I set. Are there others I missed? My spindle never started.
Can you provide your completed script? Thanks. Something I am missing or this controller is different than yours.
Side Note: I use 3 mpgs with Auggie and Pokeys57cnc one for each axis.
Can you provide your completed script? Thanks. Something I am missing or this controller is different than yours.
Side Note: I use 3 mpgs with Auggie and Pokeys57cnc one for each axis.
-
- Old Timer
- Posts: 152
- Joined: Sat Jun 02, 2012 5:45 am
Re: Functional overview
ya-nvr-no
that matches my settings , I have a few issues with windows changing the com port on me, every time I plug the adapter in its different port
pd165=3
pd164=1
pd163=1
if you call the GetVfdSpeed modified like this it will read the set freq , I call it from the m10 function when testing its wery handy and the spindle can remain still (quiet)
global GetVfdSpeed = function( )
{
CRC=0xffff;
vfd={1,4,3,0,0,0}; // will read set freq
...
you need to confirm the comms are working I here some vfd have missing rs485 chips
that matches my settings , I have a few issues with windows changing the com port on me, every time I plug the adapter in its different port
pd165=3
pd164=1
pd163=1
if you call the GetVfdSpeed modified like this it will read the set freq , I call it from the m10 function when testing its wery handy and the spindle can remain still (quiet)
global GetVfdSpeed = function( )
{
CRC=0xffff;
vfd={1,4,3,0,0,0}; // will read set freq
...
you need to confirm the comms are working I here some vfd have missing rs485 chips
- Attachments
-
[The extension txt has been deactivated and can no longer be displayed.]
Last edited by Richard Cullin on Sun Jan 08, 2017 1:57 pm, edited 1 time in total.
Re: Functional overview
Richard:
Probing is roughed it. I will take a look at it once I clear up a few things Im working on.
As of the next version, Ive added a SendTableCRC16 function so you dont need to
compute crc's.
myser = Serial();
myser.Open(6,9600);
vfd={0x01,0x03,0x01,0x01};//,0x31,0x88};
myser.Table = vfd;
crc = myser.SendTableCRC16();
str = format("0x%x",crc);
print( str );
This will print 0x8831 , as thats the returned crc. It sends the 0x31, 0x88 at the end of the
table, so you need only fill a table with command data, the CRC can be taken care of automatically.
Art
Probing is roughed it. I will take a look at it once I clear up a few things Im working on.
As of the next version, Ive added a SendTableCRC16 function so you dont need to
compute crc's.
myser = Serial();
myser.Open(6,9600);
vfd={0x01,0x03,0x01,0x01};//,0x31,0x88};
myser.Table = vfd;
crc = myser.SendTableCRC16();
str = format("0x%x",crc);
print( str );
This will print 0x8831 , as thats the returned crc. It sends the 0x31, 0x88 at the end of the
table, so you need only fill a table with command data, the CRC can be taken care of automatically.
Art
Who is online
Users browsing this forum: No registered users and 1 guest