Author Topic: DDCSV1.1 4 Axis controller  (Read 39770 times)

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #525 on: April 15, 2017, 06:12:01 PM »
Very clever.
Did you answer me? previous question ...
I've got more professional controller.
I help you?Link e-mail went
You need him?
Thanks!
I am sure these changes could be made to the new firmware we are developing.
But this will take some time.
The link I received does unfortunately not work.
Yes, I need it.

Just as a sidenote, my 3-axis controller has stopped working after tampering with the USB bootloader. I have to note that this is a hardware problem, not a software one. If anyone tries to connect to the controller via USB gadget, bootloader mode, be very careful!  :zap:
I was as careful as I could and the first time I temporarily damaged my USB port and the second time I killed the serial usart port that I desperately need to work on the project.
I will now see if I can compile a kernel module for USB serial support to spawn a getty shell on said USB adapter.

Best Regards,
Benedikt

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #526 on: April 16, 2017, 06:42:11 AM »
:update:
This would surely not be MadModder if we couldn't fix our own stupid misstakes, or at least find a bodge that works around the issue.

So:
I have compiled kernel modules for USB Serial (and ethernet, which doesn't work unfortunately). This way, I can access the controller again and continue working.

If anyone wants to access the DDCSV1.1's system console, you can now do so when you extract the attached zip archive onto the root of an USB stick.
It will load the drivers for generic USB serial adapters and specially Prolific PL2303 adapters such as this one:
https://www.amazon.com/iKross-Serial-Converter-Adapter-chipset/dp/B00ECUEO06/ref=sr_1_1?ie=UTF8&qid=1492338885

You connect this cable and the USB stick to the USB port of your DDCSV1.1 (you will have to use a USB hub) and then reboot the controller. Now you can connect the end of the serial cable through a nullmodem cable to a PC. If you connect at 115200 8N1 you will be greeted with a root shell.
« Last Edit: April 16, 2017, 07:09:33 AM by Benedikt M. »

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #527 on: April 16, 2017, 12:06:03 PM »
And another  :update:

I have just released a new firmware version that features the following:
- Using an USB (wireless) keyboard/numblock as wired/wireless jog control, for browsing the interface and for entering numbers (thanks to iocapa for the disassembly!)
- Support for USB hubs
- Support for USB serial adapters (if you boot with the adapter from the previous post, you can access the system's shell)
- Many improvements under the hood and improved overall stability
- The file manager is now better structured and easier to navigate

It can be downloaded from here:
https://www.bmuessig.eu/secure/data/CNC/DDCSV11/install-mod-20170416.zip

Regards,
Benedikt
« Last Edit: April 16, 2017, 02:37:41 PM by Benedikt M. »

Offline PPRINT

  • Jr. Member
  • **
  • Posts: 28
  • Country: us
Re: DDCSV1.1 4 Axis controller
« Reply #528 on: April 16, 2017, 02:14:22 PM »
This thread, and all the work you are doing  Benedikt is just amazing.

Can you think of a way to we could possibly use a tablet connected to USB port as the program storage location instead of just a USB stick.

Not sure if that is the correct way to ask that...but I want to be able to connect an android tablet and write short lines of code in a text editor app and have the DDCSV1.1 access it and run it as a program.  Think of it as a form of MDI (Manual Data Input) mode that most other cnc controllers have.

Just a thought.

Rob
The afternoon knows what the morning never suspected.

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #529 on: April 16, 2017, 04:38:27 PM »
This thread, and all the work you are doing  Benedikt is just amazing.

Can you think of a way to we could possibly use a tablet connected to USB port as the program storage location instead of just a USB stick.

Not sure if that is the correct way to ask that...but I want to be able to connect an android tablet and write short lines of code in a text editor app and have the DDCSV1.1 access it and run it as a program.  Think of it as a form of MDI (Manual Data Input) mode that most other cnc controllers have.

Just a thought.

Rob
Thanks!

What you could try is to use bluetooth and two adapters:
http://www.ebay.com/itm/HC-06-Bluetooth-to-UART-Converter-COM-Serial-Communication-Slave-Mode-/322204273650
http://www.ebay.com/itm/USB-To-RS232-TTL-PL2303HX-Auto-Converter-Module-Converter-Adapter-5V-3-3V-Output-/322078351868?hash=item4afd5da1fc:m:mS9_9OKrhwKy7djmkbe8Qhw

You will need to connect it like this:
Code: [Select]
PL2303    HC-06
---------------
RX        TX
TX        RX
3.3v      VCC
GND       GND

If you then connect the PL2303 to the DDCSV1.1 through a USB hub (you can just put the hub series with the front panel USB jack), you will be able to access the CNC remotely via Bluetooth.
Someone could always write a small app that makes communication easier, but essentially this is all it takes to upload and manage files remotely from a tablet.
There are Bluetooth serial terminals available which should allow you to get access to the Linux shell on the controller.

If your tablet is rooted, you can always use two PL2303 adapters with the same wiring as above, but with the 3.3v/VCC disconnected, to have a wired connection.
You will need to plug one end into the USB port of your tablet.

IIRC, this does not work with iPads. A Windows tablet will allow both approaches without modifying the OS.

Regards,
Benedikt

Offline iocapa

  • Newbie
  • *
  • Posts: 4
  • Country: ro
Re: DDCSV1.1 4 Axis controller
« Reply #530 on: April 18, 2017, 09:06:12 AM »
Hello again.
Made some progress in the reverse engineering of the FPGA stuff. Rewrote the motiondev driver and included some sniffing code (just waiting for my unit so i can JTAG probe it to dig deeper).
In the mean time, i wanted to say that if someone screws their unit beyond repair, not to throw it away. Some reverse engineering of the connections under the FPGA would be of great help (or a schematic if anyone has one  :drool: ). This would be helpful because there are still some unknown topics about the NVRAM chip/FPGA connection.

Offline awemawson

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5083
  • Country: gb
  • East Sussex, UK
Re: DDCSV1.1 4 Axis controller
« Reply #531 on: April 18, 2017, 10:41:31 AM »
Can't you X-Ray it to see those hidden connections - someone must work in a hospital  :ddb:
Andrew Mawson
East Sussex

Offline iocapa

  • Newbie
  • *
  • Posts: 4
  • Country: ro
Re: DDCSV1.1 4 Axis controller
« Reply #532 on: April 18, 2017, 12:55:35 PM »
Yeah.. that would work also. Though i think there are more chances that someone will brick their unit than having access to a high resolution x-ray scanner. I think standard film based devices would not work. You need a machine with a ccd sensor (maybe like the ones used in airports). Even if so, it would still be hard do decipher all the connections.

Offline awemawson

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5083
  • Country: gb
  • East Sussex, UK
Re: DDCSV1.1 4 Axis controller
« Reply #533 on: April 18, 2017, 01:18:32 PM »
I don't know the internal technology of the modern FPGA's but I suppose that there is also the possibility of erasing the programmed linkages ?

(just a caveat from a cautious old foggy  :ddb: )

Andrew Mawson
East Sussex

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #534 on: April 18, 2017, 01:19:48 PM »
I don't know the internal technology of the modern FPGA's but I suppose that there is also the possibility of erasing the programmed linkages ?

(just a caveat from a cautious old foggy  :ddb: )
Yes, the FPGA reads it's gate configuration from a flash chip on the PCB into it's internal RAM on boot.
The flash can be rewritten, but I think it is not possible to read the flash.

Offline iocapa

  • Newbie
  • *
  • Posts: 4
  • Country: ro
Re: DDCSV1.1 4 Axis controller
« Reply #535 on: April 18, 2017, 01:58:57 PM »
You can read the flash with some jtag adapter, although the binary is really useless. There is no chance at reverse engineering from FPGA bitstreams (at least with the tools available now).

Offline BrokenEye

  • Jr. Member
  • **
  • Posts: 30
  • Country: gb
Re: DDCSV1.1 4 Axis controller
« Reply #536 on: April 19, 2017, 03:10:34 AM »
You can read the flash with some jtag adapter, although the binary is really useless. There is no chance at reverse engineering from FPGA bitstreams (at least with the tools available now).

And there is no way to tell if any IP's have been used, like a NIOS processor , trying to decipher the routing would be pretty much impossible to do, as they will have been optimised for timing and power usage, I certainly wouldn't attempt it  :bang:
Backup, then Backup the Backup then Backup again

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #537 on: April 19, 2017, 03:14:09 AM »
Benedikt, can the USB port support a HAL/HID keyboard with Pandora? If so i can program a Teensy for a custom layout mini panel keyboard with screen ref buttons and feed/ spindle override knobs. Pandora would just need to be able to map a keyboard input to functions. This way we have quick access to functions.
Now you actually can  :thumbup:

I have just read the datasheet of the configuration flash and it seems like it can actually be read out.
I was initially thinking these specific FPGA flash chips would have encryption or at least some kind of IP protection, but this appears not to be the case.
The datasheet can be found here: https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/cfg/cyc_c51014.pdf

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #538 on: April 21, 2017, 04:47:00 AM »
Good news, I have reverse-engineered the keypad driver and written an open source replacement.
There is still a little hardware revision specific code left to be included, but the basic functionality is now finally there  :D

Hint, the original driver was absolute rubbish. I have greatly improved on it and fixed some evil bugs.

I have published my current reverse-engineering progress in this repository:
https://github.com/bmuessig/Pandora-Reverse-Engineering

And the driver can be found here:
https://github.com/bmuessig/pdkeypad

This is the second big step to an completely open source DDCSV1.1 after iocapa's rewritten motion driver.

Regards,
Benedikt

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #539 on: April 24, 2017, 01:21:44 PM »
The driver is progressing fine. Soon the keypad will be driven by my open source driver.
Digging through my documentation I figured a way to eventually upgrade the operating system on every controller (this includes the splash screen) from within Linux.
This is still not yet researched very well and would require a lot of work to actually perform well and reliable.
This discovery also led to the creation of the flash image dumper which copies the contents of the NAND memory chip to the attached USB stick.
Since I know that 4-axis controllers, 3-axis controllers and the RATTM model have different NAND contents, I need your help to get the software working on every system alike.
Please, if that person had 5 minutes, could someone with a 4-axis and someone with a RATTM system please run the image dumper attached to this post and provide me with the resulting nand.img file?
This would really help speed up development and check the differences between the different models.

The attached utility should not harm your controller and will not leave any permanent modifications.
After running it, it is enough to delete the ndutils folder and the startup.done file from the USB stick to free up the few KB that the dumper needs.
To execute the utility, simply extract the zip file onto an USB stick and reboot the controller with the stick inserted. The controller will now guide you through the automated process.

Kind regards,
Benedikt

Offline m_c_t

  • Newbie
  • *
  • Posts: 3
  • Country: hu
Re: DDCSV1.1 4 Axis controller
« Reply #540 on: April 25, 2017, 03:11:25 PM »
Hello
I have" r m h v 2.1"4 axis, controller.
What do you want?
What to do with it?

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #541 on: April 25, 2017, 03:46:32 PM »
Hello
I have" r m h v 2.1"4 axis, controller.
What do you want?
What to do with it?
Hello!

Thanks for helping me out.
You will need to unzip the files from the archive attached to the previous post and from the link below, and copy the files to the main directory of a USB stick.
Now power off the controller and insert the stick. Then reconnect power and let the process complete.

Link:
https://bmuessig.eu/secure/data/CNC/DDCSV11/install-mod-20170416.zip

Beat regards,
Benedikt

Offline Benedikt M.

  • Full Member
  • ***
  • Posts: 132
  • Country: de
    • My website
Re: DDCSV1.1 4 Axis controller
« Reply #542 on: April 27, 2017, 07:07:15 AM »
I will modify the NAND dumper to also copy the FPGA registers.
Yesterday, I wrote a small utility to directly talk to the FPGA via the command line.
Binary and source can be obtained from here: https://github.com/bmuessig/motionutil

In principle this utility can be used to directly issue commands to the motion processor. So you can e.g. control the Buzzer from the command line.
It can also read out the exact hardware version.

Here are some examples:
Buzzer disable: mutil -w 99 1
Buzzer enable: mutil -w 99 0
HW Ver: mutil -rx 1

BR,
Benedikt
« Last Edit: April 27, 2017, 07:47:36 AM by Benedikt M. »