Arduino using steppers Unstable?!

Hi There,

I was programming my machine with my own software for controlling all of my axis. But i encountered an strange thing, sometimes my Teensy 3.6 resets automatically. Can this be a problem that is caused by using a voltage shifter?!

The Teensy 3.6 is 3.3v and i use a Standard 16x2 i2c display and a HLK-RM04 network card but both are 5v so i used a voltage shifter, i don't know if that can be a problem. Or can it be that the motor driver causes a problem?!

The motor driver i use is a ES-D808 at 48 volts. It shouldn't be a problem to connect the teensy straight to the driver because it uses optocouplers?! Or?!

It is very strange that the board resets automatically. Some other thing i noticed is that the board gets troubles with continuous data output, it looks sometimes it just hangs and just continues...

Strange,

I don't know what to check anymore i'm out of options. I already buyed the teensy 4.1 and im hoping on better performance. And i need the extra memory chip :- ).

Is it possible that i use too much of the memory and that that's the reason that the teensy hangs or resets?!

float _Main[2500] = {}; // Pulse Data
byte _Data[256] = {}; // Input Data (RX/TX)
byte _Pack[256] = {}; // Output Packet Data

Thanks,

Nena

IF the problem is not in your wiring or the components your are using or the power supply for the project, then the problem must lie in your software. Don't you agree?

Paul

Yup, i think so, think its the SRAM... I'm already thinking what i can do about that. I use only one String of 4 bytes so i could change that to char. Only the large array is i think the killer... if i calculate the array of 2500 * 4 bytes = 10.000 = 10kb of the 256kb that the teensy has. The code is straightforward. Maybe i also use the F(string) command.

There is still some things to check as i see... maybe i should use the EXTMEM float Array[] function?! Its frustrating if your project is unstable after all the time i spend in it :- )

If i think about it i'm almost sure it is the memory... could this be caused by the only 1 string i used?!

NenaGirl:
Some other thing i noticed is that the board gets troubles with continuous data output, it looks sometimes it just hangs and just continues...

That makes me wonder if the program is corrupting its own memory (by writing beyond the end of an array or something similar). That could happen even though only a small proportion or available memory is being used

That corruption might also be the cause of the resets.

Do you have an earlier version of the program that did not exhibit this behaviour? If so, what was the addition to that program that caused the problem? If not then you need to go back to an even earlier version - conceivably event start again from scratch.

...R

Do you have cables from the teensy that go near the motor wiring or its supply? 3.3V microcontroller
signals are very sensitive to interference from such things due to the inductive switching spikes.

Robin2:
That corruption might also be the cause of the resets.

I did some changes now, i managed to change the big float array to an int array. And i increased the array by 500 rows. So float _Main[2500] is now int _Main[3000]. Also removed all debug lines. The above array's are the only 3 i use in my program. The _Data[] array doesnt get over the 50 bytes and neither does the _Pack[50] array.

I will look at the String that i use and convert it to a char(). I Have a earlier version of my program but i noticed the problem already in the first version. I thought it was just once. Maybe a glitch or something like a spike in the power.

Did a test till now everything looks good! I really hope it's the array! But time will tell...

MarkT:
Do you have cables from the teensy that go near the motor wiring or its supply? 3.3V microcontroller
signals are very sensitive to interference from such things due to the inductive switching spikes.

No the cables of the motor are about 40 cm away from the teensy and the driver input cable is shielded.

Nena