CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

filtering load cells

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
delene
Guest







filtering load cells
PostPosted: Wed Jul 09, 2003 2:58 am     Reply with quote

I have used the PIC18f452 to design a scale - it works great for small scale and weighbridges.
I know want to modify it to weigh cattle.
My problem is that the cattle jumps about - there is never a stable ready. What I want to do is lock the display on the mass of the scale. ie. If you weigh 60kg and jump on the scale after a couple of seconds the scale must lock on 60kg as your weight.

Does anyone have any idea how I go about this.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515804
Kenny



Joined: 07 Sep 2003
Posts: 173
Location: Australia

View user's profile Send private message

Re: filtering load cells
PostPosted: Wed Jul 09, 2003 4:10 am     Reply with quote

:=I have used the PIC18f452 to design a scale - it works great for small scale and weighbridges.
:=I know want to modify it to weigh cattle.
:=My problem is that the cattle jumps about - there is never a stable ready. What I want to do is lock the display on the mass of the scale. ie. If you weigh 60kg and jump on the scale after a couple of seconds the scale must lock on 60kg as your weight.
:=
:=Does anyone have any idea how I go about this.

A very effective method posted by Mr. Hamlett that I have used in similar situations:
<a href="http://www.pic-c.com/forum/general/posts/8286.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/8286.html</a>

There are others posted on this forum, place 'filter' in the search.

Regards
Kenny
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515808
delene
Guest







Re: filtering load cells
PostPosted: Wed Jul 09, 2003 4:55 am     Reply with quote

Thanks Kenny
I will give it a try and let you know

Delene
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515813
R.J.Hamlett
Guest







Re: filtering load cells
PostPosted: Wed Jul 09, 2003 5:29 am     Reply with quote

:=Thanks Kenny
:=I will give it a try and let you know
:=
:=Delene
I would suggest, that you might need to add a bit of 'intelligence' to the filtering as well. For instance, if you know that the maximum weight that should ever be seen, is a particular value, you could reject any figure above this value (corresponding to a sudden force as an animal jumps), before feeding the numbers into the filter algorithm. You could then have the damping 'assymetric', so that it responds slower to a loss of weight, than to a weight being added, which shouldn't then result in a tendency to 'overweigh' (which would otherwise happen with such an assymetric response. Tuning the algorithm, would be easiest, by having variables holding values for 'upsmall', 'uplarge', 'downsmall', 'downlarge' (corresponding to the points where you change the slope of the damping), and for 'max', 'smalldiv', 'largediv', (the division ratios to be used). If you allow these to be updated externally, using a serial link, you can experiment, to actually see how to get the damping to work best for you. The particular problem you are going to have, is that the 'jump' upwards in value, when an animal steps onto the platform, will be very similar to the jump seen when the animal moves. I would possibly think in terms of turning the damping down, when the platform receives a small duration of signal close to zero (a couple of successive samples), then accepting the first 'high' figure after this (as the animal first jumps on), and then damping more massively from this.
If you have access to a data logger (or could put together some code to do this with the PIC), you might consider getting some typical 'snapshot' raw data sequences, and trying different levels of damping on these in the PC, to see what the best solution is.

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515814
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: filtering load cells
PostPosted: Wed Jul 09, 2003 12:41 pm     Reply with quote

:=I have used the PIC18f452 to design a scale - it works great for small scale and weighbridges.
:=I know want to modify it to weigh cattle.
:=My problem is that the cattle jumps about - there is never a stable ready. What I want to do is lock the display on the mass of the scale. ie. If you weigh 60kg and jump on the scale after a couple of seconds the scale must lock on 60kg as your weight.
:=
:=Does anyone have any idea how I go about this.
----------------------------------------------------

Collect some sample data, and import (or type) it into Excel.
Use the built-in statistical functions, such as AVERAGE or
MEDIAN, etc. to test different filters. You can test other
filters by typing in an equation. Excel can also graph the
results. This is how I proved to myself that a median
filter would work best for my project. A median filter
removes "spikes" from data.
<a href="http://www.pic-c.com/forum/general/posts/13211.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/13211.html</a>

You can use Excel to model the filter, and test it against
real data. You can see exactly how your PIC program will work,
in advance. And you don't have to buy MatLab. Most people
already have Excel on their PC.

I think the most important thing is to bring the data into
Excel, make a graph of it, and study it. Then you can
decide what filter (or filters) you need.

For lots of discussion articles on using filters with PICs,
go here: <a href="http://groups.google.com/advanced_group_search" TARGET="_blank">http://groups.google.com/advanced_group_search</a>
Set the group for comp.arch.embedded.piclist" and do a search
for: filter
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515824
C Shah



Joined: 16 Jun 2006
Posts: 1
Location: INDIA

View user's profile Send private message Send e-mail

Re: filtering load cells
PostPosted: Fri Jun 16, 2006 8:08 am     Reply with quote

[quote="delene"]I have used the PIC18f452 to design a scale - it works great for small scale and weighbridges.
I know want to modify it to weigh cattle.
My problem is that the cattle jumps about - there is never a stable ready. What I want to do is lock the display on the mass of the scale. ie. If you weigh 60kg and jump on the scale after a couple of seconds the scale must lock on 60kg as your weight.

Does anyone have any idea how I go about this.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515804[/quote]

I would like to get atleast 18bits of stable ADC data (from 24bit CS5532) connected to loadcell. Also, it should reject all vibrations, other sudden/temporary effects like overhead fan blowing air on it etc... Can anyone help me out on the issue? CPU used in 8051 based core (plenty of ROM+RAM available)!
Thnx
C Shah
Ttelmah
Guest







PostPosted: Fri Jun 16, 2006 10:39 am     Reply with quote

If it is an '8051 core', then go and ask on a group for this. This group is for people usng _CCS C_, on the PIC processor.

Best Wishes
Shah
Guest







Filtering Loadcells
PostPosted: Mon Jun 19, 2006 8:06 am     Reply with quote

Ttelmah wrote:
If it is an '8051 core', then go and ask on a group for this. This group is for people usng _CCS C_, on the PIC processor.

Best Wishes


Thanks - But as I wish algorithm / hint on "HOW TO" go about solving the problem - hence PIC / '51 core is not very important... I still await positive response on the issue...

Regards
C Shah
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon Jun 19, 2006 8:14 am     Reply with quote

I want to second the idea that you log some data to a PC and play with it using a spreadsheet or other good math modeling tools. Once you figure out what works you can then figure out how to do it in a microprocessor. It is probably going to be more than just averagings. Try googling "Median Filter" or searching for "olymipc scoring" on this forum.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Ttelmah
Guest







Re: Filtering Loadcells
PostPosted: Mon Jun 19, 2006 9:03 am     Reply with quote

Shah wrote:
Ttelmah wrote:
If it is an '8051 core', then go and ask on a group for this. This group is for people usng _CCS C_, on the PIC processor.

Best Wishes


Thanks - But as I wish algorithm / hint on "HOW TO" go about solving the problem - hence PIC / '51 core is not very important... I still await positive response on the issue...

Regards
C Shah

The same comment still applies. This is a group for people having _CCS_ problems, _not_ a general arithmetic group. Filtering algorithms are as common as muck, and 5 minutes with google will point you to places covering these. If you have bought a CCS compiler, and have a CCS specific problem with how to implement a filter, then post here, otherwise 'go away'.
As a general hint, if you want to look through the archive here, do a search for 'olympic sorting'. A similar search on normal filtering will find a number of general algorithms. The combination, of a rolling average algorithm, with an olympic sorting algortithm, is the sort of approach that will be needed for this problem.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group