dzid26 / StepperServoCAN

Closed loop stepper motor controller with CANbus capabilities. This Project open source hardware and code, support platformio build and upload firmware.
https://shop.retropilot.org/product/stepperservocan
19 stars 5 forks source link

Max deviation was 182.99 deg Large deviation. Reposition the magnet error after reposition TLE5012 to bottom layer #25

Open esonhon opened 6 months ago

esonhon commented 6 months ago

Hi, Because my motor has a large space between PCB and magnet, I tried to move the TLE5012 to bottom side of the PCB. With PIN1 opposite with TOPLAYER PIN4. Got the error when calib: Max deviation was 182.99 deg Large deviation. Reposition the magnet May I change some lines of code to match the hardware changes? Have investigated the code, tried to modify code but without success. Need ur help! thanks!

dzid26 commented 6 months ago

Can you first try to clear the eeprom using stlink utility or by other means? This is to allow motorWiring parameter to relearn the direction after flipping the sensor.

Btw, do you have a photo of your modified PCB setup?

esonhon commented 6 months ago

Thanks for your reply. I have tried clear persist storage, even tried in a new board. PCB bottom emulation graph attached. BTW, I imported the Kicad project to Altium and make some minor changes in layout. BOTPCB For your reference, the top most socket is for stepper, U5 is tle5012B, the exposed pad is for A4950s, just like your original design.

dzid26 commented 6 months ago

Ok. I was wondering what kind of motor setup you have that requires the sensor on the other side.

As to your problem, can you tell more - does the motor rotate over one rotation back and forth?
If yes, it probably means it is rotating "wrong" direction.

Is the angle sensor working? Using the debugger (press F5 in vscode) might be useful.

esonhon commented 6 months ago

It's a 42 stepper with think shell, so the shaft is far from the shell. And the magnet I've got is not high enough. Yes, the motor rotate back and forth, but you're right, it rotated in wrong direction. Thanks, I'll try to figure it out.