Testing the NVMPG using the NuttX firmware

I used Claude’s help to reverse engineer the NVMPG firmware and to create an open-source firmware replacement using NuttX RTOS. If you don’t know about NVMPG is, it is a MPG (Manual Pulse Generator: https://en.wikipedia.org/wiki/Manual_pulse_generator ) used on DigitalDream EC300, EC500 and Novusun NVUM.

Then I installed Mach3 version 3.043.062 on an old Windows 10 computer (I don’t use Windows, but I have a laptop with it to test some softwares). After installing it I downloaded DigitalDream plugin to EC300 (file DIGITALDREAM_20230513.rar) from http://www.ddcnc.com/?m=home&c=Lists&a=index&tid=106&lang=en&page2

Then I decompressed it and copied the file DIGITALDREAM_20230513.dll to C:\Mach3\PlugIns\

If you just want to test the NVMPG this next step could be omitted because it will fake a License to Mach3 and configure the CNC inputs. If you want to do it by our own risk, download the “File Config sample” from http://i40solutions.net/document/m3link.html

This .rar file contains two config files that you can copy to C:\Mach3, the files are: Mach1Lic.dat and Mach3Mill.xml. The first if file is a license file and the second file is the EC300 configuration setting.

Now connect an Ethernet cable to your EC300 and to your computer. Configure your computer Ethernet as fixed IP. In some sites they said the IP should be 192.168.1.10 to let EC300 or 192.168.4.10. Initially I tried 192.168.1.10, but it didn’t work, only after configuring my computer with IP 192.168.4.10 the CONN LED on EC300 turned ON when I ran Mach3.

Initially you need to confirm that Mach3 found the Digital Dream plugin, so go to Config -> Config Plugins and verify if DIGITALDREAM is with the green check on it. Then double click on CONFIG of this plugin, a Dialog window will appear, change the checkbox from Standard-MPG to NV-MPG and click OK.

Before clicking on Reset button to start you need to disable to Emergency Stop (if you don’t have it connected to your EC300 yet). To do it go to: Config -> Ports and Pins, then at the Input Signals tab scroll until EStop and click on that green check to disable it. Click on Apply and OK.

Now if you click on Reset button, it will become green.

You will notice that the X, Y, Z values will appear on the NVMPG LCD screen, but when you move the wheel nothing will happen. This is because the MPG#1 is not configured correctly.

Go to Configs -> Ports and Pins and at Encoder/MPG’s tab scroll until “MPG #1” row and confirm it has the green check. Then configure “A-Port #” to 1, “A-Pin #” to 21, “B-Port #” to 1 and “B-Pin #” to 22. Click Apply and OK.

After press TAB key on main screen and it will open a MPG Mode screen, click on “Jog Mode” button until it enable the MPG yellow indicator button.

Configuring FreeCAD to export each gcode .nc file separated

1. Export one .nc file per tool

Select the Job and change these in the Property view (they’re also on the Output tab when you double-click the Job):

PropertyValue
OrderOutputByTool
SplitOutputtrue
PostProcessorOutputFile%D/%d_%S_T%T.nc

In the file name, %D is your file’s folder, %d is the document name, %S is a sequence number (0, 1, 2…) and %T is the tool number. Then run CAM → Post Process once and you get one file per tool.

2. Fix the operation order first

Profile is the first operation and cuts down to Z −42.76, which is the full stock thickness, with no tabs. Running it first cuts the part loose before any carving happens.

  • Move Profile to the end of the Operations list, so the order is Pocket3D → Pocket3D001 → Surface → Profile.
  • Add tabs to it (Dressup → Tag), or screw the blank down outside the cut line.

After reordering you get 4 files: T1 → T3 → T2 → T1 again for the cutout.

3. Changing the bit between files

Your Z zero is the top of the stock, and the roughing passes cut most of that surface away. For bits 2 and onward, zero Z on the spoilboard instead, since that never changes:

Before file 0:

  1. Measure the real board thickness T with calipers. Your FreeCAD stock is 42.76 mm, and the real board must match it.
  2. Set X/Y zero, and set Z zero on the stock top.
  3. Run file 0.

For each later file:

  1. Raise Z and stop the spindle. Leave X/Y alone and don’t re-zero them.
  2. Swap the bit.
  3. Put the touch plate (thickness P) on the spoilboard next to the part. Probe with G38.2 Z-50 F50, then send G10 L20 P1 Z{P − T}. For example, with a 42.76 mm board and a 20 mm plate: G10 L20 P1 Z-22.76. Without a probe, jog down onto paper on the spoilboard and send G10 L20 P1 Z-42.76.
  4. Raise Z, start the spindle, and run the next file.

GRBL saves G54 offsets in EEPROM, so the X/Y zero survives between files. If you’d rather keep one file, add --tool-change to the Job’s PostProcessorArgs to output real M6 lines. That only works if your sender handles M6 (CNCjs, bCNC and UGS have tool-change options).

Before you cut

  • Feed: everything comes out at F300 mm/min, which is why the Surface pass takes about 7 hours. The tool controllers are set to 5 mm/s. Your older jesus.nc had F18000, so check that the feed you run with is what you intend.
  • Spare tool controller: TC: Tapered Ball R0.5 (T15) still has feed and spindle at 0. It isn’t used now, but fix or delete it so it doesn’t get picked by mistake

Links about PTP IEEE-1588

During my investigations I discovered there are 3 ways to use PTP on microcontrollers:

1) Using a MCU with Ethernet MAC supporting PTP

2) Using a PHY that detects Start of Frame (SOF)/Start of Frame Delimiter (SFD) and generates a signal to the processor

3) An external PHY with PTP IEEE-1588 support, such as Texas Instruments DP83640


https://timebeat.app/blog/ieee-1588-explained

https://community.st.com/stm32-mcus-embedded-software-32/ethernet-hal-driver-reworked-by-st-and-available-in-22q1-preview-now-available-on-github-10052

https://community.st.com/stm32-mcus-embedded-software-32/ethernet-hal-driver-reworked-by-st-and-available-in-22q1-preview-now-available-on-github-10052

https://community.st.com/stm32-mcus-embedded-software-32/getting-started-with-ptp-ieee-1588-10702

https://www.ti.com/document-viewer/lit/html/SSZTAU5

https://www.designworldonline.com/ethernet-switch-with-ptp/

https://maisvch.com/blog/ieee-1588-ptp-vs-ntp-industrial-time-synchronization/

How to restore a Firefox session before the previous session?

I did a silly thing: I used Firefox to test the Documentation html page generated by “make html” on NuttX, then after that I closed Firefox, and run again that “firefox index.html”. Until here, it was not a problem, because I could go to: three bars (hambugers) -> History -> Restore previous session. But I forgot do to that and closed Firefox again.

Then when I opened Firefox and asked to restore previous session, it restore only that index.html page. So, before I got so desperate I decided to search on Internet and found a simple solution here:
https://support.mozilla.org/tn/questions/1408206

All I need to do it: three bars -> History -> Recently closed tabs -> Reopen all tabs