⚠️ This forum has been restored as a read-only archive so the knowledge shared by the community over many years remains available. New registrations and posting are disabled.

All times are UTC + 8 hours




Post new topic Reply to topic  [ 56 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Oct 22nd, '14, 17:27 
Newbie
Newbie

Joined: Oct 16th, '14, 11:47
Posts: 44
Gender: Male
Are you human?: Almost...
Location: Northern Victoria
BullwinkleII wrote:
Fish work out how to press a lever within a few hours, so if you make the feeder feed only when there's demand, it allows for their fussy habits. it's still easy enough to keep the control you have, you just add an LED to let them know feed is available, and turn it off when they have had their ration for the day.


I saw the demand feeder on your blog - very impressive, a cool idea!

Only works for trout that are quite large though (not fingerlings)?


Top
 Profile  
Reply with quote  
    Advertisement
 
PostPosted: Oct 22nd, '14, 17:46 
Almost divorced
Almost divorced
User avatar

Joined: Aug 9th, '09, 13:14
Posts: 1357
Gender: Male
Are you human?: I'll be baaaack!
Location: SOR, Perth, WA
nicbaz wrote:
Unfortunately optimal feeding rate does not seem to be linear, so it would not be a simple y = mx + c equation to determine the feed rate (though the implementation above is linear.

For trout, I'd image something more like:
y = -ax2 + bx + c

where the maximum feed is provided at the "optimum" temp for the fish, then reduces as the water temp moves further away; then employ a Max() function to ensure they get fed something.

You can use Excel to come up with the function, given a few points on a scatter chart.


Top
 Profile  
Reply with quote  
PostPosted: Oct 22nd, '14, 18:00 
Newbie
Newbie

Joined: Oct 16th, '14, 11:47
Posts: 44
Gender: Male
Are you human?: Almost...
Location: Northern Victoria
Yeah for sure, it wouldn't be a problem to do, and if this second order polynomial won't cut it, i'm sure a cubic would match the curve! I'm so happy we have computers to do this though.. University Calculus and Linear Algebra are a world away..


Top
 Profile  
Reply with quote  
PostPosted: Oct 22nd, '14, 23:01 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
nicbaz wrote:
BullwinkleII wrote:
Fish work out how to press a lever within a few hours, so if you make the feeder feed only when there's demand, it allows for their fussy habits. it's still easy enough to keep the control you have, you just add an LED to let them know feed is available, and turn it off when they have had their ration for the day.


I saw the demand feeder on your blog - very impressive, a cool idea!

Only works for trout that are quite large though (not fingerlings)?


I would guess anything over 3 or 4 cm would have no trouble, and perhaps even less than that. I fond switches at my local electronics store that look like normal momentary switches, but had a long ... button... stork thing. Most momentary switches also work when you press them sideways, but the longer they are the easer they are to press. I found some that had a button that was an inch long that needed only the slightest pressure. maybe not quite a guppy, but it would be very close.

I would guess 1 in 50 guppies could activate the switch I made. Once you add a long lever it gets pretty easy.

The silvers you see hitting the leaver are pretty small.


Top
 Profile  
Reply with quote  
PostPosted: Oct 23rd, '14, 18:32 
Legend Member
Legend Member

Joined: Aug 14th, '10, 03:55
Posts: 530
Gender: Male
Are you human?: Jar Head Clan
Location: Minnesota, USA
Hey Bunson,

Could you explain your poly a little more? What would each variable represent?
------
Math challenged :oops:


Top
 Profile  
Reply with quote  
PostPosted: Oct 23rd, '14, 18:44 
Newbie
Newbie

Joined: Oct 16th, '14, 11:47
Posts: 44
Gender: Male
Are you human?: Almost...
Location: Northern Victoria
Bob H wrote:
Hey Bunson,

Could you explain your poly a little more? What would each variable represent?
------
Math challenged :oops:


I'll answer for fun :)

bunson wrote:
y = -ax2 + bx + c


This equation is a quadratic
-the a represents the dilation (and the fact that it is negative means it is upside down) - which is basically how fast the feed rate changes with temp changes.
-the b is a little more difficult to explain, but basically can be used to fine turn horizontal translation..
-the c represents vertical translation.

Check this out :)
http://jwilson.coe.uga.edu/emat6680/dun ... ola_KD.htm
http://www.purplemath.com/modules/quadform.htm


Top
 Profile  
Reply with quote  
PostPosted: Oct 23rd, '14, 19:05 
Legend Member
Legend Member

Joined: Aug 14th, '10, 03:55
Posts: 530
Gender: Male
Are you human?: Jar Head Clan
Location: Minnesota, USA
Thanks for the info NICBAZ,

I like the training for demand feeding idea.

Just for smiles and giggles, how about recording the time of day, frequency, duration, water temp and feed quantities?

But I wonder if that would require expansion of the GPI0?

All the temp sensors could be a 1 wire buss so thats not a problem.

Auger feed rate from off line calibration, stored in the program as a constant?

The main program could monitor when the auger was turned on and how long.

Time of day from a program sub routine?

Export the whole mess to excel for graphing?

Just :think: and dreaming.


Top
 Profile  
Reply with quote  
PostPosted: Oct 23rd, '14, 19:15 
Almost divorced
Almost divorced
User avatar

Joined: Aug 9th, '09, 13:14
Posts: 1357
Gender: Male
Are you human?: I'll be baaaack!
Location: SOR, Perth, WA
Bob,

The variables themselves wouldn't represent anything "real life", they're just values that could be used to fit a function to a set of points for the purposes of simplifying a problem.

Let's continue the idea of feeding trout and say that you feed them according to water temperature and would like to find an algorithm for an auto-feeder. If you fed according to the plan:
20 1.2
21 1.8
22 2.0
23 1.8
24 1.5

How much would you feed if the water temperature was 20.5? What about 18?

If you plot those values in Excel, you can insert a polynomial trendline (order 2) to fit those points and end up with a function:

y = -0.1571x2 + 6.9743x - 75.403

where:
y is the feed amount, and
x is the water temperature.

You can now program this into a device and feed the "right" amount according to the water temp; but the variables don't have much meaning on their own.

This is just an example; I'd certainly not use it in real life! The "proper" function is almost certain to be a lot more "complicated".


Top
 Profile  
Reply with quote  
PostPosted: Oct 23rd, '14, 19:16 
Newbie
Newbie

Joined: Oct 16th, '14, 11:47
Posts: 44
Gender: Male
Are you human?: Almost...
Location: Northern Victoria
Bob H wrote:
Thanks for the info NICBAZ,

I like the training for demand feeding idea.

Just for smiles and giggles, how about recording the time of day, frequency, duration, water temp and feed quantities?

But I wonder if that would require expansion of the GPI0?


Not a problem :)

