ouput signal


Page 1 of 2 12 LastLast
Results 1 to 12 of 14

Thread: ouput signal

  1. #1
    Registered
    Join Date
    Oct 2014
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default ouput signal

    Tom, is it possible to output rs322 / 422 angular signals of rotational axes in degrees in 0/360 format? for kflop wiht canalog thanksdalmazio

    Similar Threads:


  2. #2
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2986
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi dalmazio,

    I assume you meant RS232 port?

    Yes that should be possible. Periodically sample the current axis Destination or Position, convert to degrees, perform modulo 360, write to port.

    You might look at the Modulo360.c example used to reset the current axis position to 0-360degrees
    Code:
    #include "KMotionDef.h"
    
    #define CNTS_PER_DEG 1000.0
    #define AXISA 4
    
    double modf(double, double*); // returns integer part with more han 32-bit precision
    
    double floor(double x) // truncate down toward -ininity
    {
       double y; 
       return (modf(x, &y) < 0 ? y - 1 : y);
    }
    
    main()
    {
        double dest = chan[AXISA].Dest;
        double cnts = CNTS_PER_DEG * 360.0;
        EnableAxisDest(AXISA, dest - (floor(dest/cnts)) * cnts);
    }
    HTH
    Regards



  3. #3
    Registered
    Join Date
    Oct 2014
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    dear tom, I use the kanalog and if active the suggested program for the rs232 stops the system, works with the programs write and read kanalog rs232, another question, it is possible to have the imput encoder signals divided x180 on the digital outputs for two axes ? thanks dalmazio



  4. #4
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2986
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi dalmazio,

    Sorry I don’t understand the question.



  5. #5
    Registered
    Join Date
    Oct 2014
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    We can move two axes in degree with Kflop integrated in a Kanalog. Could you explain us and
    give us the indication to reach a position in degree outside the kanalog through RS232?
    Or also to reach the differential signal of the encoder divided into 180 times to follow the conversion in degrees with ARDUINO.
    The reduction is necessary because the number of pulses in the Kanalog input is very high.
    Y inform that if Y start the program ENABLE RS 232 the KFLOP crashed.
    thanks a lot Dalmazio



  6. #6
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2986
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi Dalmazio,

    Sorry I still don't understand.

    Do you want your Arduino to send a command to KFLOP to move an axis?

    Do you want to send the current commanded Destination divided by 180 out to your Arduino?

    If you configure KFLOP to receive commands from RS232 then the USB commands will no longer function.



  7. #7
    Registered
    Join Date
    Oct 2014
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Do you want to send the current commanded Destination divided by 180 out to your Arduino?


    yes, I convert them to degrees to send them to a remote display



  8. #8
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2986
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi Dalmazio,

    Well you can simply divide the commanded destination for channel 'x' with:

    double value;

    value = chx->Dest / 180.0;

    What format do you want to send the value in over the RS232? ASCII characters?



  9. #9
    Registered
    Join Date
    Oct 2014
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    BR dear tom, I need to send the display reading out of the kflop or knalog in angular degrees format via rs232 kanalog, if it is not possible the encoder inputs divided by 180 to convert them with arduino 2

    for the rs232 in hexadecimal I think it is appropriate, tanks



  10. #10
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2986
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi Dalmazio,

    I still don't really understand. But to convert the value as hexadecimal integer. You might:

    Code:
    double value;
    int ivalue;
    char s[20];
    
    value = chx->Dest / 180.0;  // divide destination by 180
    
    ivalue = (int)value;  // convert to integer
    
    sprintf(s,"%8X",ivalue);  // convert integer to 8 hexadecimal characters




  11. #11
    Registered
    Join Date
    Oct 2014
    Posts
    23
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    HIi Tom
    double value;
    int ivalue;
    char s[20];

    stop compilation error value = chx->Dest / 180.0; // divide destination by 180

    ivalue = (int)value; // convert to integer

    sprintf(s,"%8X",ivalue); // convert integer to 8 hexadecimal characters
    tanks regards



  12. #12
    Gold Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    2986
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi Dalmazio,

    Replace 'x' with your channel number. ie. ch3



Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

ouput signal

ouput signal