aenniw/ARDUINO

Calibration fails, Arduino is rebooting?

Maaarsl opened this issue · 4 comments

Hey, thank you for all the work and effort you've put into this project.

I've built the mod (Relay-Version with KY-040 Rotary Encoder) but the calibration fails and I have no idea why. That's what happens during the calibration:

  1. Display is flashing with dashes, set desk to lowest position
  2. After releasing the button the motor shuts off and it looks like the Arduino is rebooting?
  3. Pressed "tilde"1 until message '-rst' shows
  4. Set desk to highest position
  5. After releasing the button the motor shuts off and it again looks like the Arduino is rebooting?
  6. Pressed "tilde"1 until message '-rst' shows
  7. Display isn't flashing anymore and displays "0000", nothing happens if I press a button

1 I redesigned the buttons, that's why it's an "S" instead of a "~"

Here is a video of the calibration process: https://www.youtube.com/watch?v=batYV9O5_G8

I triple-checked the wiring but after reading Issue #107 I felt unsure about the sensor and switched

#define SENSOR_PIN0 2
#define SENSOR_PIN1 3

to this

#define SENSOR_PIN0 3
#define SENSOR_PIN1 2

but got the same behaviour after I uploaded it to the Arduino. I've been using the "nanoatmega328-relays" environment for uploading it.

I'm using a 12V 3A LED Strip Power Supply, if it's too weak, could this cause the problem?

I bought a stronger 12V 4A power supply and a new KY-040 rotary encoder (since I thought the first one might be faulty). Now the display shows "Err1" immediately after I press the "move down" button during the calibration.

I found Issue #97 while searching for similar issues and increased the WATCHDOG_TIMEOUT to 15000 while testing (the motor is still attached to the table), now the motor is moving again and the Arduino won't reboot after I release the buttons but I am still not able to finish the calibration successfully. Here is what happens:

  1. Display is flashing with dashes, set desk to lowest position
  2. Pressed "tilde" until message '-rst' shows
  3. Set desk to highest position (display is showing 0000 the entire time and is not counting up)
  4. Pressed "tilde" until message '-rst' shows
  5. Display isn't flashing anymore and displays "0000", nothing happens if I press a button

aenniw commented this on Issue #97:

also could you try to compile with HALF_STEP as some of the KY-040 seems to skip steps...

Could you provide some logs if possible? compile with __DEBUG__

Where do I have to define HALF_STEP? I searched for HALF_STEP inside the entire repository and didn't find it.
How do I get logs after compiling it with __DEBUG__?

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

I am still having the same issue. I connected the rotary encoder to a Arduino Mega and created a simple sketch to verify the rotary encoder is working. The rotary encoder does work (see picture below) so I think it is a software issue.

IMG_1259

Right after that I found the HALF_STEP constant inside Rotary.h and changed it from this:

// Enable this to emit codes twice per step.
// #define HALF_STEP

to this:

// Enable this to emit codes twice per step.
#define HALF_STEP

But even with watchdog disabled the movement stops instantly and the display shows Err 1. If I deactivate HALF_STEP again (watchdog is also disabled) I can move the table but I won't be able to complete the calibration process (like described above).

"Remove stale label or comment or this will be closed in 5 days"... 🙄