Stewart platform on esp32

Hi all.
I built the stewart platform using hobby servos, arduino and quaternion mathematics. Now I want to try to transfer the project to stepper motors with a planetary gearbox, since the idea came up to use the platform as a robot, but the noise from the servos is very strong.
Found your wonderful project Jackpot CNC Controller Board.
If I understand correctly, this is a regular esp32 and I can program the board as usual? It’s just that the outputs/inputs are predetermined.

1 Like

It also has a gpio expander controlling some of the outputs over I2C. Take a close looks at the schematic to see which outputs are controlled by that gpio expander.

The esp32 isn’t bootloader locked or anything. You can put whatever code you want on it.

You can also edit the schematic and board layout in easyeda and have them build you slightly modified versions.

Please post any details. That project seems awesome.

2 Likes

Thank you, I placed an order. I will wait for a parcel. At the same time, I will order stepper motors with planetary gearboxes. A little later I’ll post my notes on the theoretical part of the platform’s operation on quaternions (there are practically no sines/cosines and should work quickly on microcontrollers) - I need to remember it myself and translate it into English.

2 Likes

I use quaternions at my work to avoid the ambiguity of euler angles. I don’t really deeply understand them. But I know enough to use them. I still convert to Euler angles when I debug them :slight_smile:

But I code for Linux and have plenty of CPu and GPU power.

2 Likes

Well, I guess I did not take every math class known to man kind… Something I have never even heard of let alone touched.

1 Like

In fact, such a branch of mathematics does not exist :wink: Except for linear quaternion algebra…
This is my idea - “quaternion mathematics”, but it means exactly what it means - the use of quaternions for an exact position in space, since they do not have the disadvantages of Euler angles, airplane or ship ones. Although they cannot be understood digitally, code and mathematics are very enjoyable to work with.
For example:
I use the HTC Vive controller as a 6-axis mouse in Blender (3 translation axes and 3 rotation axes). By default, position data from the controller appears as if it is turned upside down and the starting coordinate point is inside the controller.

1 Like

I use a python script to work with it and consider the bottom of the controller as the starting coordinate point, so I get a matrix, through OpenXR - I transform it into a position vector + rotation quaternion, rotate the vector by the resulting quaternion and subtract the resulting vector from the vector and get a normal “picture” ". I couldn’t do it with Euler angles, and it’s very difficult to get confused with matrices.
ezgif.com-video-to-gif (4)

1 Like

Yeah. One thing I have learned is you always have to write out transforms. Any time I try to just try something, it seems right until it isn’t. Then there ends up being a bunch of 90-heading kind of fixes that fix the other 90-heading bugs I have. It only ends up working if I clearly define the coordinate systems and explicitly write out the transforms.

I mostly use ROS, which has tf and tf2. I also use the tux Eigen library which is really good on full computers. I haven’t tried to use it on microcontrollers. But it handles the repetitive math and gives you an api so you can construction a transform matrix by making a Quaternion(x,y,z,w) and making a Translation(x,y,z) and just multiplying them together and by the matrix or vector you want to transform. It can do much more. My job is usually just to make sure the transform from a sensor to the robot base is correct, then let Eigen or tf2 do the math to transform the data to robot coordinates.

1 Like

Finally everything you need for the first startup has arrived (board, motors, cables).
Is there a simple example of turning stepper motors through the code? Started to dive into the maze of configurations and various libraries, it did not work right away (which is to be expected).
I’m looking at the TMCStepper library examples, but I can’t find the correct pin designations in the FluidNC configurations yet.
P.S. It turns out FluidNC uses I2SO to switch between drivers. It’s going to be tricky :wink:

I decided to go a little different way - not to write my own firmware from 0, but to use the current developments of the community. I contacted the creator (@Paciente8159) of the uCNC project, it is easier for me to understand than FluidNC - it will be easier to make kinematics and code parser for it (standard GCode commands will not work - we need more angles). I managed to compile the firmware for the board - commands are sent to the console correctly and the motors buzz, but they do not turn - it will need fine tuning. But the process is underway.

I will be writing kinematics. In parallel, I will try to describe the math in simple language. if anyone is interested - my old work is here (in Russian).

1 Like