{"id":212,"date":"2019-02-10T22:06:46","date_gmt":"2019-02-10T10:06:46","guid":{"rendered":"https:\/\/collingwood.me.uk\/blog\/?p=212"},"modified":"2019-04-07T20:19:07","modified_gmt":"2019-04-07T08:19:07","slug":"raspberry-pi-and-the-nanodlp-shield-v1-1","status":"publish","type":"post","link":"https:\/\/collingwood.me.uk\/blog\/index.php\/raspberry-pi-and-the-nanodlp-shield-v1-1\/","title":{"rendered":"Raspberry Pi and the nanoDLP Shield v1.1"},"content":{"rendered":"
07 Apr 2019 – Update<\/strong> – nanoDLP now natively supports the Nextion (In Beta at the moment, but the beta runs nice and stable). Accordingly, the procedure has been updated<\/p>\n I am in the process of rebuilding my Wanhao D7, which includes dumping the Wanhao logic board and replacing it with a Raspberry Pi, putting a 4.3 inch Nextion touchscreen in the front panel and replacing the utterly useless UV light source with a full size array.<\/p>\n This post deals with the first two items.<\/p>\n I got myself a Fysetc nanoDLP shield (v.1.), which seems pretty cool and well designed. Unfortunately, it’s not all that well documented, so I’ve gone through the pain of getting it running, and documented it here, so you don’t have to.<\/p>\n A few notes: 1. Prepare the Shield<\/strong><\/p>\n Setting the correct reference voltage for current limiting is absolutely essential, as the entire system will shut down if the current limit is set too high. This is a major cause of people giving up on these shields early on in the game<\/p>\n 1.1. The shield uses a DRV8825 stepper driver. Conventional wisdom out on the web suggests using the following formula to get the correct current limiting:<\/p>\n However, for these shields, that formula is INCORRECT!<\/strong> The reason for this is simple; The standard Pololu style drivers using these chips usually use 0.1 Ohm sense resisters. However, these shields use 0.01 Ohm sense resisters, so the correct formula is:<\/p>\n 2. Install and update nanoDLP<\/strong><\/p>\n 2.1. Install nanoDLP on an SD card, following the instructions on the nanoDLP website<\/p>\n 2.2. Insert it in the Pi and power it. After a while you should be able to get the webpage up. It shouldn’t matter what distribution you choose as we will load a machine profile later, but just for simplicity choose the nanoDLP generic version. The Pi will reboot 2.3. Once it has rebooted, click on the Setup then Tools tabs. Click on the Expand Filesystem button. The Pi will reboot. This will take a while and it depends on the size of your SD card 2.4. Once it has rebooted, click on the Setup then Tools tabs again. Click on the Upgrade nanoDLP button. in the new page, click on the “Upgrade to latest beta version” button. After a while, the Pi will reboot 2.5. By default, the shield turns on the UV lamp on power up, and only turns it off once nanoDLP has booted and taken control. There is now a possibility to turn it off by setting the relevant GPIO to an output and driving it low at boot time. This usually requires a firmware update as the nanoDLP firmware does not have this facility.<\/p>\n SSH onto the Pi We can see from this particular output that the build date is 16\/03\/2018 (I use the correct format for a date, DD\/MM\/YYYY, not the stupid American one). If the build date is earlier than 21\/03\/18, update it:<\/p>\n Reboot the Pi: 2.6. Update the OS \u2013 SSH into the Pi and run the following commands:<\/p>\n Reboot the Pi: 3. Prepare the boot config for HDMI, GPIO and Nextion. <\/strong><\/p>\n Note that the HDMI section is for a 2k LCD panel \u2013 you will have to change it to suit your particular panel<\/p>\n 3.1. Edit \/boot\/config.txt and add the following to the end of the file<\/p>\n # Set up the GPIO that controls the UV array as # Addition for Nextion screen # CAMERA SETTINGS ( 1 = ON, 0 = OFF) # DISPLAY SETTINGS Reboot the Pi: You will notice that the blue LED next to the power terminals goes out on reboot. This is a good thing, it means that UV output is turned OFF.<\/p>\n 3.2. Set up the serial interface and localisation Scroll down to \u201cLocalisation Options\u201d and hit enter<\/p>\n When done, hit the Tab key to get to the bottom row and the right arrow key to select back.<\/p>\n When back in the main config screen, scroll down to \u201cInterfacing Options\u201d and hit enter<\/p>\n Scroll down to \u201cSerial\u201d and hit enter. Select \u201cNo\u201d for the first question:<\/p>\n Select \u201cYes\u201d for the second question:<\/p>\n Hit enter when presented with the selection feedback screen:<\/p>\n Use the Tab key to access the bottom selections, select \u201cFinish\u201d and hit enter.<\/p>\n Hit enter to reboot:<\/p>\n 3.3. Disable Bluetooth:<\/p>\n Reboot the Pi: 3.4. Disable the console:<\/p>\n Edit \/boot\/cmdline.txt. It will look something like this<\/p>\n remove any console entries, so that it becomes similar to this:<\/p>\n Reboot the Pi: 3.5. Update the firmware on the Nextion screen – Download the correct TFT file from the nanoDLP Download page for your screen, copy it to an SD card, insert the SD card in the SD card reader of the screen (NOT the Raspberry Pi) and power on the screen. Updating will take just a few seconds, and the screen will tell you when it’s done.<\/p>\n 4. Set up nanoDLP to use the shield and Nextion<\/strong><\/p>\n Connect to nanoDLP using your web browser. Click \u201cSetup\u201d and select \u201cMachine Settings\u201d<\/p>\n 4.1. Printer Settings 4.2. Movement GPIOs 4.3. 3D Printer Board 4.4. Codes 4.5. Shutter 4.6. Display 4.7. Platform\/Resin 4.8. Motor 4.9. Camera Module 4.10. AMLCD 4.11. Physical Buttons 4.12. Hardware Fault Detection 4.13. Various Settings Don\u2019t forget to hit the Submit button<\/p>\n","protected":false},"excerpt":{"rendered":" 07 Apr 2019 – Update – nanoDLP now natively supports the Nextion (In Beta at the moment, but the beta runs nice and stable). Accordingly, the procedure has been updated I am in the process of rebuilding my Wanhao D7, … Continue reading
<\/a><\/p>\n
\n\u2022 These instructions are for a Raspberry Pi 3 Model B. They may not work for other models
\n\u2022 The shield provides power to the Raspberry Pi. You do not have to apply power separately to the Pi
\n\u2022 When setting the motor reference voltage, measure between ground and the potentiometer wiper.
\n\u2022 For some applications (Like replacing the Wanhao D7 mainboard), you will need to reverse the motor direction
\n\u2022 Right at the end of all of this, I had to update nanoDLP again from the browser as per step 2.4 in order to get the Z motor to work<\/p>\nVREF = Current\/2<\/code><\/p>\nVREF = Current\/20<\/code><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nCheck the firmware:<\/p>\npi@raspberrypi:~ $ sudo \/opt\/vc\/bin\/vcgencmd version
\nMar 16 2018 16:21:29
\nCopyright (c) 2012 Broadcom
\nversion db815f3ae3dc88cf21fed2765f3b25d9d2bea67a (clean) (release)
\npi@raspberrypi:~ $<\/code><\/p>\npi@raspberrypi:~ $ sudo rpi-update
\n*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
\n*** Performing self-update
\n*** Relaunching after update
\n*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
\n#############################################################
\nThis update bumps to rpi-4.14.y linux tree
\nBe aware there could be compatibility issues with some drivers
\nDiscussion here:
\nhttps:\/\/www.raspberrypi.org\/forums\/viewtopic.php?f=29&t=197689
\n##############################################################
\n*** Downloading specific firmware revision (this will take a few minutes)
\n% Total % Received % Xferd Average Speed Time Time Time Current
\nDload Upload Total Spent Left Speed
\n100 168 0 168 0 0 25 0 --:--:-- 0:00:06 --:--:-- 42
\n100 56.2M 100 56.2M 0 0 1213k 0 0:00:47 0:00:47 --:--:-- 2105k
\n*** Updating firmware
\n*** Updating kernel modules
\n*** depmod 4.14.97-v7+
\n*** depmod 4.14.97+
\n*** Updating VideoCore libraries
\n*** Using HardFP libraries
\n*** Updating SDK
\n*** Running ldconfig
\n*** Storing current firmware revision
\n*** Deleting downloaded files
\n*** Syncing changes to disk
\n*** If no errors appeared, your firmware was successfully updated to 883750dcbdfb4be32d6bc579258a07c9f664ea77
\n*** A reboot is needed to activate the new firmware
\npi@raspberrypi:~ $<\/code><\/p>\n
\npi@raspberrypi:~ $ sudo reboot<\/code><\/p>\npi@raspberrypi:~ $ sudo unlink \/etc\/dhcpcd.conf
\npi@raspberrypi:~ $ sudo cp \/boot\/nanodlp-dhcp.txt \/etc\/dhcpcd.conf
\npi@raspberrypi:~ $ sudo apt-get update
\npi@raspberrypi:~ $ sudo apt-get upgrade
\npi@raspberrypi:~ $ sudo ln -s \/boot\/nanodlp-dhcp.txt \/etc\/dhcpd.conf<\/code><\/p>\n
\npi@raspberrypi:~ $ sudo reboot<\/code><\/p>\n# Additions for NanoDLP Shield v1.1 and Nextion<\/code><\/p>\n
\n# an output and drive it low as soon as possible
\n# after power up.
\n# This gets around the default shield behaviour
\n# of turning on the array and leaving it on until
\n# NanoDLP is loaded.
\n# *** Requires firmware with a build date of 21\/03\/18 or later ***
\ngpio=5=op,dl<\/p>\n
\ndtoverlay=pi3-disable-bt<\/p>\n
\n#start_x=1
\ndisable_camera_led=1<\/p>\n
\ndisplay_rotate=0x10000
\nhdmi_force_hotplug=1
\nhdmi_timings=1440 0 50 10 35 2560 0 4 2 2 0 0 0 50 0 198000000 0
\nhdmi_group=2
\nhdmi_mode=87
\nhdmi_pixel_freq_limit=500000000
\nhvs_priority=0x32ff
\nmax_framebuffer_width=1440
\nmax_framebuffer_height=2560
\nframebuffer_width=1440
\nframebuffer_height=2560
\nframebuffer_depth=24
\nframebuffer_ignore_alpha=1
\nconfig_hdmi_boost=4
\ngpu_mem=192<\/p>\n
\npi@raspberrypi:~ $ sudo reboot<\/code><\/p>\n
\npi@raspberrypi:~ $ sudo raspi-config<\/code><\/p>\n
<\/a><\/p>\n
<\/a><\/p>\n
<\/a><\/p>\n
<\/a><\/p>\n
<\/a><\/p>\n
<\/a><\/p>\n
<\/a><\/p>\n
<\/a><\/p>\npi@raspberrypi:~ $ sudo systemctl disable hciuart<\/code><\/p>\n
\npi@raspberrypi:~ $ sudo reboot<\/code><\/p>\ndwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=b94f2c65-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait<\/code><\/p>\ndwc_otg.lpm_enable=0 root=PARTUUID=b94f2c65-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait<\/code><\/p>\n
\npi@raspberrypi:~ $ sudo reboot<\/code><\/p>\n
\n
<\/a><\/p>\n
\n
<\/a><\/p>\n
\nDon\u2019t bother setting anything here. Enabling GPIOs in the step above disables this section<\/p>\n
\nYou will need to add codes specific to your printer here. I can\u2019t tell you what they will be<\/p>\n
\n
<\/a><\/p>\n
\nYou will need to add entries specific to your screen here. I can\u2019t tell you what they will be. In order to save all of the settings you make in this section, you must at least set XY resolution<\/p>\n
\nYou will need to add entries specific to your screen here. I can\u2019t tell you what they will be.<\/p>\n
\nYou will need to add entries specific to your screen here. I can\u2019t tell you what they will be.<\/p>\n
\nLeave as is<\/p>\n
\nLeave as is<\/p>\n
\nLeave as is<\/p>\n
\n
<\/a><\/p>\n
\nIf you are using a remote instance of nanDLP to slice, set the IP address and port. Set the Nextion port address.<\/p>\n