Remora - Rpi Software Stepping Using External Microcontroller via SPI

More
24 May 2021 00:57 #209964 by alkabal
Hi

Great job you have done and share, many thanks for comunity !

Any plan to use ethernet for replace spi ?

Br

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

More
24 May 2021 04:10 #209994 by scotta

Hi

Great job you have done and share, many thanks for comunity !

Any plan to use ethernet for replace spi ?

Br


I've got a W5500 ethernet module sitting on the bench. Just no experience with ethernet and UDP and the best way to setup on the firmware site. The SPI running under DMA has nearly zero cpu overhead whereas ethernet comms would come with some overhead.

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

More
24 May 2021 23:07 #210131 by cakeslob
Ok, Im getting this error Linuxcnc side when I try to get out of estop
Bad SPI payload = 0
sometimes
Bad SPI payload = ffffffff

This is what I get from UART
Remora PRU - Programmable Realtime Unit
## Entering SETUP state
1. Reading json configuration file
Mounting the filesystem... OK
Opening "/fs/config.txt"... OK
Json config file lenght = 2381

Closing "/fs/config.txt"... 
2. Setting up DMA and threads
Creating thread 40000
Creating thread 1000

3. ParsiConfig deserialisation - Deserialization succeeded

Servo thread object
Reset pin
Make Reset Pinule
Creating Pin @
  portNumber = 1
  pin = 31

Base thread object
X - Joint 0 step generator

Creating a std module
Creating Pin @
  portNumber = 2
  pin = 1
Creating Pin @
  portNumber = 2
  pin = 2
Creating Pin @
  portNumber = 2
  pin = 6

Base thread r

Creating a std module
Creating Pin @
  portNumber = 2
  pin = 8
Creating Pin @
  portNumber = 0
  pin = 19
Creating Pin @
  portNumber = 0
  pin = 20

Base thread object
Z - Joint 2 step generator

Creating a std module
Creating Pin @
  portNumber = 0
  pin = 21
Creating Pin @
  portNumber = 0
  pin = 22
Creating Pin @
  portNumber = 2
  pin = 11

Base thread object
E0 - Joint 3 step generator

Creating a std module
Creating Pin @
  portNumber = 2
  pin = 12
Creating Pin @
  portNumber = 2
  pin = 13
Creating Pin @
  portNumber = 0
  pin = 11

Servo thread object
Make Temperature measurement object
Extruder tenperature sensor

Creating a slower module, updating every 1000 thread cycles
Creating Thermistor Tempearture measurement @ pin 0.23
Creating Pin @
  portNumber = 0
  pin = 23
Temperature sensor error, pin 0.23 reading = -273.15
Temperature sensor error, pin 0.23 reading = -86.8344
Start temperature = -86.8344

Base thread object
RC servo for probe
Make RC Servo at pin 2.0

Creating a slower module, updating every 4000 thread cycles
Creating RC servo at pin 2.0
Creating Pin @
  portNumber = 2
  pin = 0

Base thread object
Encoder
Creating Quadrature Encoder at pins 1.20 and 1.22
  Encoder has index at pin 8

Creating a std module
Creating Pin @
  portNumber = 1
  pin = 20
Creating Pin @
  portNumber = 1
  pin = 22
Creating Pin @
  portNumber = 8

Servo thread object
X min
Make Digital Input at pin 1.29

Creating a std module
Creating Pin @
  portNumber = 1
  pin = 29

Servo thread object
X max
Make Digital Input at pin 1.28

Creating a std module
Creating Pin @
  portNumber = 1
  pin = 28

Servo thread object
Y min
Make Digital Input at pin 1.27

Creating a std module
Creating Pin @
  portNumber = 1
  pin = 27

Servo thread object
Y max
Make Digital Input at pin 1.26

Creating a std module
Creating Pin @
  portNumber = 1
  pin = 26

Servo thread object
Z min
Make Digital Input at pin 1.25

Creating a std module
Creating Pin @
  portNumber = 1
  pin = 25

Servo thread object
Z max
Make Digital Input at pin 1.24

Creating a std module
Creating Pin @
  portNumber = 1
  pin = 24

Servo thread object
Extruder fan switch
Make Switch (On) at pin 0.0

Creating a std module
Creating a Switch @ pin 0.0
Creating Pin @
  portNumber = 0
  pin = 0

