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

Offline Benedikt

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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: 50
  • 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

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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

  • Jr. Member
  • **
  • Posts: 6
  • 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: 8966
  • 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

  • Jr. Member
  • **
  • Posts: 6
  • 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: 8966
  • 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

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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

  • Jr. Member
  • **
  • Posts: 6
  • 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

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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

  • Full Member
  • ***
  • Posts: 200
  • Country: de
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. »

Offline PPRINT

  • Jr. Member
  • **
  • Posts: 50
  • Country: us
Re: DDCSV1.1 4 Axis controller
« Reply #543 on: April 29, 2017, 08:25:18 AM »
Benedikt,
I finally have my machine running and tuned the way I want and decided to install your 20170416 install-mod.

I extracted the ZIP to my USB, insert USB into controller and rebooted and nothing happened from normal.

When I extracted onto the USB all of the files were contained in a single folder.  I copy/pasted all of those files to the root of the USB, insert into control and rebooted. This time I received the new graphic during boot.  Once booted I can see the software version in the lower right corner is in fact yours. 

For some reason I was expecting the UI to look different.  Should it have?  Did I do something out of sequence?

Also, I was not expecting for the upgrade to dump all of my parameters.  Logically it should, but It was early and I had not had any coffee yet.  Note to self and others....capture your parameters before any software upgrades.

Finally.
I was a bit intimidated with the software upgrade because the details/reasons are spread out over a large number of post here.
Is there a document I have not found that has step-by-step instructions for the install and what to expect that I am missing? I also would like to use the online parameter configurator....but cannot figure out how to get them in the machine.

I apologize for such trivial questions.

Rob
The afternoon knows what the morning never suspected.

Offline Benedikt

  • Full Member
  • ***
  • Posts: 200
  • Country: de
Re: DDCSV1.1 4 Axis controller
« Reply #544 on: April 29, 2017, 12:24:08 PM »
Benedikt,
I finally have my machine running and tuned the way I want and decided to install your 20170416 install-mod.

I extracted the ZIP to my USB, insert USB into controller and rebooted and nothing happened from normal.

When I extracted onto the USB all of the files were contained in a single folder.  I copy/pasted all of those files to the root of the USB, insert into control and rebooted. This time I received the new graphic during boot.  Once booted I can see the software version in the lower right corner is in fact yours. 

For some reason I was expecting the UI to look different.  Should it have?  Did I do something out of sequence?

Also, I was not expecting for the upgrade to dump all of my parameters.  Logically it should, but It was early and I had not had any coffee yet.  Note to self and others....capture your parameters before any software upgrades.

Finally.
I was a bit intimidated with the software upgrade because the details/reasons are spread out over a large number of post here.
Is there a document I have not found that has step-by-step instructions for the install and what to expect that I am missing? I also would like to use the online parameter configurator....but cannot figure out how to get them in the machine.

I apologize for such trivial questions.

Rob
I am sorry that you lost your parameters. I have just fixed the installation script to keep your settings at any price.
If stuff doesn't work afterwards, the new, blank and working settings file is still copied to a different internal location.

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

There is now also a Windows "installer" to help you:
https://www.bmuessig.eu/secure/data/CNC/DDCSV11/install-mod-20170416.exe

To make the installer work, download and run it. Select your USB stick as the target.
If it asks you to overwrite files, make it overwrite all (this will just overwrite system upgrade files, not your other ones).

The UI does not look any different (yet). Currently our efforts are primarily focused on getting the CNC functionality working. For this, we are reverse-engineering the original application.
For this I am primarily using IDA's decompiled output, which is unfortunately 97883 lines of pseudo C-code long. Some stuff is optimized out, made more complex or renamed to non-descriptive names.
This means we are having a hard time, but we are making progress.
Unfortunately at this point we are closer to running Doom on the controller than we are to running a new CNC application. But eventually we will have a completely new and modular UI and everything will work a lot more nicely.

For now, I am using my new knowledge to patch the original application at the assembly level to enable you all to do more with the original software until we can provide you with our completely new firmware.

It's fine to ask. I will eventually prepare a handy PDF with all the neccessairy details.
Most of this info is contained in the original documentation which can be found here: http://robokits.download/datasheets/DS_DDCSV1_EN.pdf

