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

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,
 
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:
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.
 
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!
 
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.
 
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.
 
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
 
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:
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: 49
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
 
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 .
 
You have a driver that’s not loaded. Which driver the connector wp1 is using ? That driver is not loaded
I am using the hs300 driver
 

Attachments

  • 20220320_133228.jpg
    20220320_133228.jpg
    166.5 KB · Views: 57
If the power goes out does reef-pi automatically start controlling the tank or do you have to relog in each time?
 
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.
 
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....
 
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: 42
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.
 
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:

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • 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