Slow/ Fast blink LEDs no longer working, teensy will not upload properly.

Status
Not open for further replies.

Aero

New member
So here's the situation. I recently purchased a new teensy 3.2 and I am trying to get it to run its first program for one of my servo motors, titled "sweep" (from the arduino sketch examples). The problem is, once I uploaded the sketch, the servo motor kind of twitched, did a partial sweep, then stopped. I am under the interpretation that this code is supposed to sweep back and forth indefinitely, correct? Aside: How would I stop it from sweeping, or rather how would I end the program's infinite loop?

Furthermore, the fast and slow blinks for the LEDs, programmed from the tutorial, are no longer working, and whenever I plug in the teensy the LEDs will not turn on at all regardless of whether I am in manual or automatic mode. I am unsure of what is going on and any help would be appreciated.

I've also went ahead and included a screenshot of the code and my setup with the teensy loader:

Sweep.PNG

Thanks.
 
Can you attach a photo of how your T3.2 is wired to your servo? Servos can consume more power than the USB 5v from T3.2 can provide, so you might need a separate 5v supply with common ground to T3.2.
https://www.pjrc.com/teensy/td_libs_Servo.html

If nothing is attached to T3.2, does the simple Blink example flash the LED?

I don't know what tutorial you are referring to regarding "fast and slow blinks"

EDIT: FWIW, the Sweep example works on my T3.2 with a hextronik HXT900 servo. The simple sweep consumes around 200 ma with idle about 6 ma. if you stall the motor, power consumption can go to 700 ma. Here is plot of servo current sampled at 100 ms, with servo steps every 15 ms. Y-axis is milliamps (X axis is sample count)
servo.gif
 
Last edited:
Forum rule... post full code, so that others willing to help might quickly copy and paste it into their Arduino IDE in order to help debugging. Don’t expect volunteers towaste their time googling for specific libraries, demos or tutorials. Help them help by giving all details in the first post.
 
The problem is, once I uploaded the sketch, the servo motor kind of twitched, did a partial sweep, then stopped.

Was the motor getting its power from USB?

This sounds like the sort of problem that happens when a motor tries to draw more power than your USB port can supply. USB ports (and hubs) are supposed to have over-current protection which automatically shuts the power off in emergency situations. How it's implemented varies quite a lot, sometimes very poorly in cheap PCs. Some older Macintosh laptops had very good (perhaps too good/sensitive) overcurrent detection.

As a first step, disconnect that motor and cold reboot (complete power off, not just the front panel button, physically unplug the cord if needed) your computer. If using USB hubs, cold reboot those too. Hopefully when you boot back up the USB port will work again, and Teensy is hopefully not damaged and can be reprogrammed with the LED blink.
 
Can you attach a photo of how your T3.2 is wired to your servo? Servos can consume more power than the USB 5v from T3.2 can provide, so you might need a separate 5v supply with common ground to T3.2.
https://www.pjrc.com/teensy/td_libs_Servo.html

If nothing is attached to T3.2, does the simple Blink example flash the LED?

I don't know what tutorial you are referring to regarding "fast and slow blinks"

EDIT: FWIW, the Sweep example works on my T3.2 with a hextronik HXT900 servo. The simple sweep consumes around 200 ma with idle about 6 ma. if you stall the motor, power consumption can go to 700 ma. Here is plot of servo current sampled at 100 ms, with servo steps every 15 ms. Y-axis is milliamps (X axis is sample count)
View attachment 14138

Hey, I will go ahead and post the picture, however, I am aware of how much current would be necessary so I have attached two battery packs of three 1.5V AA batteries (~5V total) in parallel to supply roughly around 2A of current, which should be enough for the four micro-servo motors I will be using in total.

The fast and slow blinks is from here, in PJRC's teensy website: https://www.pjrc.com/teensy/loader_win10.html. Any clarification you could give me would be great; I have no idea if these LED blinks are still supposed to be running or not. I am confused as to how teensy loader works and how programs work.

Here is the physical circuit. As you can see, I decided to solder on pins to pinouts 20-23 with the intention of using these for the four signal outputs for my four servo motors. I don't know if this was the correct decision.

Circuit.jpg
 
Was the motor getting its power from USB?

This sounds like the sort of problem that happens when a motor tries to draw more power than your USB port can supply. USB ports (and hubs) are supposed to have over-current protection which automatically shuts the power off in emergency situations. How it's implemented varies quite a lot, sometimes very poorly in cheap PCs. Some older Macintosh laptops had very good (perhaps too good/sensitive) overcurrent detection.

As a first step, disconnect that motor and cold reboot (complete power off, not just the front panel button, physically unplug the cord if needed) your computer. If using USB hubs, cold reboot those too. Hopefully when you boot back up the USB port will work again, and Teensy is hopefully not damaged and can be reprogrammed with the LED blink.

Hi, i'm aware of the issue you are talking about with drawing too much current from the USB, however that is not the case for me; rather, I used two battery packs (see the reply above).
 
In the photo, I don't see any connection to Teensy's GND pin.

You need GND, the battery negative, and motor GND connected together for things to work.
 
Servos can consume more power than the USB 5v from T3.2 can provide, so you might need a separate 5v supply with common ground to T3.2.

"... a separate 5v supply with common ground to T3.2."


"I decided to solder on pins to pinouts 20-23" -- i can't quite tell from the photo, but the T3.2 gnd pin needs to be soldered too. For breadboard work, you can buy a T3.2 with soldered header pins.
https://www.pjrc.com/store/teensy32_pins.html
 
Last edited:
Hey guys, thanks for all the help. Turns out that the common ground issue was correct; this is what was necessary to get the program to work. Also I now understand that the fast/ slow blinks were just separate programs that weren't being run while the servo program was being run; I had gotten confused as to what their purpose was.

With all of that being said, for my knowledge going forward, could someone explain to me why there needs to be a common ground with the T3.2? I was under the impression that as long as the power source (the two battery packs) and the servos were grounded with eachother, there should be no issue as the teensy only sends a signal to the servo. Is this signal based on voltage? That would be the only way I could explain why the common ground needs to occur.
 
Yes, the control signal for the servo(s) is voltage based. Just hi - lo, but a common reference potential is needed, though.
 
Even if the signal were a current (which is rare, except certain industrial sensors which use a 4-20 mA current loop), you'd still need GND or some other wire for the current to flow in a loop.
 
Status
Not open for further replies.
Back
Top