Go to Post what fun is it if you haven't ripped out all your hair and beaten your now bald head against the wall for extended periods of time.... - pickle [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 07-03-2013, 16:22
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Stall detection

Assuming I already had an encoder for speed control or monitoring, I would use a low speed threshold and acceleration threshold to declare stall. A rapid deceleration of the wheel combined with a low wheel speed when wheel power is on will correlate to a stalled wheel.

Code:
wheel_speed = rpm_from_sensor();
d_wheel_speed = wheel_speed - wheel_speed_last;
wheel_speed_last = wheel_speed;
wheel_des_on_time++;


if(wheel_speed  < wss_stall_cal_lt && d_wheel_speed < wss_stall_accel_cal && wheel_desired > 0 && wheel_des_on_time > wss_stall_on_cal)
{
wheel_stall = 1;
}
if(0 == wheel_desired)
{
wheel_stall = 0;
wheel_des_on_time = 0;
}
wss_stall_cal_lt is low, probably about 50% normal running speed
wss_stall_accel_cal is a negative number. I would play with it but I would guess something like -12 for a 10ms loop time. This number should be calibrated based on data traces of stalling the wheel and normal free running.
wss_stall_on_cal is probably around 1/2 the time it takes to spin up to full speed measured in loop iterations (this is determined by fixed iteration time).

No normal conditions except firing a frisbee should create significant negative acceleration. The low speed cal prevents the normal firing from tripping it, and the on time cal prevents battery voltage spikes/dips or other startup oddities from tripping it even if you don't think they would produce a large negative acceleration.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:48.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi