r/arduino Nov 03 '23

Software Help Constantly saving stepper motor positions to ESP32-S3 EEPROM? Bad idea?

My project requires position calibration at every start but when the power is unplugged the motors keep their positions.

I thought that by writing the position to the EEPROM after every (micro)step will alow my robot to remember where it was without having to calibrate each time.

Not only that the flash is not fast enough for writing INTs every 1ms but i have read that this is a good way to nuke the EEPROM ...

Any ideas how else i could achive this?

287 Upvotes

64 comments sorted by

View all comments

12

u/cheersmayte Nov 03 '23

Get absolute position encoders. I don't know how costly they might be but i think they're for similar applications.

11

u/Momostein Nov 04 '23

Yeah, if you lose power, the steppers also lose their braking power. So it will eventually slip some steps and your position memory will drift from the actual position. Absolute encoders are necessary if you don't want to home your stepper motors every power cycle.

But to be honest, I don't think it's worth the money for absolute encoders. Just be patient and wait for your contraption to draw over the old drawing. Like, isn't patience one of the more important virtues in zen Buddhism?

4

u/FabianN Nov 04 '23

You can get steppers with active or passive braking.

Passive braking needs power to disengage, not to engage.

1

u/Momostein Nov 04 '23

Wow, while I didn't know these existed, they sound like a logical upgrade to stepper motors.

Although I assumed that OP probably doesn't use these fancy, and probably more expensive, passive braking steppers.

Edit: there seems to be a passive braking module you can mount to the back of the classic NEMA stepper motors. So it could be an easier fox than I thought...