Open RoboDoig opened 1 month ago
Some references here for the conversion: The motor and encoder: https://www.omc-stepperonline.com/nema-23-closed-loop-stepper-motor-3-0nm-424oz-in-encoder-1000ppr-4000cpr-23hs45-4204d-e1000 The driver: https://www.ebay.co.uk/itm/203328514020?chn=ps&_ul=GB&_trkparms=ispr%3D1&amdata=enc%3A1cFLpOBQ0S3SeFd65lPxyRA15&norover=1&mkevt=1&mkrid=710-134428-41853-0&mkcid=2&mkscid=101&itemid=203328514020&targetid=2425733423477&device=c&mktype=pla_with_promotion&googleloc=9045997&poi=&campaignid=21697391927&mkgroupid=162558106770&rlsatarget=pla-2425733423477&abcId=10027104&merchantid=6995734&gad_source=1&gclid=Cj0KCQjwr9m3BhDHARIsANut04Yqzr46MGG2AlwQP8V43PSc80ZSB8CLXb9xzI55z6gSlySU2LqunjAaAh_XEALw_wcB The encoder decoding approach: https://ww1.microchip.com/downloads/en/AppNotes/00002434A.pdf
Application note for the specific chip on H2: https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ApplicationNotes/ApplicationNotes/doc8109.pdf
Confirmed with @EleonoraAmbrad today, the signal from H2 comes from the decoded quadrature counts from the chip's integrated decoder. Datasheet for the encoder says 4000 counts per revolution, confirmed that the main shaft turns a complete revolution for every 4000 units in Bonsai.
To convert this to main platform angle we need to know effective gear ratio between main shaft and platform.
Hi @ederancz, @EleonoraAmbrad - following our conversation on Monday, can I mark this issue as closed?
To clarify the main points from Monday:
Hi @EleonoraAmbrad , can you please get Iakov to check the encoder counts and motor pulses from the recording? If memory serves, there was 1 full motor rotation (6400 pulses) followed by 2x1 full platform rotation (38400 pulses). So the encoder reading should be 4000 and 24000. If it adds up (±0.1%), you can close the issue.
Hi @RoboDoig , has this recording been saved? We could not locate it with Nora
Ah sorry I didn't fully parse the last message from @ederancz .
We did the test on a minimal debug workflow with no logging so nothing was recorded, we were just monitoring the visualizers.
The workflow we used is called DirectPulsesTest.bonsai. It just writes the desired pulses (6400) to the motor driver on a key press. If you want to record you could just dump the H2 events to a binary file with MatrixWriter. Interpreting the encoder value should be straightforward. For the motor pulses, you will get a HARP timestamped event when the number of pulses is written (register 33) though you already know how many pulses were written as it's set in that workflow directly.
I will do that on Monday together with the motion cloud test!
@EleonoraAmbrad I updated DirectPulsesTest.bonsai to log data - in the ae-dev branch
Need to understand how the encoder value from HARP H2 can be converted to a real-world angle.