Sliicy / 8x8x8-LED

Project that can control an 8x8x8 LED matrix cube and display anything on it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monochrom Cube not working properly

HRDHRD5 opened this issue · comments

Hello,
I am trying to modify your Project to control my 8x8x8 singel colored (blue) cube.
I also tried to controll it with the compiled program and the same settings. It didnt work either...
The Cube im using: https://www.amazon.de/gp/aw/d/B084LLW3MP/ref=sspa_mw_detail_2?ie=UTF8&psc=1&sp_csd=d2lkZ2V0TmFtZT1zcF9waG9uZV9kZXRhaWwp13NParams

The cube is working fine when downloading animations with the given program.

I have installed the firmware (ledcube8.hex) which worked fine.
Pins Connected:

  • TXD and TXD
  • RXD and RXD
  • GND and GND
  • 5V and 5V

I am facing the following problems:

  • Colors are 'inverted'?: When I set the cube to turn Black then all LEDs turn on, opposite with white
  • when im trying to draw a plane in black (--> should result in white) the whole cube turns 50% on
  • I am facing no errors when executing my program
    --> any things i draw are displayed wrong...

I have set the serialPort like this:
serialPort.BaudRate = 19200;
serialPort.DataBits = 8;
serialPort.StopBits = StopBits.One;
serialPort.Parity = Parity.None;

And the cube:
Cube cube = new Cube(8, 8, 8);
cube.type = CubeType.Monochrome;

Cube off (results in cube turning all leds off...):
cube.Clear(CubeColor.White);
SerialHelper.Send(serialPort, cube);

I am not an expert at all, so I might overlook something obvious here...
Thanks a lot for your work on the project! I was hoping to find something like this.

commented

Hi @HRDHRD5, I started this project originally with the blue monochrome cube. After some time, I decided to upgrade to a fully colored cube which also involved me rewriting the code to accommodate for it. I am wondering if my old release works with your cube. Can you try downloading version 1.0 and see if that controls the cube properly?
Here is the first release:
https://github.com/Sliicy/8x8x8-LED/releases/tag/v1.0

Hi, thanks for your quick answer.

I tried the Version 1.0 now and unfortunatly it doenst work either :/.
But the behavior seems a bit different.

  • Colors are still inverted (Packet with 0xFF... colors the cube black, Packet 0x00 turns all LEDs on)
  • I guess because of this all animation do nothing at all (full cube is lighted)
    I tried calibrating which is weird:
  • Back bottom left LED should be the only one on --> all LEDs are on
  • bottom left row should be lit --> all LEDs on
  • bottom back row schould be lit --> all LEDs on except for the front left row?
  • right front row --> all LEDs on
  • top section --> all LEDs on except for back plane off
  • I tried rotating to calibrate it correctly, but it confused me even more because different messages would do something (at right front row a row is off, but at top section no LEDs are turned off...

I hope this is useful...

commented

Hi @HRDHRD5, here are some more follow-up questions:

The cube is working fine when downloading animations with the given program.

1: Which program does the cube work with currently?

2: Can you confirm that the cube doesn't have any electrical shorts? In other words, before flashing this project, did the cube display its built-in animations from factory?

3: Can you try swapping TxD & RxD and see if anything changes?

4: What is the serial number/model number of the board & the microchip code (printed on bottom)?

For the monochrome cube, each data packet should only be 65 bytes long (this should turn it all on):

0xF2, 
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,

Can you try opening the latest version and testing different packets below to see what happens?

This should turn it all off:

0xF2, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

This should turn on 1 row:

0xF2, 
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

I hope you're able to get it working! Let me know your results.

Hey, thanks for your answer :)

1 and 2, it worked with the animation program from the manufacturer + standart animation worked too. The standard program createt hex files which were downloaded on the cube, so the same way the standart animation work.
So i am pretty sure there are no short circuits.

3 When I change TXD and RXD it is not displaying anything. It connects but all LEDs are constantly on :/

4 I guess its 507868, but i am attaching an image of the backside, hope its not on the front :D.
IMG_20221228_105836

I tried all 3 pakets.
The first one, which should turn all on, turned all of again...
The second one that should turn all off turned all on.
And the third one seemed to turn all on.

Because the third one should light up one row and everything seems inverted i tried:
0xF2,
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,

