GearHeads Corner
April 24, 2017, 01:55:21 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 ... 3 4 [5]
  Print  
Author Topic: Functional overview  (Read 1857 times)
0 Members and 1 Guest are viewing this topic.
Richard Cullin
Jr. Member
**
Posts: 75


View Profile
« Reply #60 on: January 05, 2017, 09:19:42 PM »

thanks art
Logged
ArtF
Administrator
Hero Member
*****
Posts: 4609



View Profile
« Reply #61 on: January 06, 2017, 12:17:18 PM »

Richard:

  New version is online, if you call myser.Rea dData() to get a string, at the same time
myser.Tab le is filled with integers of the incoming values. So to use byte 6,7 youd use

str = myser.Rea dData( 8 );
byte6 = myser.Tab le[6];
byte7 = myser.Tab le[7]; //assuming byte 0 numbering of course..

Art
« Last Edit: January 06, 2017, 04:12:42 PM by ArtF » Logged

Thanks, have fun,
Art
Richard Cullin
Jr. Member
**
Posts: 75


View Profile
« Reply #62 on: January 06, 2017, 04:07:20 PM »

thanks I will  give a try

 
Logged
Richard Cullin
Jr. Member
**
Posts: 75


View Profile
« Reply #63 on: January 06, 2017, 05:39:10 PM »

still in a bit of trouble, very nearly works
data returned  @6000 rpm  is  0x2a,0x9d    for table[4],table[5]   Smiley very good
but table[5] is interpret ed 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 GetVfdSpe ed = function( )
{
    CRC=0xffff;
    vfd={1,4,3,1,0,0};
    for (inx=0;inx<tableCoun t(vfd);inx+=1)
      {
            CRC=Crc16(CRC,vfd[inx]);
      };
      // print("the CRC " + CRC);
    vfd[7]=ToInt(CRC/256);
    vfd[6]=ToInt(CRC%256);
 
 
    myser.Tab le = vfd;
    myser.Sen dTable();
    //sleep(1);
 
while( myser.Dat aWaiting() <Cool { yield();};
print("buff depth " + myser.Dat aWaiting() );
//str = myser.Get Data();
//print( "buffer "+str );
 
 bd=myser.DataWaiting();
 
 
    string = myser.Rea dData(bd  );
 
    vfdrpm=(myser.Tab le[bd-4]*256+myser.Table[bd-3])*55/100;
    print("high " + myser.Tab le[4] + " low " + myser.Tab le[5] );
    print("Rpm  read " +  vfdrpm );
    return vfdrpm;
};
 
 
Logged
ArtF
Administrator
Hero Member
*****
Posts: 4609



View Profile
« Reply #64 on: January 06, 2017, 05:41:57 PM »

lol.. my bad. Ill probably have to do that for you when I pack them. Ill check it out.

Art
Logged

Thanks, have fun,
Art
ArtF
Administrator
Hero Member
*****
Posts: 4609



View Profile
« Reply #65 on: January 06, 2017, 05:45:57 PM »

Richard:

 Just uploading now a proper unsigned int version..

Art
Logged

Thanks, have fun,
Art
Richard Cullin
Jr. Member
**
Posts: 75


View Profile
« Reply #66 on: January 07, 2017, 06:25:05 PM »


downloade d new version and tried again this morning, its no different .  did I jump the gun ?
Logged
ArtF
Administrator
Hero Member
*****
Posts: 4609



View Profile
« Reply #67 on: January 07, 2017, 09:32:53 PM »

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
Logged

Thanks, have fun,
Art
ArtF
Administrator
Hero Member
*****
Posts: 4609



View Profile
« Reply #68 on: January 08, 2017, 09:13:17 AM »

Richard:

 Try it now, Ive tested it sends proper integers. .

Art
Logged

Thanks, have fun,
Art
Richard Cullin
Jr. Member
**
Posts: 75


View Profile
« Reply #69 on: January 08, 2017, 06:04:29 PM »

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 controlle r I was using did not support probing g31,g38 [afaikr] style via mach3 and the pokeyscnc 57 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
Logged
Ya-Nvr-No
Moderator
Full Member
*****
Posts: 204



View Profile WWW
« Reply #70 on: January 08, 2017, 06:47:25 PM »

I tried my Huanyang VFD spindle controlle r 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 controlle r is different than yours.
 
Side Note: I use 3 mpgs with Auggie and Pokeys57c nc one for each axis.





* HuanyangSetup.JPG (69.96 KB, 802x424 - viewed 17 times.)
Logged

Richard Cullin
Jr. Member
**
Posts: 75


View Profile
« Reply #71 on: January 08, 2017, 07:46:49 PM »

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  GetVfdSpe ed  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 GetVfdSpe ed = 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


* Vfd-Spindle.Script.txt (3.35 KB - downloaded 11 times.)
« Last Edit: January 08, 2017, 07:57:03 PM by Richard Cullin » Logged
ArtF
Administrator
Hero Member
*****
Posts: 4609



View Profile
« Reply #72 on: January 08, 2017, 09:21:01 PM »

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 SendTable CRC16 function so you dont need to
compute crc's.

myser = Serial();
myser.Ope n(6,9600);
vfd={0x01,0x03,0x01,0x01};//,0x31,0x88};
myser.Tab le = vfd;
crc = myser.Sen dTableCRC 16();
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 automatic ally.

 
Art

Logged

Thanks, have fun,
Art
Pages: 1 ... 3 4 [5]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!