To answer your questions, to install the software properly, you simply extract all the files inside the archive to the USB stick.
Let's say you are using Windows and your USB stick is E:
First, you unzip all files from the firmware upgrade.
Then you copy the files (there should be these elements: upgrade.do, splash.ppm, install, upgrade) to E: (not to a sub-folder of E: or it won't work).
Now, use Windows' option to safely remove the USB stick and remove it, when Windows asks you to.
Next, head over to the controller and cut power to it. After it beeped, plug in the USB stick and then re-apply power to it. The controller will now do everything it needs to do to complete the installation and will eventually return to the home screen that you are used to.
Now, you can unplug the USB if you want to. You can remove the upgrade.done, splash.done files and the install.done and upgrade folders from the USB stick, but this is optional.

Now to the online configurator. Head over to http://bmuessig.eu/tools/pandora-configurator/ and dial in your desired configuration.
Click on the Submit button to generate the configuration file. When the submit worked, you should see a webpage where it shows your configuration file. You can click on 'download' (in the line of text written in red) and save the file directly to your USB drive (e.g. E:\) or on 'continue editing' if you would like to change some more values.
Now, while the controller is on, insert the stick into the controller and wait for 10 seconds.
Now, press the page button for 4 times, until you see the file manager for the second time (this is a bug in the original software which we can't yet fix) and go into /udisk-sda1 (if you are not in there already) and use the arrow keys to hover over the userVar.set file.
Now press Enter to confirm and wait for 5 seconds. Finally cut power to the controller and re-apply it.
The new settings should now all be present and work.

I hope this helps.

Best regards,
Benedikt
« Last Edit: April 29, 2017, 12:56:41 PM by Benedikt M. »

Offline antonio

  • Jr. Member
  • **
  • Posts: 31
  • Country: it
Re: DDCSV1.1 4 Axis controller
« Reply #545 on: May 01, 2017, 12:52:44 AM »
Hi Benedikt
it seems backlash function not work properly with original firmware. Did you fix the problem with new firmware? When change move direction the driver should add the valures which I declare on setvar at velocity declared but it seems that velocity did not change (remaining same on g1 g2 and g3) and also the booth axis moving contempory instead one even change only one direction.
many thanks for your kind coop.


Inviato dal mio iPad utilizzando Tapatalk

Offline PPRINT

  • Jr. Member
  • **
  • Posts: 50
  • Country: us
Re: DDCSV1.1 4 Axis controller
« Reply #546 on: May 01, 2017, 06:56:09 AM »
Benedikt, thanks for the detailed write up on the steps.  That helps.

No worries on losing the parameters.  Reconfiguring them was much faster, and I was able to do a better job, the second time.

Thank you,
Rob

The afternoon knows what the morning never suspected.

Offline Benedikt

  • Full Member
  • ***
  • Posts: 200
  • Country: de
Re: DDCSV1.1 4 Axis controller
« Reply #547 on: May 02, 2017, 07:00:06 AM »
Benedikt, thanks for the detailed write up on the steps.  That helps.

No worries on losing the parameters.  Reconfiguring them was much faster, and I was able to do a better job, the second time.

Thank you,
Rob
I am glad you don't mind loosing the parameters too much. The original firmware upgrade process would have deleted the parameters anyways, so it is not directly my fault. I have now added a line to my custom installation script to preserve existing configuration in any case.


Feel free to ask again if something breaks or is unclear.


Hi Benedikt
it seems backlash function not work properly with original firmware. Did you fix the problem with new firmware? When change move direction the driver should add the valures which I declare on setvar at velocity declared but it seems that velocity did not change (remaining same on g1 g2 and g3) and also the booth axis moving contempory instead one even change only one direction.
many thanks for your kind coop.


Inviato dal mio iPad utilizzando Tapatalk
Thanks for reporting. I will see what I can do about it.
There is unfortunately a limitation of how much can be patched as there is few empty space in the elf that we can use to patch. We could always overwrite the unused functions with additional code.

Also I forgot to ask, who is interested in having Ethernet or WiFi capabilities implemented?
This is possible using USB adapters (cheap 10/100 Ethernet or Edimax WiFi adapters), however, it requires a new flash image to run.
This is not trivial for us, since it would require developing a *robust* OTA flash update application, but it would work. This would also allow changing the ugly splash screen.
The downside for you will be the risk of actually bricking the controller in case of a power outage or corrupted image.
Note that you can always solder a cut off USB cable to the internal debug header to restore the image. So JTAG or low-level flash programming is never required.
I would even fix broken units / upgrade them, if shipping to Germany and back is paied for.

We will, if we succeed at making an OTA updater, make this optional.
I would just like to know who would like to remote control or customize the controller under these conditions.

In case anyone wants to know why the processor manufacturer did not provide custom and robust OTA update capabilities, the answer is, they did, but it only works for updating from SD card. And our controller's hardware engineers did not provide us with an SD card slot. D'oh!

Regards,
Benedikt

Offline riorao

  • Jr. Member
  • **
  • Posts: 5
  • Country: ru
Re: DDCSV1.1 4 Axis controller
« Reply #548 on: May 02, 2017, 02:21:17 PM »
Hello!
I use two motors on the X axis. This controller will work with this configuration? there is synchronization?

Offline jjae6

  • Jr. Member
  • **
  • Posts: 5
Re: DDCSV1.1 4 Axis controller
« Reply #549 on: May 03, 2017, 02:40:52 AM »
Hello!
I use two motors on the X axis. This controller will work with this configuration? there is synchronization?

I think I have read in this post that some people use 2 motors on one axis, but with two drivers, one per motor.