Functional overview

Discussions and file drops for Auggie
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: Functional overview

Post by Richard Cullin »

thanks I will  give a try

Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: Functional overview

Post by Richard Cullin »

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;
};

User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Functional overview

Post by ArtF »

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

Art
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Functional overview

Post by ArtF »

Richard:

Just uploading now a proper unsigned int version..

Art
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: Functional overview

Post by Richard Cullin »


downloaded new version and tried again this morning, its no different .&nbsp; did I jump the gun ?
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Functional overview

Post by ArtF »

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
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Functional overview

Post by ArtF »

Richard:

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

Art
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: Functional overview

Post by Richard Cullin »

fixed&nbsp; , thanks art

do you have any thoughts re&nbsp; a pendant/mpg&nbsp; for auggie ?
I have a vista_cnc&nbsp; 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&nbsp; just one more thing to think about&nbsp; I don't think a script alone could get the timing correct for accurate position at contact
Ya-Nvr-No
Old Timer
Posts: 188
Joined: Wed Sep 08, 2010 11:15 am

Re: Functional overview

Post by Ya-Nvr-No »

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.



Attachments
HuanyangSetup.JPG
Richard Cullin
Old Timer
Posts: 152
Joined: Sat Jun 02, 2012 5:45 am

Re: Functional overview

Post by Richard Cullin »

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 &nbsp;GetVfdSpeed &nbsp;modified like this it will read the set freq , I call it from the &nbsp;m10 function when testing its wery handy and the spindle can remain still (quiet)




global GetVfdSpeed = function( )
{
&nbsp; &nbsp;CRC=0xffff;
&nbsp; &nbsp;vfd={1,4,3,0,0,0}; // will read set freq
&nbsp; &nbsp;...

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.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Functional overview

Post by ArtF »

Richard:

&nbsp; 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 );

&nbsp; This will print&nbsp; 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.

&nbsp;
Art

Post Reply

Who is online

Users browsing this forum: No registered users and 94 guests