Machine stop randomly

Moderators: TomKerekes, dynomotion

Post Reply
4minnovations
Posts: 47
Joined: Fri Nov 01, 2019 7:18 pm

Machine stop randomly

Post by 4minnovations » Wed Sep 23, 2020 12:11 pm

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,
Attachments
PAL-Master - 20200813a.c
Master file
(44.56 KiB) Downloaded 242 times

User avatar
TomKerekes
Posts: 2676
Joined: Mon Dec 04, 2017 1:49 am

Re: Machine stop randomly

Post by TomKerekes » Thu Sep 24, 2020 5:32 pm

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.
Regards,

Tom Kerekes
Dynomotion, Inc.

4minnovations
Posts: 47
Joined: Fri Nov 01, 2019 7:18 pm

Re: Machine stop randomly

Post by 4minnovations » Fri Sep 25, 2020 11:59 am

Thank you Tom,
I will check what you said and make the necessary change.

4minnovations
Posts: 47
Joined: Fri Nov 01, 2019 7:18 pm

Re: Machine stop randomly

Post by 4minnovations » Mon Sep 28, 2020 4:52 pm

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?
Attachments
PAL-Master - 20200928a.c
(44.59 KiB) Downloaded 265 times

User avatar
TomKerekes
Posts: 2676
Joined: Mon Dec 04, 2017 1:49 am

Re: Machine stop randomly

Post by TomKerekes » Mon Sep 28, 2020 4:56 pm

Please post your include file:

fonctionsCalculs4Mv20200928.h
Regards,

Tom Kerekes
Dynomotion, Inc.

4minnovations
Posts: 47
Joined: Fri Nov 01, 2019 7:18 pm

Re: Machine stop randomly

Post by 4minnovations » Mon Sep 28, 2020 5:09 pm

Voila
Attachments
fonctionsCalculs4Mv20200928.h
(985 Bytes) Downloaded 244 times

User avatar
TomKerekes
Posts: 2676
Joined: Mon Dec 04, 2017 1:49 am

Re: Machine stop randomly

Post by TomKerekes » Mon Sep 28, 2020 8:20 pm

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
Regards,

Tom Kerekes
Dynomotion, Inc.

4minnovations
Posts: 47
Joined: Fri Nov 01, 2019 7:18 pm

Re: Machine stop randomly

Post by 4minnovations » Tue Sep 29, 2020 11:38 am

Thanks, if I use the thread 7, where the overflow go?
This is a problem?

4minnovations
Posts: 47
Joined: Fri Nov 01, 2019 7:18 pm

Re: Machine stop randomly

Post by 4minnovations » Tue Sep 29, 2020 2:09 pm

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?
Attachments
fonctionsCalculs4Mv20200928.h
(1.53 KiB) Downloaded 246 times
PAL-Master - 20200928c.c
(44.31 KiB) Downloaded 249 times

User avatar
TomKerekes
Posts: 2676
Joined: Mon Dec 04, 2017 1:49 am

Re: Machine stop randomly

Post by TomKerekes » Tue Sep 29, 2020 6:16 pm

Correct. If Total is less than 65536 should not overflow.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply