This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Any interest in STM32 Pypilot motor controller
#1
Hi All,
I'm new to the forum for the most part but I thought I would start a thread on my build of a motor controller.

I am way more experienced with STM32 SoCs than with Arduino so I thought I would try porting Sean's motor.ino to STM32.

Here are the particulars:
RPi 4 running tinypilot.
Using the STM32CubeIDE which is very good and FREE.
Using the STM32F103 on the Blue Pill available for under $10 on ebay.
I have ported it to use the IBT-2 43 amp motor controller available from amazon for ~$5
Wiring it up is very simple. No need for PCB.

Progress:
I have spent some time going through Sean's Motor.ino code and also McNugget's version to use IBT-2. A thank you for all their efforts. McNugget's exponential analog filters, YES, right out of the FFT book!
I have a working STM32 project code on a desk top simulator- 12V motor driving a rudder position pot.
Latest version includes a complete USB stack sending analog data for logging.
I am continuing to simplify the code removing timing related complications.
It currently communicates with Pypilot on server with no errors just fine. It just gets the motor controller timeout message since current isn't reported.

Advantages:
Runs at 72MHz, don't have to worry about timing much.
Currently run 5 channels of analog through DMA at a rate faster than needed.
12bit ADC.
Hardware PWM.
All setup code is handled by IDE at HAL level.
Everything runs on 3.3V. No 5V to 3V worries. (although opto-isollators aren't a bad idea)
IBT-2 has built in short circuit and under voltage protection.
Cheap.
Oh, did I mention, CHEAP.

What I have not completed:

Right now only Rudder analog is used, Other analogs- current, voltage, temp not implemented. I'm not sure I need them in my application.
I have not implemented rudder limit switches since I have analog rudder position.
I have not implemented a watch dog timer but this is trivial (on the list).
I am not implementing EEPROMĀ  write and read as this is only needed for multi-controller environments.

If there is interest in this I will branch on github, if not it will be my solitary project. I would appreciate feedback on interest or those conversant with STM32 that would like to help.

Thanks,
Brad
Reply


Messages In This Thread
Any interest in STM32 Pypilot motor controller - by ragbagger - 2023-11-18, 04:29 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)