reef-pi :: An opensource reef tank controller based on Raspberry Pi.

OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I made up a sensor holder today for my ATO which is working great so far.
The lower one is the ATO sensor and the upper one turns off the skimmer if the water level gets high.

Is it possible to also use the upper sensor as a fail safe for the ATO if the sensor fails with the pump on? What would be the best way to set this up?
If I just set the upper sensor to turn the ATO pump off, will they just fight with each other each time the sensors do a check?

20200627_142627.jpg
Looking good :)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I made up a sensor holder today for my ATO which is working great so far.
The lower one is the ATO sensor and the upper one turns off the skimmer if the water level gets high.

Is it possible to also use the upper sensor as a fail safe for the ATO if the sensor fails with the pump on? What would be the best way to set this up?
If I just set the upper sensor to turn the ATO pump off, will they just fight with each other each time the sensors do a check?

20200627_142627.jpg
Just setup another ato controller with the upper sensor and same pump
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I know there's been some discussion of adding the ability to control stepper peristaltic pumps. I'm thinking about doing some work on that topic and I thought I'd describe my plans to make sure I'm not duplicating any existing work, or going in a direction that doesn't make sense for some reason.

One of my priorities is minimizing stepper noise, so I've been looking at the Trinamic TMC-series stepper drivers. They claim to be able to run silently at lower speeds. The two drivers I've been looking at are the TMC2130 and TMC5160. The TMC5160 is basically a more powerful version of the TMC2130 that includes a step/ramp generator controllable via UART.

My first thought was to use the rpi's serial pins to drive the *5160, allowing multiple drivers to be controlled via a shared serial bus. The problem with the approach is that it could lead to uncontrolled dosing: the reef-pi could instruct the *5160 to ramp up to a given velocity with the intention of instructing it to ramp back down the future, then fail somehow, and leave the driver running for an indefinite amount of time (power loss, OOM, unhandled panic, etc).

So my second thought was to use the TMC2130 and an Arduino Nano to generate the step signals. The *2130's are available in 4-packs for $30 and the Nano costs $10 so it ends up being cheaper to run 2+ steppers. There's a stepper library for Arduino that can control multiple drivers simultaneously and includes features like acceleration and deceleration. The Arduino could additionally be used to read GPIO pins, which could be useful for things like preventing dosing if a fluid level sensor is triggered (or not). A serial API would be needed between the rpi and the Arduino, ideally something along the lines of "please execute N steps". On the software side, I think this would involve writing a "sketch" to drive the arduino and a driver for reef-pi.

Does this seem reasonable? Are there concerns I should be considering?
There are direct rpi drivers for steppers, either using the two hardware timers or by generating pwm (using the same timer) and using it to driver steppers employing some pwm -> stepper board. I have some sample doser and drivers for experimenting, but didn't get to it due to lack of time/compelling reasons. Most of my requirement are easily done by DC motors (ato and dosing), but I'm definitely interested in this. This is critical for unlocking precise dosing which is underpinning for titration.
Let me know if I can be of any help. Idellay, you'll endup with a driver and associated IC/board and rest of reef-pi should easily integrate with it. If that's not the case, and you think some major UI changes is required, let me know.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I figured this out. In the prometheus.yml file, you have to change the metrics_path option. Instead of this:
Code:
  # metrics_path defaults to '/metrics'
you have to put
Code:
metrics_path: /x/metrics

So the complete section of code looks like this:

Code:
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    metrics_path: /x/metrics
    # scheme defaults to 'http'.

    static_configs:
     - targets: ['ENTER YOUR REEF-PI IP ADDRESS HERE']
Thank you. I think I had mentioned this somewhere. Worth adding it in docs/guides ...
 

Aqua Gardener