which actually turned the only front plane on. But the LEDs seem to look a bit dimmer somehow. and the 2. plane also seem to light up extremly dimm, but it also may be the reflection from the first plane...

IMG_20221228_111341

commented

Ah, I remember that now... When I coded the firmware to control the 8x8x8 monochrome cubes, I had this ghosting effect which I never got to the bottom of, due to timing and flicker. The first row facing you is brightly lit, while the row behind is a "ghosting effect" and is due to my poor skills in my attempts to code the firmware. But my RGB version I was able to write in Arduino, and get it better.

Can you try playing around with the packets being sent and see if you can get a hold of the cube's expected schema (To figure out the X, Y, and Z directions)?
Every packet should start with 0xF2 followed by 64 bytes. Try varying the packets sent 0x01, 0x02, 0x10, ...

What are the outputs of the following 4 packets:

0xF2, 
0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xF2, 
0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF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01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0xF2,
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x60, 0x61, 0x62, 0x63, 0x64,
0xF2,
0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,

The goal is basically to understand and map the cube correctly now.

Thanks a lot, I am trying that tomorrow, because I am not at home right now.

*I am not at home until Monday.
I am sorry for that. :(

Ok so I tried the packets now.

Packets:

  1. (with 0x01) lights up the front panel except for the right row.
  2. (with 0x02) lights up the front panel except for the second right row.
  3. (with 0xFE) lights up the right row at the front panel.
  4. (with 0xFD) lights up the second right row at the front panel.
  5. (with 0x01) lights up all LEDs except for the right side plane.
  6. (with 0x01...) lights up all LEDs except for every second row at the right side plane.
  7. (with 0xF0) lights up the right side of the cube.

So I guess they do what expected, just inverted.

I tried using the rotate and flip parameters, but they had no effect at all.
Maybe they are not implemented at the monochrome cube?
When using calibration and changing rotation the cube changes at different popups, which means roation does something.
But weirdly there are always some popups where no side lights up..
(With light up i mean, all LEDs are on except for these that light up --> its still inverted)

I just realized that simply by inverting the bytes of the hex numbers everything seems to work.
So wouldnt it work if I simply modify the source code to invert every byte sent?

So i tried inverting all bytes in the sendpacket funtion:

byte b = byte.MaxValue;

for (int i = 0; i < payload.Length - 1; i++)
{
   payload[i] ^= b;
}

so what it does is 0xFF XOR payload,..
This makes the color white to all LEDs on, but when i clear with color black the back plane still lights up and the front row has this ghosting effect. Do you have an idea what is wrong there? --- Solution in edit

Edit:
In the for loop it didnt include 63 which resulted in the last byte not to be inverted.

Still things dont work like intendet:

  • When drawing a point it results into a line
  • When drawing a straight line it results into a plane
  • when drawing a plane it rresults into the whole cube being painted
    But everything dimmer than normal and with the ghosting effect.

And by testing with this DrawPoint function I was able to figure out the Axis:

Screenshot

I tried rotating the cube:

cube.Rotate(Rotation.ClockwiseY, 1);
cube.Rotate(Rotation.ClockwiseZ, 1);

but this changed nothing :(

Do you know why?
Best regards

commented

@HRDHRD5 Hi, sorry it's been a while. I don't have the cube with me in person, so I had to get a friend to test it for me. I can confirm from the latest build that it works on it (clock app demonstrated below):
image

I'm not sure what could be causing this inversion issue... Maybe for now I can add an inversion feature so anyone who has an inversion issue could at least control it inverted.

commented

@HRDHRD5 I added a new invert feature. If you could kindly try it and test if it helps, I would appreciate it! Just simply download the latest version from releases again, turn it on, and give it a shot (version 2.2 at the time of writing this):

image

So I tested it and the inversion works, so Black is all LEDs off and White all on, but there is still something wrong with what is displayed...

I´ll try to fix this. If you want to help me, just message me, if not, it is all right :)
I dont want to take to much of your time, especcially because there seems to be a problem with my cube only...
Thanks for your help and the project in general, you did great work!

commented

@HRDHRD5 keep me posted! If you manage to figure out the issue and you find any bugs in the code, please let me know! I'd be happy to do any pull requests to get this fixed!

I´ll do!