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 can reproduce this. Looking into it. I dont know why this is happening, will report back soon (suspect some UI bug must have gone through)


Here are the details :
Delay, is in nano second. It is the pause in between steps. For micro stepping, it will be divided by the appropriate micro step level. By default it is 20800000.
All pins are required right now, as the underlying driver currently requires all those pins. You are right, most of it could be done out of band, but those are specific cases. The initial version for experimenting needs to support all of it. As we understand the user experience, we can make it simpler, and just require one pin or so.. those will be special case of this driver.
I had tested with 42 stepper motor.



https://github.com/reef-pi/reef-pi/blob/main/controller/modules/doser/stepper.go#L25
Ok, i understand now what is happening. The dc motor settings are not set, and the errors are about that. It should not error in first place (thats one bug), and by any reason if UI error appears, it should show the details of the error (thats another bug). While I work on fixing this, you can by pass the error by selecting the dc motor and filling out (duration and speed) and then reselect the stepper driver it should let you save.
thank you for testing it out,
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
Yeah, got it to save the settings by saving a DC doser first and then editing it to change to stepper. Btw, is he volume field in DC motor mode functional and we can now calibrate volume for those somehow, or is that just an artifact of the new UI? Come to think of it, that won't mess with existing doser configs or will it if those configs are untouched from before the update to 5.2?

Anyway, I got it to consistently move my stepper, although not how i expected it. With Microsteppings 1/16 and 1/32, setting delay to 1 million or 5 million (which if that is supposed to be nanoseconds, should be 1ms and 5ms for a full step respectively right?) the motor would block. Setting it to values between 1000 and 50000 would work, but consistently gives the wrong degree of rotation (too much). Probably because that is so fast that there are weird effects going on with the limit of the pi's effective switching speed. But 5/16ms = 3.2 kHz pulses shouldnt be too fast for the pi right? Definitely not too fast for my driver/stepper pair, had them running faster with arduino, even without speed ramping. But i don't know if this is due to unreliable jumper wires, limitations of the pi, or some other issue, and I don't have an oscilloscope to check.

Can someone with an oscilloscope and preferably a pi zero confirm where the speed limit (delay value) is at which the step signal gets corrupted? And what is the pulsewidth of the step signals?


Why is the selection in nanoseconds btw, are you expecting high megahertz or low gigahertz switching speeds in some application?
 
Last edited:

Martin Lowry

Community Member
View Badges
Joined
Sep 19, 2017
Messages
60
Reaction score
66
Location
Dover, NH
Rating - 0%
0   0   0
I was having a similar issue with my flow meter, it was showing incorrectly. It was 100 times higher than it should have been.

So, simple math fixed it.. (by the way, I was stationed at Pease AFB in the late 1980's)
1647564959040.png
@GaryE Ha! small world. I've been in Dover since 95. Long story, but originally from London.
 

DWKDiver

Community Member
View Badges
Joined
May 18, 2021
Messages
44
Reaction score
42
Location
Georgia
Rating - 0%
0   0   0
Nice job, thanks for all your efforts. I think this is a great start for steppers and like the method you've used, I also don't mind the settings where they are, seems to make sense, select stepper and you get all the settings.

As others have reports there is a bug when adding one, I noticed if I changed pump type to "DC motor" it was complaining for "duration" and "speed". If something is put in these fields, then switched back to "Stepper" you can save it ok.

For down the road it would be nice to have a selection or setting of "Don't Use" for direction and micro stepping pins. :)


That might seems like a good idea but IMO I2C or SPI should only be used when absolutely necessary. It was never designed to leave a circuit board and is very susceptible to noise and interference. Using GPIO's are by far the most reliable method for DIY.
Boards like Grove board with its own logic chip? Just tell the board what to do and it does it till you tell it to stop. It's basically an arduino running a driver. Which may have to be done as its been awhile since I looked at the Grove board and they are now less plentiful than a $15 rpi zero w!
 

DWKDiver