Active Member
View Badges
Joined
Apr 26, 2020
Messages
241
Reaction score
198
Rating - 0%
0   0   0
Hi All, I am configuring the Kasa smart plug, and I am trying to configure the temp control to turn off my heater if the temp goes above 81 and turn it on whenever the temp goes below 78. I tried to use the macros, but it is not running the commands. I plan to use this as a fail safe if the heater should ever get stuck in the on position. Thank you!
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Hi All, I am configuring the Kasa smart plug, and I am trying to configure the temp control to turn off my heater if the temp goes above 81 and turn it on whenever the temp goes below 78. I tried to use the macros, but it is not running the commands. I plan to use this as a fail safe if the heater should ever get stuck in the on position. Thank you!
You don't need macros, just set up your temps in the temperature setup.

Screenshot_20200629-190003.png
 

-MerlyN-

New Member
View Badges
Joined
Feb 29, 2020
Messages
4
Reaction score
27
Rating - 0%
0   0   0
Hello. Still waiting for ML's goby hat, which is delayed at customs, so making very little progress with my own build.
However I set up a temp sensor for a very simple first look test. Ok, works :D
I dont get the dashboard, however. The health and temp graphs are adjusting fine. The graph for 'Temperature(historical)' does not adjust correctly. How can I fix that?
test_graph.jpg
 

Kerinin

Community Member
View Badges
Joined
Jun 8, 2020
Messages
45
Reaction score
29
Rating - 100%
1   0   0
I've been working on how to use an Arduino to drive the step/dir interface of stepper drivers, and I ran across the Firmata Protocol. Firmata is designed to allow control of an Arduino over a serial interface, for instance you can read an analog pin's value, or set a pin high/low. The protocol has extensions for a number of different features; my interest is primarily the interface for the AccelStepper library. The AccelStepper interface allows control of up to 10 steppers running on the Arduino.

Unfortunately I don't see a Go implementation of the AccelStepper interface. I'm working on a implementing the missing pieces - it doesn't look too complicated. Once that's complete, it should be possible to load the Firmata sketch onto an Arduino and then use Go to control steppers (or stepper drivers) connected to the Arduino in Go over a serial connection from the "host" computer. Planning to look at extending the reef-pi to use this communication layer once the Firmata pieces are all working.
 

SDchris

Active Member
View Badges
Joined
Mar 3, 2015
Messages
191
Reaction score
224
Location
Sydney
Rating - 0%
0   0   0
One of my priorities is minimizing stepper noise, so I've been looking at the Trinamic TMC-series stepper drivers. They claim to be able to run silently at lower speeds. The two drivers I've been looking at are the TMC2130 and TMC5160. The TMC5160 is basically a more powerful version of the TMC2130 that includes a step/ramp generator controllable via UART.

My first thought was to use the rpi's serial pins to drive the *5160, allowing multiple drivers to be controlled via a shared serial bus. The problem with the approach is that it could lead to uncontrolled dosing: the reef-pi could instruct the *5160 to ramp up to a given velocity with the intention of instructing it to ramp back down the future, then fail somehow, and leave the driver running for an indefinite amount of time (power loss, OOM, unhandled panic, etc).
If you use SPI you can access the on board motion controller TMC5160. That way you only need to send it the amount of steps you want to move and the TMC takes care of the rest. Including ramp generation and speed. That way it doesn't matter if the PI fails.

Last I looked TMC5160 step sticks don't have access to the motion controller. You need the TMC5160-bob.
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
By the way, is it planned to have actual calibration for dosing volume as part of the dosing pump settings going forward? Or is that omitted on purpose because right now the dosers can only do full second increments?
 

Kerinin

Community Member
View Badges
Joined
Jun 8, 2020
Messages
45
Reaction score
29
Rating - 100%
1   0   0
If you use SPI you can access the on board motion controller TMC5160. That way you only need to send it the amount of steps you want to move and the TMC takes care of the rest. Including ramp generation and speed. That way it doesn't matter if the PI fails.

You're right, I didn't realize until after I posted that the "target" mode could be used to drive an arbitrary number of steps (I misunderstood the "target" as describing the angle of the rotor). I still think I'm going to go the Arduino route though, mostly because it's not specific to a specific driver board. The Arduino should be able to control any stepper driver using the step/dir interface. SPI also eats up a lot of GPIO pins on the Pi, for instance I'm planning to drive 7 pumps on the project I'm currently working on.

By the way, is it planned to have actual calibration for dosing volume as part of the dosing pump settings going forward? Or is that omitted on purpose because right now the dosers can only do full second increments?

My plan was for the dosers to be controlled by "steps", and for the Pi to be responsible for translation steps into fluid volumes. So there would be a calibration in the Pi mapping a single "step" into a fluid amount, but the Arduino would only ever know about steps.
 

buddy.

Active Member
View Badges
Joined
May 16, 2018
Messages
291
Reaction score
617
Location
Australia
Rating - 0%
0   0   0
I think the most simple way is to run it through a ULN2803. This is the design I use on my dosing pump adapter. It's an open source design, and you can find files at https://github.com/Ranthalion/JebaoDosingAdapter.

It shouldn't be necessary to double up the channels on the ULN, but they are available and I've another reefer had issues with a single motor pulling much more current than expected.

C1 and R1 are totally optional. My pump is running without those, but I figured they wouldn't hurt...

1592764920144.png


1592764850454.png
Made one of these up today and it works great! Thanks for your help.
 

buddy.

Active Member
View Badges
Joined
May 16, 2018
Messages
291
Reaction score
617
Location
Australia
Rating - 0%
0   0   0
Just setup another ato controller with the upper sensor and same pump
Will do, thanks.
Another question... I guess the optical sensors need light to work properly? My sump area is very dark and the sensor can detect when the water drops but it does not detect when the sensor is submerged again, so that the ato pump stays on.
 

Bob Tiffany

Community Member
View Badges
Joined
Nov 4, 2015
Messages
33
Reaction score
17
Rating - 0%
0   0   0
I’ve been looking everywhere for help on this and I’m not finding anything online.

I’m setting up the telemetry settings in Reef Pi, specifically the Adafruit.IO settings. I’ve got my free IO account setup and I’ve entered my IO key in the Reef Pi telemetry settings, and it’s sending feeds and data to my IO account.

My problem, is there is no Equipment feed, showing which equipment is on or off. Does Reef Pi not send that data to IO? Is there something in the “Feeds” section that I’m missing?

Thanks!!
 

Bob Tiffany

Community Member
View Badges
Joined
Nov 4, 2015
Messages
33
Reaction score
17
Rating - 0%
0   0   0
To go with this question, I’ve got all of these errors on Reef Pi now, all seem to be related to equipment reporting.

497B7D21-174F-4C9C-9F63-99CF2121187C.jpeg
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
To go with this question, I’ve got all of these errors on Reef Pi now, all seem to be related to equipment reporting.

497B7D21-174F-4C9C-9F63-99CF2121187C.jpeg
It does not send equipmemt feeds.

Also for a free account it only uses 10 feeds amd you dont get to choose...it sends the first 10 setup in reef pi. The rest error out.
 

marekd1

Active Member
View Badges
Joined
Dec 24, 2019
Messages
133
Reaction score
200
Rating - 0%
0   0   0
Ranjib,

Tried to program my feeder to run on day 1,3,5,7 but it appears that day 7 is not allowed. Is this a bug or am my missing something? Please see the attached screenshots.

Also, I've noticed that some time back you have removed use of fractional seconds to full second stepping for Duration on Dosing.
Would it be possible to reenable this option as it provides more accurate means of tuning to say 1ml, 2ml, 3ml. Speed by itself does not always allow for this level of tuning. In the past I was able to select say 1.2 or 1.5, etc. seconds for duration and in conjunction with speed adjustment this worked really well. In the current one second increments I can never calibrate my pumps to 1ml, or 2ml, etc exact dosage. Instead setting turns out to be anything but like 1.3, 1.6, etc.

day 1357.JPG error day 1357.JPG
 

waynel

Active Member
View Badges
Joined
May 22, 2020
Messages
264
Reaction score
269
Location
Kentucky
Rating - 0%
0   0   0
I keep getting this error, been running over 1 week now:
1D0DC6E1-B484-47AD-96B7-4B8D74EFE806.png

The error is there for a few seconds, then goes away, and will reappear later.
 
Back
Top