Weird reset problem
JBWolf
Posts: 405
Hello,
I am having a weird problem with pin outputs causing some kind of reset.
I am using 2x unipolar stepper motors connected to a single ULN2803 (4 wires for each motor). The ULN2803 is connected directly to the prop with 8 wires.
The 8 pins connected to the ULN2803 are set for output using dira[1..8]~~
I am using half-stepping output on those pins with a DAT array: %0001, %0011, %0010, %0110, %0100, %1100, %1000, %1001.
Both motors work fine, I have used this exact method before with no problem on other projects... but this one has some kind of glitch.
If i move motor #1 via tact switch input, it moves in both directions no problem.
If i move motor #2 via tact switch input, it moves in both directions no problem.
BUT, if I quickly switch between pressing the button to move motor #1 and the button to move motor #2, it causes all the output pins to pause and go low for about 2 seconds then re-establishes their programming.
It only happens when I switch between moving the 2 different motors quickly. I cannot make the problem repeat itself accurately (specific button press combo or number of times), it seems to do this somewhat randomly, but always happens.
This affects every pin which something is attached to. I have an Xbee attached, a relay for powering an external device and several LED's on other pins as well... all of these do the 2sec reset when the motor glitch happens, then resume normal activity.
I am using an XBee transmitter and receiver... the prop with transmitter has the buttons to move the motor and the prop with receiver has the motors... I can see the transmitter still sending data during the 2sec reset on the receiver prop, the receiver xbee receive led turns off during this reset.
The XBee receiver is running in one cog and everything else is running in another cog (motors, relay, led's)... so only 2 cogs are used.
Any idea why this is happening? I have never had this trouble before.
The main power input (5v) powers both the prop and the 2 motors, I have capacitors on the 5v input and 3.3v side.... this is definitely something with the prop on the receiver side.
Please help!
Thanks
I am having a weird problem with pin outputs causing some kind of reset.
I am using 2x unipolar stepper motors connected to a single ULN2803 (4 wires for each motor). The ULN2803 is connected directly to the prop with 8 wires.
The 8 pins connected to the ULN2803 are set for output using dira[1..8]~~
I am using half-stepping output on those pins with a DAT array: %0001, %0011, %0010, %0110, %0100, %1100, %1000, %1001.
Both motors work fine, I have used this exact method before with no problem on other projects... but this one has some kind of glitch.
If i move motor #1 via tact switch input, it moves in both directions no problem.
If i move motor #2 via tact switch input, it moves in both directions no problem.
BUT, if I quickly switch between pressing the button to move motor #1 and the button to move motor #2, it causes all the output pins to pause and go low for about 2 seconds then re-establishes their programming.
It only happens when I switch between moving the 2 different motors quickly. I cannot make the problem repeat itself accurately (specific button press combo or number of times), it seems to do this somewhat randomly, but always happens.
This affects every pin which something is attached to. I have an Xbee attached, a relay for powering an external device and several LED's on other pins as well... all of these do the 2sec reset when the motor glitch happens, then resume normal activity.
I am using an XBee transmitter and receiver... the prop with transmitter has the buttons to move the motor and the prop with receiver has the motors... I can see the transmitter still sending data during the 2sec reset on the receiver prop, the receiver xbee receive led turns off during this reset.
The XBee receiver is running in one cog and everything else is running in another cog (motors, relay, led's)... so only 2 cogs are used.
Any idea why this is happening? I have never had this trouble before.
The main power input (5v) powers both the prop and the 2 motors, I have capacitors on the 5v input and 3.3v side.... this is definitely something with the prop on the receiver side.
Please help!
Thanks
Comments
this does not reset the whole propeller... just all pins set to output (no pins are set to input).
input power is 5v @ 1A
I will try a high amperage supply and let you know
This sounds more like a bug in your software, because a propeller switches all pins to input during a reset!
AND I think it's a bad idea to give it more power if your code is buggy.
ok I added an LM2940 with heatsink and changed the power supply to 6v @ 2.5A.
This did fix the problem... silly me.
Motors are rated at 500ma... I programmed it so only one at a time could be running, but apparently they were a little hungrier than I thought.
I can switch between buttons all I want and no reset
Thanks!
Along with the PE kit came two 3mm LED's I dont know what they are.... they are completely black and I cannot see through them even if held to bright light. are these IR LED's?
Looking through the shop I cannot find this part in the accessories or components category.
I looked through all results of searches for "IR LED" and "IR transmitter"... nothing like it.
The phototransistor and IR transmitter in the shop have clear casing.
Maybe a discontinued part? Wish I could figure out what they are.
That's really the only sure fire solution...
out false RTS pulses reseting your Prop chip through the USB cable. Does this still happen when the programming
cable is disconnected ?
Well that's always going to be problematic - when the motors take large current spikes the supply drops and the chip resets or
malfunctions. Unless the 5V supply can happily handle the combined phase currents of both motors and you have good decoupling
near the ULN2803 I wouldn't expect this setup to work reliably. An added issue with the 2803 is the darlington stages take time
to turn off which may mean the supply is driving three phases simultaneously for a while after you switch phases (rather than
one or two).
A stop gap solution is to add more 3V3 decoupling to protect that rail when the 5V rail drops, but in general sharing a supply
between motor and digital electronics is best avoided (or over-engineered). Putting a scope on the supplies would be very
useful to confirm/deny this hypothesis.