Community Member
View Badges
Joined
May 18, 2021
Messages
44
Reaction score
42
Location
Georgia
Rating - 0%
0   0   0
Maybe there are good ones with i2c capabilties, the trinamic ones sadly only have uart which isn't much help when looking at multiple steppers at the same time, but i really wouldn't recommend using L293 as stepper "drivers". At least not if you are going to be in the same room. That's worse than a4988 and those are already loud.

I don't know what the best way forward is, maybe it is an arduino based pin extender/ arduino based doser controlled by the pi, some other kind of expansion, or maybe we just have to cram in as much to the pins we have as we can, with the current way of doing things all we really need is 1 pin per pump to run a doser, 2 if we want to run a pump in both directions, the rest can be hardwired

edit: come to think of it, there are some with SPI, but that wouldn't really save on pins either due to the need for chip select
My DC doser is pretty dang loud. Especially if I pwm it.
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
Boards like Grove board with its own logic chip? Just tell the board what to do and it does it till you tell it to stop. It's basically an arduino running a driver. Which may have to be done as its been awhile since I looked at the Grove board and they are now less plentiful than a $15 rpi zero w!
I don't know much about Grove, there's too many to keep track of. You shouldn't need it though as the drv8825 stepper driver will connect directly to GPIO's on the 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
Yeah, got it to save the settings by saving a DC doser first and then editing it to change to stepper. Btw, is he volume field in DC motor mode functional and we can now calibrate volume for those somehow, or is that just an artifact of the new UI? Come to think of it, that won't mess with existing doser configs or will it if those configs are untouched from before the update to 5.2?

Anyway, I got it to consistently move my stepper, although not how i expected it. With Microsteppings 1/16 and 1/32, setting delay to 1 million or 5 million (which if that is supposed to be nanoseconds, should be 1ms and 5ms for a full step respectively right?) the motor would block. Setting it to values between 1000 and 50000 would work, but consistently gives the wrong degree of rotation (too much). Probably because that is so fast that there are weird effects going on with the limit of the pi's effective switching speed. But 5/16ms = 3.2 kHz pulses shouldnt be too fast for the pi right? Definitely not too fast for my driver/stepper pair, had them running faster with arduino, even without speed ramping. But i don't know if this is due to unreliable jumper wires, limitations of the pi, or some other issue, and I don't have an oscilloscope to check.

Can someone with an oscilloscope and preferably a pi zero confirm where the speed limit (delay value) is at which the step signal gets corrupted? And what is the pulsewidth of the step signals?


Why is the selection in nanoseconds btw, are you expecting high megahertz or low gigahertz switching speeds in some application?
Golang uses nanoseconds as the duration unit . I don’t know what the limits will be or if it’s sensible to have it in nano seconds. i can always switch it to milli or micro second later, if thats more suitable
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Almost complete. Just need to add a webserver to allow setting temp and hysteresis.

It's all working, emitting metrics and whatnot. Even has an endpoint to reboot the ESP32 from the web browser.

If you want to try it out or help make it better... https://github.com/indymx/TpLInk-Arduino

The webserver for setting the set temp is working.. Just needs a bit of polish and it'll be ready to put into production!

1647716244455.png


1647719951065.png
1647719924786.png
 
Last edited:

Dave's Reef

Active Member
View Badges
Joined
Nov 4, 2018
Messages
102
Reaction score
150
Rating - 0%
0   0   0
Eh I prefer vi but nano will work ;)

I would add those to command at the end of the unit section and not at the bottom. Here is what the file looks like now:

Code:
[Unit]
Description=raspberry pi based reef tank controller

[Service]
ExecStart=/usr/bin/reef-pi daemon -config /etc/reef-pi/config.yaml
WorkingDirectory=/var/lib/reef-pi
Restart=always
RestartSec=90
StartLimitInterval=400
StartLimitBurst=10

[Install]
WantedBy=multi-user.target

