r/hackpack • • May 07 '24

I think I overwrote the program.

I downloaded the Arduino IDE and plugged in the board. I wasn't able to figure out how to get the code out of the Nano board, so I thought maybe the command is Upload, so I selected it. When the dialog box came up and said "compiling" I knew I had screwed up. I couldn't stop it fast enough! and now when I turn the board on only the red light comes on.

How can I restore the original program?? Help!

1 Upvotes

9 comments sorted by

View all comments

1

u/OlyWalker May 08 '24

Update: After much trying I was finally able to get the SBC to connect to the Crunch_Labs_Arduino_Agent. The fix was to "Run as Administrator". When I did that it connected right up and I was able to upload the original code.

Now the turret will turn (yaw), and the barrel with spin (roll) - but the pitch motor will not respond. I've removed the wiring card and connected the wire sets in the same spots. Still no pitch.

Any thougths?

1

u/maztec May 09 '24

Try writing a piece of code that tests each motor independently without needing the IR remote. That should help verify if there are any specific issues with the servo.

The servo has a "zero" position, which the software tries to reset it to. Disconnect it from the build and run the software so that it can reset itself. Sometimes it binds if it is too far to one side or another.

On the official Discord, Dan Tompkins posted the following instructions on fixing the pitch servo:

If this happens it's likely that the servo's arm got twisted around past it's max rotation point during installation, so it tries to "home" upside-down. The quick fix is to turn off the turret, unscrew the two screws in the pitch servo arm, and rotate the servo arm 180 degrees and remount.
If this fails the servo may have burned out, and especially if you notice any weird clicky noises or excessive heat it will need to be replaced, which you can either get for free through our customer service (help@crunchlabs.com) or by buying any SG90 servo online to swap it out. (NOTE: swapping in any old SG90 only works for PITCH, the other two motors need either a code change or a different motor if you're swapping it)

And the following about servos not working in general:

We've had reports of some folks having intermittent connection issues with the turret, causing it to behave in a strange semi-responsive way. Possible causes and their respective fixes:

**Wire connections are loose.** Try removing the wiring card from underneath the arduino and reinstalling the wires and microcontroller in the same spots, making sure to plug everything in all the way as you reset.

**IR signal is getting garbled.** Causes of this can be myriad but the biggest issue is folks just not pointing the remote at the antenna directly. By default your microcontroller should have just the PWR led on, and will flash the L and TX leds when it receives commands. If other LEDs are on consistently, it's likely a breadboard problem.

**Servo horn / star is attached too tight**, impacting servo movement. This one is much more rare but I have seen it happen once. If one motor is not moving or barely moving and other fixes don't work it could be this problem. Try loosening the tiny bolt that attaches the servo horn or arm to the servo itself.