Problem: The Cloud connected GiGa board periodically resets on its own.
The sketch manually and automatically controls the operation of 14 shades in my sun room. I can manually move the shades up and down. The sketch can also move groups of shades up and down via photocells.
Hardware consist of the GiGa, stepper motors and controllers.
The individual position of the shades is reset to zero each time the GiGa resets which is a problem if the shades are not in the home position.
That's why you need to always have home switch with stepper motors. At startup steppers are first running to home direction until the switch triggers. Now your system knows the position.
There are too many options to guess why your GiGa is resetting, can be your code, your internet hanging, can be interferences on wiring if not shielded, can be voltage drop because of insufficient power supply etc.
Thanks for the reply.
I understand what you mean by having a home switch for the stepper motors. Upon a reset or startup the motor would turn in a certain direction until it triggers a switch (ie a Hall effect switch, etc). Then it would know where it was. With difficulty I can add this feature.
I would like to understand more why the GiGa resets however.
I understand there is a Watchdog feature, which I have only a cursory understanding of. Is there a place to read up on this feature? I am thinking when the motors running, some times five in a row, the watchdog may kick in and reset the GiGa.
I have a remote momentary switch which enables me to reset the GiGa from a remote site 25 ft away. The switch connects the GiGa reset pin and one of its grounds. The cable is not shielded and does run by some 120vac power lines.
Any thoughts?
Oh my God!! You have all the elements for problems summed together.
You should have shielded wiring, separated from mains, difficult to fix so leave it for now.
- if your remote reset switch is realized like rest of the project, it's probably triggering reset from interferences. Remove it as a first step.
- steppers are power hungry, you have to have a beefy power supply. Is your Giga powered from same supply? If motors are pulling more current than PSU can supply, voltage is dropping below nominal and that can cause Giga to crash. Verify.
So basically you are telling me that you don't have any limit switches on the curtains? So unwanted reset makes them loose position and they crash? Also interferences from your wiring can cause your steppers to go wild and stall when they can't rotate anymore. Or to loose steps with same results. At least one limit switch per curtain you need, and you can use that as home switch as well. You can use hall or just simple mechanical microswitch.
If you want to continue with MCUs and electronics, you have to understand that long signal wires work like antennas, they catch interferences from radiowaves, from power wires etc. Keep them short as possible, like few inches, or use twisted/shielded cables (and keep them short anyway).
Long tiny wires are causing also voltage drop, another common source for problems.
Thanks again for the reply.
First the GiGa is powered separately from the stepper motors.
Since my last reply I disabled the automatic feature of the sketch. The sketch bypasses this feature that was normally controlled by the photocells. This bypass was previously built into the sketch.
It has been about 22 hrs since I did this and the GiGa has not reset. I will wait another day at least to draw any conclusions. The reset though unpredictable usually happens at least once a day.
If no reset occurs than I conclude that that the still connected remote reset switch is not the issue.
If no reset occurs I might also conclude that the problem is initiated within the photocell portion of the sketch. Two problems may exist:
- The watchdog time limit is being exceed while the sequential rising of the group of shades are being moved or
- The movement of the stepper motors is having an effect even though it has its own power supply.
Your thoughts?
Good. Step by step, otherwise you never know where the problem was.
1 Why would WDT reset your board? Do you have it enabled and messing with it within your code? Even if you do, it means WDT is resetting because your MCU is freezing.
2 I don't know your drivers and exact wiring, so difficult to say, but with correct wiring it should not.
Leave your Giga connected to serial monitor and put identifiable serialwrite before every action on your code, also to setup. So you see last action and reset (startup) with timestamps.
Thanks for replying again.
I was under the impression that the WDT was a built in feature and not one that you invoke via sketch commands. What command or statement invokes the WDT? I have not intentionally invoked it into my sketch.
How can I lean more about the WDT?
So far I have gone 48hrs with no reset with the photocell feature off. I have also not moved the shades manually either.
Today I plan on moving some of the shades manually to see if the GiGa resets. I will leave the photocell off.
I do have the monitor on that prints out statuses of the shades positions. I will add “prints” when I isolate the area that proves to restart the resets.
Your thoughts?
Google "arduino wdt tutorial" for example...
So just make sure you have serialprint before every action in your code to identify where it is resetting. Also in the setup section (which is executed only at startup after reset). If your reset happens occasionally, it's from interferences on your wiring, most probably your reset button. If it's related to specific action, it's either your code or some strange hardware issue still to find out.
In any case, if you have reset button wired 25ft together with ac power lines without pullup , it WILL reset your MCU occasionally!
Thanks for the reply.
- Reset function. I have a wire connected to the GiGa ground and the other end to a terminal on a momentary switch. A second wire runs from the second terminal on the switch to the reset pin on the GiGa. I have no sketch software connected to this function. Are you suggesting that the reset pin needs a pinMode(reset, Input_pullup) within the sketch?
- I manually moved some blinds this morning, no reset so far. Photocell still off. I will leave things alone for at least 24hrs.
Your thoughts?
No, the internal pullup is probably too weak for your massive "antenna". I don't know specs of your board, (because I don't have $70 to spend for devboard ) but usually it is around 30-50Kohm. You could put 4k7 resistor between reset pin and 3.3V.
Don't worry, you will fix your issue. Nice that you started with curtains and not with CNC router. Your drivers have probably over current protection, so anything bad can't really happen.
With CNC one interference or missed step will destroy your workpiece in best case, probably snapping also the cutting tool, and in worst case hitting you with that ar 24000rpm...
I have been moving the shades around manually since yesterday, photocell disabled, and so far no resets.
I learned from the WDT research I did yesterday that the WDT defaults to being enabled. A way to disable it to add “false” to the statement ArduinoCloud.begin(ArduinolotPreferredConnection,false) within the void setup.
It is ironic because I had it this way a few weeks back but removed it since I could not justify how I added it in the first place. This project has been going on since last summer you see.
I will add it back in after more testing.
Tomorrow, barring new resets due to manual shade movements I will turn the photocell back on but only allow it to move one shade out of five on all three walls. I will add a shade each day per wall until a reset occurs. At this point I will add back in the “false”.
I like your joke about starting with shades vice CNC tooling.
I started electronics about a year ago. This is my fourth major project. The first was a leak detection system for my basement. The second was an automatic water reservoir fill system for my coffee maker. The third was a driveway person or vehicle alarm system. It has been a long and hard learning curve.
Thanks again.
I don't know anything arduinocloud-giga-ecosystem so I can't say a word. I'm personally using mostly Esp32, sometimes Stm32 or Arduino pro. In normal arduino WDT is disabled as default. Anyway, difficult to see wdt causing problems, except if you are playing with that in you code, some deep sleep stuff, or if that cloud library is using it particular way. Generally, it should only reset your board when it's already frozen, so the real problem is somewhere in code.
Make changes one by on, sooner or later you find it. If it's interference related, it could reset when you start your vacuum cleaner for example.
Generally, take always care of your pullups/downs, you should never leave inputs or outputs floating.
Let me know your findings
ps. I built a big CNC and have seen all the possible... and impossible as well. It's bad marriage between very sensitive signal processing for steppers and extreme interferences from variable frequency drive and spindle all wired together.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.