Any suggestions for a better function?

Hello,

Quite a while ago i made a stepper motor setup for a robot arm and there was a problem with the jerk being too much. So i had to make a s-curve sort of speed curve for the motors. Like this: https://gyazo.com/f683e934d9e4378342c45582dd443d26 where the y is the speed and x is time.

Problem is that i tried to make a purely mathematical formula for calculating the speed at given x value and it came out completely cancerous. Here is my speed curve function: https://www.desmos.com/calculator/28ddh4m6ga

Any suggestions for a better function?

NOTE:

I’m only talking about purely mathematical suggestions! I know that it can be simplified a lot if you would write it in a programming language

Why reinvent the wheel here? Take a look at 3D printer firmwares and use a similar implementation.

1 Like

yeah I’ve been searching on google for speed curve functions and or programs but i haven’t found any. This topic seems to be too niche.

1 Like

What are you driving the steppers with?

1 Like

what? Like what the microcontroller, the stepper driver…

Yes, what interprets the commands?

idk some bullshit thing, i think it’s some fucked retarded contraption i’ve made. It’s like a node mcu with a webserver that then sends the data over i2c to another microcontroller i think an atmega328p that then directly interfaces with the stepper motor drivers

computational power or what are you thinking about here

This is where I would start with modifying jerk settings. It should have settings in its firmware you can adjust for this.

what so there is like a global c++ function that sets the jerk for stepper motors, nice there dude.

This is a configurable setting on my printer, I would assume the same for most stepper setups. If there isnt I would imagine one could be imported from something like the repetier firmware.

wait so when were we talking about printers, it’s a robot arm wtf

Most 3d printers are arduino controlled afaik.

what are you even talking about

are you trying to troll me or something

If you’re going to be rude im not going to help you anymore. Arduino controllers use the same kind of chips as the one you’re driving your arm with. They may not seem to be related but the basic principle is the same. You have stepper motors controlled by a microcontroller. I have firmware on my 3D printer that has jerk settings in every axis. The same theory should apply for you.

smh, i built everything myself so i know how it works the question here is just what a good speed curve function is!!!

Then figure it out yourself.

so wait because i built everything i have to know about stuff i haven’t done, yeah nice logic there.

you just came to a point where you don’t know the answer so you rebelled against me top kek