Go Down

Topic: dysfunctional function (Read 745 times) previous topic - next topic

ifugaopapercraft

Yes, the servos do move but only momentarily. Previously they would continue moving until the viewer moved a distance away, then stopped.  Everything seems to be happening just one time rather than continuously while the sensor value was within range.

The motor runs without stopping, regardless of sensor readings.

I was working on the stepper drivers when these other calamities occurred.  I'd like to resolve them before connecting the steppers. 

Why do you believe the serial monitor displays only a few values, then stop?



majenko


Yes, the servos do move but only momentarily. Previously they would continue moving until the viewer moved a distance away, then stopped.  Everything seems to be happening just one time rather than continuously while the sensor value was within range.

The motor runs without stopping, regardless of sensor readings.

I was working on the stepper drivers when these other calamities occurred.  I'd like to resolve them before connecting the steppers. 

Why do you believe the serial monitor displays only a few values, then stop?

Because something is not working :)

I would suggest commenting out three of the four functions in the if and tackling them one at a time.

I reiterate my note about the functions running *in sequence*.  First the servos will twitch, then stop.  Then the motor will start.  Then the unipolar stepper will do a sweep, and stop.  Finally the bipolar stepper will step once, and once only.  Next time through the loop the sequence will start again (but as the motor's already running, it won't start running again).
Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

lloyddean

#7
Mar 18, 2013, 02:21 am Last Edit: Mar 18, 2013, 02:25 am by lloyddean Reason: 1
Seem to have a pin conflict!

pin 29   ledFrontRow[]
pin 29   motorLeft


Not that you are currently using the array 'ledFrontRow'

PeterH

You seem to have quite a lot of hardware connected up. It may be that your power supply isn't up to the job or your Arduino is being reset due to electrical noise. It may also be that your limit switches aren't working correctly and you're getting stuck in a loop in unipolarStepper(). I suggest you follow majenko's advice and disable parts of your sketch to see which part is triggering the problem, that will tell you which part of the circuit to investigate.
I only provide help via the forum - please do not contact me for private consultancy.

ifugaopapercraft

Thanks for the advice! Firstly, I certainly didn't intend each function to run in sequence as you describe. Rather, each should occur simultaneously. The servos, motors, and steppers all should fire at the same time while the sensor value is less than 70.  Does this mean that calling the functions within the loop is an altogether wrong method?

As for power, I have an 8 amp, 12v supply. I'll disable the functions, one by one as you suggest.

Go Up