jcchurch13 / Mechaduino-Firmware

Hardware available here:
http://tropical-labs.com
Other
389 stars 232 forks source link

Anti-cogging, proof of concept #43

Open charles-blouin opened 3 years ago

charles-blouin commented 3 years ago

Hello there,

I made a test implementation of anticogging. Here is a video. It is especially noticeable for fine control in velocity and torque mode.

The calibration is done in python for now. It should be migrated to the firmware, similarly to the encoder calibration.

The calibration is longer, as it requires finer steps. It should be done if forward and reverse direction, and averaged, as there is a constant friction term. The blue line is a calibration pass in both directions.

image

image

Changes to mechaduino: https://github.com/charles-blouin/Mechaduino-Firmware/commits/cogging Calibration code https://gitlab.com/charles-blouin/pendulum-ml/-/tree/master/anticogging_calibration

You can run 'measure-torque-ripple' followed by interpolate_360

ChristianFrisson commented 3 years ago

Hi @charles-blouin, anti-cogging is a very interesting feature for Mechaduinos and your video is compelling!

I can access your github fork, but I can not reach your gitlab repository (error 404 Not Found). Could you please check?

Kind regards, Christian

charles-blouin commented 3 years ago

@ChristianFrisson Sorry about this, it is fixed.

It may be possible to reuse the rotary encoder calibration code for an anticogging calibration routine. The hardware may have just enough RAM. Right now, the encoder is calibratedwith 200 points in an array named fullStepReadings[spr]. For the anticogging, we need a little over 360*4 points. The calibration could be done in two passes, so the full calibrated array with 16k points would be updated after the second calibration pass.

mmwolbrink commented 3 years ago

This Sparked my interest, I'm going to see if I can integrate this into mechaduino firmware. I will keep you guys posted.