Recent

Author Topic: Free Pascal + ESP32 stepper motors  (Read 468 times)

ccrause

  • Hero Member
  • *****
  • Posts: 592
Free Pascal + ESP32 stepper motors
« on: June 11, 2022, 05:20:30 pm »
Testing multiple stepper motors driven by one of the ESP32's MCPWM peripherals.  Firmware written with Free Pascal on top of esp-idf.

Video: https://youtu.be/XBQaE4LeQOI

BlueIcaro

  • Hero Member
  • *****
  • Posts: 718
    • My github
Re: Free Pascal + ESP32 stepper motors
« Reply #1 on: July 06, 2022, 10:17:19 am »
Hi, that is cool!  :o

I'm very interesting in how do you make/code/design the screen. Also in the code of the driver.

Can you share the code or more info?

Thanks

/BlueIcaro

ccrause

  • Hero Member
  • *****
  • Posts: 592
Re: Free Pascal + ESP32 stepper motors
« Reply #2 on: July 06, 2022, 01:10:25 pm »
Hi, that is cool!  :o

I'm very interesting in how do you make/code/design the screen. Also in the code of the driver.

Can you share the code or more info?

Thanks

/BlueIcaro
The screen is a Nextion HMI display, which basically is a display with a processor managing the graphics and some programmable logic.  A user communicates with the screen over serial protocol, either reading or writing values of widgets or receiving events (e.g. a button touch event).  Most of the graphics in the example are static images preloaded onto the display, while some of the "animation" is simply copying bits of images onto screen using scripts running on the Nextion.  The advantage of HMI is the ease of use and light load on the connected device, the main disadvantage is cost - it is quite a bit more expensive than a bare TFT LCD screen of equivalent size.

Pascal driver for Nextion display
Pascal stepper driver - note that this driver is designed to generate step pulses and connects to a hardware stepper motor driver such as an A4988 or DRV8825 which handles the current control and micro stepping.  In its current form the software driver is aimed at speed control, not position control.

The video was part of the testing of a larger project, which I haven't yet published.  I can make a demo project if there is interest in building something similar.

stoppok

  • New Member
  • *
  • Posts: 18
Re: Free Pascal + ESP32 stepper motors
« Reply #3 on: July 06, 2022, 02:57:05 pm »
Sound very interesting to me also, a demo project would be nice.

thanks in advance,

  Stefan

ccrause

  • Hero Member
  • *****
  • Posts: 592
Re: Free Pascal + ESP32 stepper motors
« Reply #4 on: July 10, 2022, 09:13:56 pm »
The demo project: https://github.com/ccrause/fpc-esp-freertos/tree/master/examples/steppermotor. New video if this specific demo (temporary hookup, so please excuse the messy wiring): https://youtu.be/lPUFcKE1AOk

 

TinyPortal © 2005-2018