Troubleshooting: motor not spinning - RoboDurden/Hoverboard-Firmware-Hack-Gen2.x GitHub Wiki

config.h

Make sure controller does not turn off on low battery:

	//#define BATTERY_LOW_SHUTOFF		// will shut off the board below BAT_LOW_DEAD = BAT_CELLS * CELL_LOW_DEAD, 

if you power the board while testing with the 1.5A charger, make sure to disable charget state detection. Normally, motor will stop when charger is plugged in.

		#define DISABLE_CHARGESTATE	//active this if you test with the charger plugged in as the power supply with max 1.5A

There are several safety checks before motor is fed with energy.

You should check these with one of the following methods:

These are the parameters to check:

bldc.c

currentDC
bldc_enable
timedOut
	if (currentDC > DC_CUR_LIMIT  || bldc_enable == RESET  || timedOut == SET)

pos
	if (pos == 0) 	// 0b000 and 0b111 should never happen with the three hall sensors

// runtime values to check going non zero when speed!=0 is sent:

iBldcInput
bldc_inputFilterPwm
bldc_outputFilterPwm
	bldc_inputFilterPwm = Driver(iDrivingModeOverride,iBldcInput);		// interpret the input as pwm/speed/torque/position.
	// Calculate low-pass filter for pwm value
	filter_reg = filter_reg - (filter_reg >> iFILTER_SHIFT) + bldc_inputFilterPwm;
	bldc_outputFilterPwm = filter_reg >> iFILTER_SHIFT;
	// Update PWM channels based on position y(ellow), b(lue), g(reen)
	bldc_get_pwm(bldc_outputFilterPwm, pos, &y, &b, &g);

if RemoteDummy works but RemoteUart doesn't

  • Check with testspeed.ino that you receive feedback from hoverboard every 100ms: iSpeedL, iOdomL, etc.
  • Run Autodetect binary with the serial port you intend to use and check with Autodetect.ino or a cheap USB-Uart-dongle the incomming readable ascii data and see if the user interface responst to sending keys.
  • Check RemoteUart.c:RemoteCallback() is called while sending data from ESP/Arduino. Do this by monitoring iReceivePos, setting a F9 breakpoint or DEBUG_LedSet(SET,0)
  • If connecting to PA2/PA3 (mostly the masterslave header), these pins are not 5V tolerant. You might have killed the rx pin with 5V. add iBug = digitalRead(PA3); before main.c:if (millis() < iTimeNextLoop) and monitor with StmStudio/McuViewer or DEBUG_LedSet(digitalRead(PA3),0)

if RemoteUart works but RemoteUartBus doesn't

RemoteUartBus is more tricky as it only sends feedback data to ESP/Arudino when it successfully has received a speed/steer command.

  • If using multiple boards connected to the bus, add diodes like explained in the RemoteUartBus page.
  • Be sure to have flashed firmwares with the correct slave ids.
  • Again debug for incoming data with StmStudio, VisualCode or DEBUG_LedSet