Yeah, sounds like a great idea -and if there was a reliable and easy to make design, it'd be pretty cool to implement.

My thoughts are I would connect a momentary switch up to a gpio port, as an input.
I'd then have a program constantly running that monitors and when that input is triggered, the auger pumps out a gram of feed (or whatever). It would be simple to have a SQL relation (table), that allows details of each feeding to be recorded.

Pretty easy to output the data, or graph it with a web server or whatever really.

Would be quite cool, and would give some hard data about what feeding rates are like when temperature is taken into account.


Top
 Profile  
Reply with quote  
PostPosted: Oct 25th, '14, 05:03 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Feb 23rd, '07, 03:48
Posts: 6715
Location: Lyonville Victoria
Gender: Male
Are you human?: yes
Location: Lyonville
The formula needs to be a tad more complicated straight away because fish feed at different rates at different sizes.

In order to calculate how much feed you would also need to know the size and number of fish as well as the temperature.

Formula data fitting is something I can do but can anyone recommend a text book on this Raspberry stuff. I find forums are great for asking questions but text books suit me better for base learning.


Top
 Profile  
Reply with quote  
PostPosted: Oct 25th, '14, 06:31 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
Proof also exists in the softer sciences :O !*

Demand feeding negates the need for mathematics. Let the fishies choose when to eat and they gain weight faster (I offer no citation)



*AAggghhhh!


Top
 Profile  
Reply with quote  
PostPosted: Oct 25th, '14, 10:02 
Xtreme Contributor
Xtreme Contributor
User avatar

Joined: May 17th, '14, 07:21
Posts: 180
Gender: Male
Are you human?: YES
Location: Vancouver BC Canada
nicbaz wrote:
My thoughts are I would connect a momentary switch up to a gpio port, as an input.
I'd then have a program constantly running that monitors and when that input is triggered, the auger pumps out a gram of feed (or whatever). It would be simple to have a SQL relation (table), that allows details of each feeding to be recorded.

Pretty easy to output the data, or graph it with a web server or whatever really.

Would be quite cool, and would give some hard data about what feeding rates are like when temperature is taken into account.

I have the same plan. Here's a snippet of my arduino code.

Code:
 
void feeder() {                                // this subroutine is only called when the interrupt triggers
  relay_feederTrigger = 1;                         // set the trigger flag
  detachInterrupt(0);                                // disable the interrupt
}

