Functional overview

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Functional overview

Re: Functional overview

by ArtF » Mon Jan 09, 2017 2:21 am

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

Re: Functional overview

by Richard Cullin » Mon Jan 09, 2017 12:46 am

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

Re: Functional overview

by Amazon [Bot] » Sun Jan 08, 2017 11:47 pm

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.



Re: Functional overview

by Richard Cullin » Sun Jan 08, 2017 11:04 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 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

by ArtF » Sun Jan 08, 2017 2:13 pm

Richard:

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

Art

Re: Functional overview

by ArtF » Sun Jan 08, 2017 2:32 am

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

Re: Functional overview

by Richard Cullin » Sat Jan 07, 2017 11:25 pm


downloaded new version and tried again this morning, its no different .  did I jump the gun ?

Re: Functional overview

by ArtF » Fri Jan 06, 2017 10:45 pm

Richard:

Just uploading now a proper unsigned int version..

Art

Re: Functional overview

by ArtF » Fri Jan 06, 2017 10:41 pm

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

Art

Re: Functional overview

by Richard Cullin » Fri Jan 06, 2017 10:39 pm

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};
&nbsp; &nbsp; for (inx=0;inx<tableCount(vfd);inx+=1)
&nbsp; &nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CRC=Crc16(CRC,vfd[inx]);
&nbsp; &nbsp; &nbsp; };
&nbsp; &nbsp; &nbsp; // print("the CRC " + CRC);
&nbsp; &nbsp; vfd[7]=ToInt(CRC/256);
&nbsp; &nbsp; vfd[6]=ToInt(CRC%256);


&nbsp; &nbsp; myser.Table = vfd;
&nbsp; &nbsp; myser.SendTable();
&nbsp; &nbsp; //sleep(1);

while( myser.DataWaiting() <8) { yield();};
print("buff depth " + myser.DataWaiting() );
//str = myser.GetData();
//print( "buffer "+str );

bd=myser.DataWaiting();


&nbsp; &nbsp; string = myser.ReadData(bd&nbsp; );

&nbsp; &nbsp; vfdrpm=(myser.Table[bd-4]*256+myser.Table[bd-3])*55/100;
&nbsp; &nbsp; print("high " + myser.Table[4] + " low " + myser.Table[5] );
&nbsp; &nbsp; print("Rpm&nbsp; read " +&nbsp; vfdrpm );
&nbsp; &nbsp; return vfdrpm;
};


Top