Debugging: broken circuit and/or sensor?

Your prosthetic joint was up and running, you were playing with control gains… and then something broke. How can you easily figure out what’s wrong? The steps below are based on FlexSEA-Execute, but the general principles can be applied to any circuit. Most problems are linked to external sensors (broken cable, loose crimp, etc.) or to power: this tutorial will focus on that. Start with Step 1) and move up the list when the tests are successful.

  1. Disconnect everything but power: remove the expansion connector and unplug the motor.
  2. Power up your circuit. It’s safer to use a current limited power supply, and to ramp-up from 0V up to your application voltage.
    1. Are all power LEDs ON?
    2. Any flashing LEDs? Please refer to LED conventions & codes
  3. Connect your programmer/debugger (MiniProg3) and make sure that you can program the microcontroller.
  4. Open main.h and check your project configuration. This is what I have as a starting point (see Understanding main.h for more details):

ds1
The first step is to disable as many modules as possible. To debug with the GUI, I would keep USE_USB, USE_COMM & USE_I2C_1 only. Program the board and make sure that you can launch the GUI and see some of the sensor values (you should be able to read voltages and temperature). Add USE_I2C_0 and USE_IMU, but do not enable external I2C sensors (comment out USE_EXT_I2C_STRAIN, USE_MINM_RGB and USE_AS5048B). Try it: gyroscope and accelerometers should work.
At this point you can connect the Expansion connector and enable external I2C modules one by one. Once you are done with I2C sensor you can do the same procedure for SPI sensors, and any other peripherals. Hopefully this will allow you to identify what’s preventing your code from working. Please take a look at Debugging FlexSEA-Execute with the MiniProg3 for another debugging strategy that can be used by itself, or in combination with what is covered in this post.