// Relay feeder snippet of main code
  if (relay_feederTrigger == 1){                 // if feeder switch was hit...
    relay_feederValue++;                           // increment feeder value to report to grovestreams
    digitalWrite(feederLEDPin, LOW);           // turn off LED
    digitalWrite(relay_feederPin, LOW);       // turn on relay
    delay(relay_feederDuration);                // this code is blocking to ensure accurate timing
    digitalWrite(relay_feederPin, HIGH);     // turn off relay
    relay_feederTimer = millis();                // set timer
    relay_feederTrigger = 0;                      // reset trigger flag
  } else {
    digitalWrite(relay_feederPin, HIGH);     // if flag is low make sure relay is off
  }

  if ((millis() - relay_feederTimer) >= relay_feederTimeout){     // wait timeout to reset feeder
    EIFR = (1 << INTF4);                                           // clear pending interrupts in queue
    attachInterrupt(0, feeder, FALLING);                              // enable interrupt
    digitalWrite(feederLEDPin, HIGH);                                    // turn on LED
  }



Every 15 minutes [relay_feederValue] is sent to Grovestreams and displayed in my dashboard.

I have two variables that I can use to tune the feeding quantity. The time the motor is on and the time between feedings that the interrupt is disabled. If I look at grovestreams and find that the fish are hitting the trigger every timeout period, then I can play with the values to get them more food without increasing the risk of left over food. I think it is better to auto feed by straight demand instead of feeding a calculated amount based on time.


Top
 Profile  
Reply with quote  
PostPosted: Oct 27th, '14, 18:31 
Newbie
Newbie

Joined: Oct 16th, '14, 11:47
Posts: 44
Gender: Male
Are you human?: Almost...
Location: Northern Victoria
Stuart Chignell wrote:
The formula needs to be a tad more complicated straight away because fish feed at different rates at different sizes.

In order to calculate how much feed you would also need to know the size and number of fish as well as the temperature.


A basic enough formula can take the differences in feed rates, and it would probably possible to integrate changes in temperature.
Here is a demo of how the formula could be derived using Exec.

https://onedrive.live.com/redir?resid=6 ... ile%2cxlsx

Stuart Chignell wrote:
Formula data fitting is something I can do but can anyone recommend a text book on this Raspberry stuff. I find forums are great for asking questions but text books suit me better for base learning.


Regarding the Raspberry Pi, what's your understanding of Linux/Unix?
People generally run Raspbian http://www.raspbian.org/ on their Raspberry Pi, which is a unix operating system based on Debian optimised for the Raspberry Pi hardware.

If you have any experience accessing a unix box via SSH/Telnet, then it's not much of a stretch to work it out.
If you don't, the Raspbery Pi is used in schools in the UK for teaching, so i'm sure there's something out there.

Everything I know, I learned off of Google, and a lot from here: http://www.raspberrypi.org/forums/ :)


Top
 Profile  
Reply with quote  
PostPosted: Oct 27th, '14, 18:36 
Newbie
Newbie

Joined: Oct 16th, '14, 11:47
Posts: 44
Gender: Male
Are you human?: Almost...
Location: Northern Victoria
BullwinkleII wrote:
Proof also exists in the softer sciences :O !*

Demand feeding negates the need for mathematics. Let the fishies choose when to eat and they gain weight faster (I offer no citation)


But i'd love to see how much these fishies want to eat at a particular temperature, and at a particular age, so those of us without demand feeders can emulate their behaviour :)


Top
 Profile  
Reply with quote  
PostPosted: Oct 27th, '14, 18:44 
Newbie
Newbie

Joined: Oct 16th, '14, 11:47
Posts: 44
Gender: Male
Are you human?: Almost...
Location: Northern Victoria
Chiumanfu wrote:

I have two variables that I can use to tune the feeding quantity. The time the motor is on and the time between feedings that the interrupt is disabled. If I look at grovestreams and find that the fish are hitting the trigger every timeout period, then I can play with the values to get them more food without increasing the risk of left over food. I think it is better to auto feed by straight demand instead of feeding a calculated amount based on time.


Oh I agree, i'm just not confident that I can construct a demand feeder that is as reliable as the feeder I currently have set up!

I'm currently feeding the trout 10 times daily, and 5 minutes after each feed I take a snapshot, which I can use retrospectively to ensure that there is no feed left over. I'm currently erring the side of adjusting feed till there is a tad of feed left over, and then bumping it down a few grams.

Seems to be working well!

Also taking daily snaps of the fish, and theres been quite bit of growth in the 12 days i've been doing it!
Attachment:
snap_20141016_12-26-56.jpg
snap_20141016_12-26-56.jpg [ 42.31 KiB | Viewed 6409 times ]

Attachment:
snap_20141027_12-00-01.jpg
snap_20141027_12-00-01.jpg [ 37.91 KiB | Viewed 6409 times ]


Last edited by nicbaz on Oct 27th, '14, 19:20, edited 1 time in total.

Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 56 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC + 8 hours


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 post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group
Portal by phpBB3 Portal © phpBB Türkiye
[ Time : 0.076s | 18 Queries | GZIP : Off ]