linuxcnc-esp32 Software Stepping over Ethernet Using ESP32

More
06 Dec 2021 09:18 #228428 by epineh
Hi jzolee, thanks for the quick reply.
With 3 axis what would be the maximum step pulse rate ?

Please Log in or Create an account to join the conversation.

More
07 Dec 2021 08:08 #228509 by jzolee
Hi epineh, I measured the execution time of the code and based on this:
120 kHz / number of axes.

1 axis: 120 kHz
2 axes: 60 kHz
3 axes: 40 kHz
4 axes: 30 kHz

Please Log in or Create an account to join the conversation.

More
08 Dec 2021 04:43 - 08 Dec 2021 04:43 #228594 by Bari
Is than an LPT connector on the left side of the enclosure using a standard pin-out for connection to a BOB?
Last edit: 08 Dec 2021 04:43 by Bari.

Please Log in or Create an account to join the conversation.

More
08 Dec 2021 05:46 #228598 by tommylight

Is than an LPT connector on the left side of the enclosure using a standard pin-out for connection to a BOB?

Looks like DB15 used for MIDI and gaming joysticks back in the days.

Please Log in or Create an account to join the conversation.

More
08 Dec 2021 19:52 #228644 by Micromachining

Please Log in or Create an account to join the conversation.

More
09 Dec 2021 01:09 #228667 by eng
I'm watching this video, soon I'll run the tests and see if I could get tr more i/o,

Please Log in or Create an account to join the conversation.

More
10 Dec 2021 22:38 - 11 Dec 2021 08:18 #228826 by jzolee
Hi eng, I improved the system:
i added more inputs and outputs as well as pwm option.

GPIO  2 -> OUT-00 or PWM-00
GPIO  4 -> OUT-01 or PWM-01
GPIO 25 -> OUT-02 or PWM-02
GPIO  1 -> OUT-03 or PWM-03
GPIO 14 -> OUT-04 or PWM-04
GPIO 15 -> OUT-05 or PWM-05

GPIO 26 <- IN-00 {pullup}
GPIO 27 <- IN-01 {pullup}
GPIO 32 <- IN-02 {pullup}
GPIO 33 <- IN-03 {pullup}
GPIO 34 <- IN-04 {no pullup}
GPIO 35 <- IN-05 {no pullup}
GPIO 36 <- IN-06 {no pullup}
GPIO 39 <- IN-07 {no pullup}

GPIO 12 -> step-0
GPIO 13 -> dir-0
GPIO 16 -> step-1
GPIO 17 -> dir-1
GPIO 21 -> step-2
GPIO 22 -> dir-2

GPIO  5 -> W5500 SCS
GPIO 18 -> W5500 SCLK
GPIO 19 <- W5500 MISO
GPIO 23 -> W5500 MOSI

In the ethernet library, I modified the SPI frequency in the w5500.h file because sometimes the data transfer was faulty.
I used a new method to calculate the step period time, which is faster. So the step frequency may be higher, but I can't control it because my machine can't do more than 40 kHz.

pwm can be activated on the outputs by setting the value of the parameter udp.pwm.xx.freq (1...65000 Hz)
The pwm duty ratio can be set on pin udp.pwm.xx (0 ... 1)

 

File Attachment:

File Name: udp_2021-12-10.comp
File Size:6 KB


 

File Attachment:

File Name: HAL2UDP_20211210.zip
File Size:75 KB




 
Attachments:
Last edit: 11 Dec 2021 08:18 by jzolee.
The following user(s) said Thank You: Bari

Please Log in or Create an account to join the conversation.

More
11 Dec 2021 00:08 #228833 by eng
I'm grateful for your effort, I'll do the tests and see how it turned out, could you ask me a question? I'm wanting to go deeper into your code to be able to use it on the stm32f407, do you believe it would be possible to use this same code with changes? I'm thinking about it because it would be an interesting way out to have more i/o ports.

Please Log in or Create an account to join the conversation.

More
11 Dec 2021 01:22 #228836 by eng
You could leave us your ini file and hal file because I'm having errors because you removed the maxvel, maxacc and put the accel.

Please Log in or Create an account to join the conversation.

More
11 Dec 2021 06:39 - 11 Dec 2021 08:18 #228851 by jzolee
Hi eng, maxvel is not required, it was a remnant of an older code when I tried position tracking mode.
accel = maxacc.
The code is currently running in speed mode, with this acceleration following the speed command. I just renamed it, in fact the code only works with one kind of acceleration.

I'm sorry, but I also renamed the io pins in udp.comp:
udp.in.xx
udp.out.xx

ps.
In the code I took advantage of the following features of esp32:

four hardware timers up to 25 ns / tic -> step generation for 3 (4) axes

two cores: one deals only with step generation, the other with everything else

FPU -> fast floating point calculation

High cpu speed (240Mhz)

I think it's worth implementing the code on another microcontroller if it has these capabilities. You may want to take advantage of other capabilities that aren't in ep32.
Last edit: 11 Dec 2021 08:18 by jzolee.

Please Log in or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum