So after following the phenomenal advice and tips I’ve been given here, I think i could be close to having a working setup! I’ve wired it all up but can’t get the motor to respond correctly with the test options in Granity. Which means I’ve either got an issue with how its wired, or with the way I’ve configured the software.
Setup
Motor: Mige130ST-AM100110
Encoder: ZKD-86-1000BM
IoniCube 1x w/ Ioni Pro
STM32F407 Disco
The encoder (ZKD-86-1000BM) had this data sheet provided with the wiring colours and functions:
I wasn’t to sure how to connect it up to the X4 db15 connector as required, because the pin names aren’t all the same but I did what i thought made sense:
Make it easy for yourself - use A+/-, B+/- and Z+/-, the Z differentials = C differentials in our use-case. Then 0V, +5V and shield. That will be enough for fully functional SC1. No other signals needed.
Great, that makes sense. It’s all wired now, so i tried to test it with the ‘Test Stimulus Generation’ in Granity but it had no affect on the motor. Here are the settings:
Well, you have an incremental encoder, yet you have selected SinCos in the configuration tool? So you may want to change that to Incremental Quadrature selection instead of SinCos…
and also, in granity if you increase the torque setpoint to some value like 1000 or 1500, there should be torque generated and the torque should be smooth. Is it smooth?
The torque doesn’t seem to be smooth, its quite bouncy, I imagine the ‘position feedback’ value should increase when turns the wheel one direction and decrease when turning the other.
How ever when i spin the wheel clockwise or anti the ‘position feedback’ value remains in the negatives. I can get it to increase in the negatives but cant get it to go positive.
Yes, Mika is spot-on, the encoder should go positive from zero in one direction, negative in the other. Even if you completely disconnect the power Phases on the servo, position feedback should still increment /decrement.
It is quite easy to get the pin orientation incorrect on the 15-pin d-sub, this is what I am sure your problem is….please see attached picture, note the comment just above the image of the drive-side connector below -