## Entering START state

Starting the BASE thread
Registering interrupt for interrupt number = 1
	power on timer
	timer set MCR
	timer set PR
	timer set PRO
	timer start


++ MbedOS Fault Handler ++

FaultType: HardFault

Context:
R0   : 10003C00
R1   : AA3DE7CC
R2   : 00000016
R3   : FEFFC713
R4   : 10003B78
R5   : 00000068
R6   : 00000001
R7   : 00000000
R8   : 00000000
R9   : 200801E0
R10  : 20081324
R11  : 00000006
R12  : 00C80000
SP   : 10007F80
LR   : 00010995
PC   : 0000FE8E
xPSR : 21000011
PSP  : C1688394
MSP  : 10007F60
CPUID: 412FC230
HFSR : 40000000
MMFSR: 00000000
BFSR : 00000082
UFSR : 00000000
DFSR : 00000000
AFSR : 00000000
BFAR : AA3DE7E0
Mode : Handler
Priv : Privileged
Stack: MSP

-- MbedOS Fault Handler --


Cable is 4in long. Copied exactly the same as manual, even colour.
Config is remora-xyz sample config
Board is skr v1.4 , with lcp1768
Loaded firmware lcp1768 firmware.bin to the root of sd
Loaded skr1.3 config.txt to root of sd

How can I diagnose this?
Ive done this from the github, but dont know where to go now.
Remora running now on RPi 4 without issues! The SPI clock is provided by the GPU so adding gpu_freq=200 into /boot/config.txt did the trick. I'll update the docs.
Attachments:

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

More
24 May 2021 23:14 #210135 by scotta
The hard fault output at the bottom points to a configuration error. And my guess is its the encoder. This is the error "Encoder has index at pin 8". This is not a valid port and pin assignment. And you will see that the pin is not created properly at the bottom. If you do not need the encoder remove it from the config.txt and see what happens.

Base thread object
Encoder
Creating Quadrature Encoder at pins 1.20 and 1.22
Encoder has index at pin 8

Creating a std module
Creating Pin @
portNumber = 1
pin = 20
Creating Pin @
portNumber = 1
pin = 22
Creating Pin @
portNumber = 8

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

More
24 May 2021 23:36 #210144 by scotta
Also, the gpu_freq=200 is no longer required.

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

More
24 May 2021 23:40 #210146 by Aaroncnc
Any advantage to overclocking the pi?
Less latency?
Also I am In the process of rebuilding vtk for rpi4 64bit for python 2.7 and qt5. Should be done in a few more hours.
The 64bit rpi images seem to have better latency.

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

More
24 May 2021 23:42 #210147 by scotta
Not sure if there would be an advantage. As we only need a Servo thread, latency is not a huge issue. The 64bit would hopefully allow full use of the memory on a 4GB and 8GB models though.

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

More
24 May 2021 23:55 #210148 by Aaroncnc
I have not tried to remove the ram Restrictions
Any advice on rebuilding the vtk?

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

More
24 May 2021 23:59 #210150 by scotta
I battled with VTK for Buster and the newest version being 7.1.1 that I could get to work with the state of the stable OS release. Lots of iterations and used distcc to speed things up by sharing the load across my Arch linux machines.

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

More
25 May 2021 00:46 - 25 May 2021 01:19 #210169 by cakeslob

The hard fault output at the bottom points to a configuration error. And my guess is its the encoder. This is the error "Encoder has index at pin 8". This is not a valid port and pin assignment. And you will see that the pin is not created properly at the bottom. If you do not need the encoder remove it from the config.txt and see what happens.


Ah, that will do it, didnt think about changing the config. Thanks, seems to be working now.

edit, If you guys want to play with some newer prebuilt units, I installed remora on one of these installs 64bit prebuilds, you can use full ram with them.
forum.linuxcnc.org/9-installing-linuxcnc...xcnc?start=40#204950
I had a full 4gb with the older 32bit images and its only become an issue recently, and full 8gb with newer 32bit 5.4 rt kernels evovalvo posted in another thread. the ram was explained as, that it can use full 8gb, but can only allocate max 3gb to any process
Last edit: 25 May 2021 01:19 by cakeslob.
The following user(s) said Thank You: Doogie

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

Time to create page: 0.342 seconds
Powered by Kunena Forum