How I think you want it to look like:
Code:
[Unit]
Description=raspberry pi based reef tank controller
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/bin/reef-pi daemon -config /etc/reef-pi/config.yaml
WorkingDirectory=/var/lib/reef-pi
Restart=always
RestartSec=90
StartLimitInterval=400
StartLimitBurst=10


[Install]
WantedBy=multi-user.target

You don't have to reboot just do this command and you will be good...

Code:
sudo systemctl daemon-reload
I finally got around to trying this and I am still having to reload reef-pi to get the wifi plugs to work. Any thought on this?
 

Attachments

  • 20220320_102126.jpg
    20220320_102126.jpg
    215.3 KB · Views: 48

Vnomus

Community Member
View Badges
Joined
Aug 22, 2020
Messages
89
Reaction score
113
Location
Jeffersonton
Rating - 0%
0   0   0
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 finally got around to trying this and I am still having to reload reef-pi to get the wifi plugs to work. Any thought on this?
You have a driver that’s not loaded. Which driver the connector wp1 is using ? That driver is not loaded
 
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
Just posted this up DYI Rollermat Filter, designed in Tinkercad...
Looks awesome. What’s the rpm of the motor ? You will cover the dc motor , or plan to keep it exposed.
I was thinking of using plexiglass or acrylic sheets for some of the housing , and 3D print rest .
 

Matt Carden

Valuable Member
View Badges
Joined
Apr 13, 2018
Messages
1,647
Reaction score
4,086
Location
Detroit Metro
Rating - 0%
0   0   0
If the power goes out does reef-pi automatically start controlling the tank or do you have to relog in each time?
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
If the power goes out does reef-pi automatically start controlling the tank or do you have to relog in each time?

It restarts as long as the SD card does not get corrupted. But that's a very real possibility with RPi. If you are prepared though, it's not a very difficult thing to recover from.
 

Vnomus

Community Member
View Badges
Joined
Aug 22, 2020
Messages
89
Reaction score
113
Location
Jeffersonton
Rating - 0%
0   0   0
Looks awesome. What’s the rpm of the motor ? You will cover the dc motor , or plan to keep it exposed.
I was thinking of using plexiglass or acrylic sheets for some of the housing , and 3D print rest .
It's 12v 6rpm. I haven't covered the motor but it's probably not a bad idea....
 

stefanm

Active Member
View Badges
Joined
Oct 11, 2017
Messages
360
Reaction score
397
Location
Sweden
Rating - 0%
0   0   0
I'm having an issue, my temperature sensors are no longer showing on reef-pi, it probably happened after a long power cut approximately 6 days ago, subsequently I updated reef-pi to 4.2, still no luck. If I click edit on the laptop nothing happens, on my mobile i can access but sensors aren't showing.

Any ideas where to start?
 

Attachments

  • IMG_20220321_201048063_HDR.jpg
    IMG_20220321_201048063_HDR.jpg
    137.8 KB · Views: 41

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,591
Reaction score
1,590
Rating - 0%
0   0   0
It restarts as long as the SD card does not get corrupted. But that's a very real possibility with RPi. If you are prepared though, it's not a very difficult thing to recover from.
I forgot what i did exactly, but i changed something somewhere so the "dirty bit" is ignored or automatically repaired or whatever and I went from corrupt SD card every 2nd to 3rd power cut to never having had that problem since with numerous powercuts.

It's disabling a safety feature, but i'm not really worried about corrupt data on my pi i am worried about reefpi not running.
 

DWKDiver

Community Member
View Badges
Joined
May 18, 2021
Messages
44
Reaction score
42
Location
Georgia
Rating - 0%
0   0   0
FYI

My DC dosers do not work with 5.2 version. Deleted readded restarted ... no go.
Updated back to 5.1 ... no problems. DC dosers working fine. I rebooted.

At least the dosers are now working.
 
Last edited:

HAVE YOU EVER KEPT A RARE/UNCOMMON FISH, CORAL, OR INVERT? SHOW IT OFF IN THE THREAD!

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top