Page 1 of 1

Machine stop randomly

Posted: Wed Sep 23, 2020 12:11 pm
by 4minnovations
Hi Tom,

I have an issue with your controller. I use it to make a palletiser.

My setup:
a) 2x power supplies 80VDC – 18amp for the snapamp only
b) 1x kflop
c) 1x snapamp
d) 1x konnect

I use 4 axes, i.e. X, Y, a rotating clamp, and an elevator.

The problem happens randomly.

The machine stops working in the middle of a movement and to restart it, I must make a hard reset.

I use the function MoveAtVel for each axe.

I try to find the problem to repair it, but I cannot figure where to search.

Is it an overload problem for an axe?
Is it an overload problem for a set of two axes with the value of the current limit?
Is it an overload problem for a set of two axes with the value of the snap supply clamp?
Is it a software problem?
Is it a memory problem due to the calculations of the too many points?
Is it a hardware problem?

I attach you the file used for the details.

Thanks in advance for the help,

Re: Machine stop randomly

Posted: Thu Sep 24, 2020 5:32 pm
by TomKerekes
One issue I see is:

char strTempo[10];

only reserves space for 10 characters and you are writing more than 10 characters into it. That can cause a crash. Such as:

sprintf(strTempo,"Operation - Rangee %d",numRangee);

The "Validate" option finds bugs like that for you.

You should also add function prototypes so the correct parameters and return values is used.

Re: Machine stop randomly

Posted: Fri Sep 25, 2020 11:59 am
by 4minnovations
Thank you Tom,
I will check what you said and make the necessary change.

Re: Machine stop randomly

Posted: Mon Sep 28, 2020 4:52 pm
by 4minnovations
Hi Tom,
I check and repair all my code with your "Validate code", all done no error.
I check and repair all my code with your "compile code using Ti Compiler" and I have an error:

undefined first referenced
symbol in file
--------- ----------------
__fixfli C:\KMotion435b\C Programs\PAL-Master - 20200928a.obj
__fltlid C:\KMotion435b\C Programs\PAL-Master - 20200928a.obj

error: unresolved symbols remain
error: errors encountered during linking; "C:\KMotion435b\C Programs\PAL-Master
- 20200928a(7).out" not built

>> Compilation failure

What does that meen?

Re: Machine stop randomly

Posted: Mon Sep 28, 2020 4:56 pm
by TomKerekes
Please post your include file:

fonctionsCalculs4Mv20200928.h

Re: Machine stop randomly

Posted: Mon Sep 28, 2020 5:09 pm
by 4minnovations
Voila

Re: Machine stop randomly

Posted: Mon Sep 28, 2020 8:20 pm
by TomKerekes
undefined first referenced
symbol in file
--------- ----------------
__fixfli C:\KMotion435b\C Programs\PAL-Master - 20200928a.obj
__fltlid C:\KMotion435b\C Programs\PAL-Master - 20200928a.obj
That is a bug on our end as we aren't including all the TI Compiler's intrinsic functions. The code compiled without any warnings which was the purpose.

On this DSP "long" variables are the same as "int" variables 32 bit signed. If you replace long with int the TI Compiler should have all the functions it needs. Within printf statements %ld codes should be replaced with %d.

Note the code total size is over 65535 bytes. So be aware the code will overflow into the next Thread Space if used in Threads 1-6. So in that case the next Thread should not be used.

HTH

Re: Machine stop randomly

Posted: Tue Sep 29, 2020 11:38 am
by 4minnovations
Thanks, if I use the thread 7, where the overflow go?
This is a problem?

Re: Machine stop randomly

Posted: Tue Sep 29, 2020 2:09 pm
by 4minnovations
Hi Tom,
I try to remove the stuff that I can and I made functions with other.
My code have a total 64900 bytes.
This is correct? No overflow possible?

Re: Machine stop randomly

Posted: Tue Sep 29, 2020 6:16 pm
by TomKerekes
Correct. If Total is less than 65536 should not overflow.