Home Artists Posts Import Register

Downloads

Content

Make sure to print the mount in black otherwise light will be diffused through the mount, and washout the picture.

Rev 4:

much safer with the ribbon

Picture in zip




REV 3:

  • Made it so it's more gentle on the ribbon, less chance of accidentally breaking it
    (zip here but also in the master repo "Apollo core files rev 44.1" and later)
  • And made a tool to ajust the focal distance, safer than tweeze

REV 2:
Added a wall between the cam and light to potentially reduce glare.
Be very careful when removing the camera, disassemble everything and don't try to swap it in place (I killed mine that way), and make sure to guide the ribbon to not rip it, also left the back open, so that the camera can cool down and not trap the heat generated from itself.

There was talk of adding a little heatsink, this might not work for it yet.

If you do accidentally rip the ribbon and kill your camera, I contacted the seller about it and they added a new page to buy just the camera without the PCB to save a buck Aliexpress camera only

-----
Neopixel:
Aliexpress

Amazon

-----

Camera:

Aliexpress - FF (fixed focus) or AF (auto focus) 2952X1944 5MP ( if you accidentally break the ribbon, as I did, the seller now offers the camera alone without PCB after I contacted them Aliexpress camera only, for some reason the camera only I received only works with the first batch of camera+PCB I got, which was fine for me as that's the camera I broke, but just an FYI )


note: so now that my printer has reached quality prototype printing at 10~20K acceleration, I do notice a tiny bit of focus shift, I don't find it to be a big deal, I had not noticed such thing at 2~10K acceleration (which is a more common range of acceleration). But if you want to avoid that issue get the FF (fixed focal model).

(the link keeps changing, updated it above)

Aliexpress - AF 5MP

( was told the first link doesn't deliver to some countries but second one should and should be the same model)

(Delivery is actually relatively fast considering it's aliexpress, ordered second camera on Mar 23 and was delivered Apr 6)

5MP (4k is likely overkill, but should work, it's your gamble)

autofocus (AF)

Even in 1920x1080 (the 5MP model), I only get 8~10fps, but with a lower resolution I get 20~30fps at 800x600. Tested on a pi3b+

Pi4 or orange pi5 may be able to handle higher resolution at high FPS.

Maybe the 4K has better low light, but I wouldn't know.

-----

There are other similar cameras from other seller, but the PCB is different, and haven't tested them, so get those at your own risk.

------

This is similar to the 3DO camera you may have heard about a few months ago, and should be the same (reason I selected this one specifically), except this one has autofocus.

3DO mentioned that fixed focal is better as the camera autofocus can shift during printing, I did not notice such thing, if it's moving at 10K acceleration 500mm/s, the image is moving too fast anyway. So I still personally prefer autofocus.

This is a camera with electronic autofocus, unlike the 3DO camera ( the camera lens can be carefully rotated, counter clockwise, to shorten the focal range to be useful for a nozzle cam, and thanks to the autofocus mechanisms you can do final focus tweaks through a terminal over SSH, and save the setting in klipper, so that it's is in manual electronic focus mode, and set to the correct focus at startup)

It's easier to setup than an endoscope, and better quality.

Low light capability isn't great but with light the quality is amazing. So the current mount comes with a single neopixel PCB

This is USB on the other end so will work even with non Raspberry pi setup ( even a computer )

-----------

Installation:

- Use rev7 of the main body of the apollo

- the camera box ("nozzle cam box")

- the camera base mount ("nozzle cam base")

optional:

- if you have an UHF hotend, I included a very basic spacer to lower the setup to point at the nozzle (in rev1 zip)

- a little neopixel solder helper.

0/ setup camera for short focal.

Easiest is to plug the camera into a computer (make sure to not touch the PCB with any metal, or place it into its printed box) and run software that can display the feed, on macOS use QuickTime and in the file menu select "new movie recording", no idea for windows, if you know please post it in the comment below for others.

And with tweezer / or included tool carefully rotate the lens counter clock wise until the focal is around 35mm (1.38inches), which is about the distance from camera to nozzle.

If not careful there is a chance you breaks the focus mechanism, that is not too bad as the magnet will keep the lens in place, and you can just keep using it as a fixed focal. if you don't want to take that risk, just get the Fixed Focus  (FF) model

You can do final tweaks once installed on the Apollo, not practical but doable, but initially it requires a lot of turns so best to do it beforehand.

1 / soldering the neopixel

The neopixel has in and out solder pads. you'll want to solder 3 wires to the "in" pads.

Best is to place a bit of solder onto the pads first, and some on the wires ends, then solder everything together. Before you plug it in the board, make sure there are no shorts between the solder point.

Most BTT board can handle a few neopixels. If not you can use your pi for the signal wire and use a buck convert (5v) to power the light. Don't hesitate to ask on discordor google online, adafruit likely has tutorial to run neopixels from a pi, if you have any doubts (link should be accessible through your user settings patreon page)

Then make sure to match the wire to your board pinout (BTT has GitHub pages for all their boards).

Once I have a dual neopixel model and you want to use it you would solder the "out" pads of the first one to the "in" pads of the second one.

2/ Install on Apollo / Apollo mini

The camera will be placed into its little box, one side is a bit shorter for ribbon, and then carefully slid into the base, only one way in, careful with the ribbon cable.

Ribbon will go on the left side of the apollo vertically, loop back down and back up and then over behind the left fan, and into the PCB, then USB from PCB will got up the back left cable channel, I don't recommend going through the cable chain, better just go along the reverse bowden tube.

Neopixel wires will go to the right and up on the right side of the front fan and join the front fan/left fan wires. That can go through the cable chain.

=========================

3/ Klipper setup

on the web interface edit the crowsnest.cfg to match what I have further below.

if you have a fluidd setup is through a webcam.txt, or install ustreamer (https://github.com/pikvm/ustreamer, crowsnest on mainsail is a fork of that, integrated into klipper)

Set resolution to 800x600 and fps to 60, mjpg and over USB

------------

crowsnest.cfg:

[crowsnest]

log_path: ~/printer_data/logs/crowsnest.log

log_level: verbose                      # Valid Options are quiet/verbose/debug

delete_log: false                       # Deletes log on every restart, if set to true

[cam 1]

mode: mjpg                              # mjpg/rtsp

port: 8080                              # Port

device: /dev/video0                     # See Log for available ...

resolution: 800x600                # widthxheight format

max_fps: 60                             # If Hardware Supports this it will be forced, ohterwise ignored/coerced.

#custom_flags:                          # You can run the Stream Services with custom flags.

v4l2ctl: focus_automatic_continuous=0,focus_absolute=530  # Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of.

-------

and add the camera using the settings,

Use "Adaptive MJPEG streamer", which may be the default anyway, but it allows 90degree rotation of the video through the web interface.

------

To figure out the correct focus (value between 0 and 1023)

Over SSH (terminal or Putty)

v4l2-ctl -d /dev/video0 -c focus_automatic_continuous=0

v4l2-ctl -d /dev/video0 -c focus_absolute=200

And try different values (only second line, no need to re-set focus_automatic_continuous again),

Finally edit the focus_absolute with the value you found to be good in crowsnest.cfg

If you don't have crowsnest.cfg, you can setup a crontab script to set that up for you at boot after delay. running the two command above, with adjusted focus value for your setup

-----

if the focal is too close, rotate the lens clockwise, if too far counterclockwise

-----

For debugging, these are interesting commands to know, and that I used to figure this all out.

v4l2-ctl -d /dev/video0 --all

and this to list available resolution

v4l2-ctl -d /dev/video0 --list-formats-ext

-----

if focus_automatic_continuous, gives you an error try:

v4l2-ctl -d /dev/video0 -c focus_auto=0


----

on my second printer, the camera would work a half a second, then stop and Strat again a few seconds later, no idea what was wrong, tried different camera, but a full reinstall of klipper with fresh OS fixed it, so had to be something with the camera driver or linux.