VESC "crashing" under load?

Report your hardware problems here. Include as many details as possible with pictures to get the best possible help and feedback.
ViennaTom
Posts: 41
Joined: 21 Apr 2016, 13:06
Location: Austria/Vienna

Re: VESC "crashing" under load?

Postby ViennaTom » 16 May 2016, 19:25

hi !
well in the current implementation there is a timer thread that does what you describe by breaking the motor if the ALIVE signals (or other data packages/commands) are not appearing for a second (or 6 i guess). you find the implementation in timeout.c
this is the thread that stops the motor when the USB communication goes bananas on my system and that it was it should also do in the situation tobawo describes.
what my idea was and i have done it now for all but the comm threads (they use blocking calls in the moment) is to observe the loop of any thread you like (limited to a fixed array of 32 for now) by the windowed watchdog interrupt in lowest int priority with desired rate and either using a counter or a simple flag.

bool WWDOG_RegisterTag( uint8_t tagType, uint8_t mask, uint32_t *pFlag, thread_t *pThread );

static bool verifyWDTags()
{
int idx;
for(idx = 0;idx<WDTAG_ENTRIES;++idx) {
switch( wwTags[idx].ctrlType ) {
case UNUSED:
continue;
case ALIVEFLAG:
if (!wwTags[idx].pFlag)
return false;
break;
case DNCOUNTER:
if (!((uint16_t) wwDogCt & wwTags[idx].mask) && !--*wwTags[idx].pFlag )
return false;
break;
default:
case EOL:
return true;
}
}
return true;
}


Of course this is neither a big deal nor does it really fix problems but it can be useful i think. In my current implementation system is rebooted if the above function returns false but maybe a thread could be gracefully terminated and restarted .....
But a watchdog only observing dma interrupts is more or less senseless imo.

So tobawo maybe verify with the terminal app of the BLDC Tool which threads are running - the one named Timeout should brake the motor if your link is lost.

Greets
Tom


Return to “Hardware Problems”

Who is online

Users browsing this forum: No registered users and 1 guest