Moving on, I would love it if you could give me some advice on the position control implementation, in particular I am thinking of using the GenericSensor class as I think it is perfect for my application (vey thanks to add recently this in the library!). This is the configuration we are developing for a joint of the exoskeleton (img taken here):
So in my case the motor is a Flipsky 6354, the driver an FSVESC 6.7 (VESC 6) and the Harmonic drive is a Laifual drive that can provide an output rated torque of 50 Nm and 100 Nm of peak torque (2000 RPM on input) it provide a reduction ratio of 100 (so at the limb 20 RPM).
By focusing on the position sensors i would like to use for the velocity loop the hall sensors placed in the motor. Instead for the position loop i would like to use only the position sensor placed after the reduction that for now is a potentiometer (1$) or in the final implementation a particular magnetic sensor (60$) that can provide a ratiometric output or PWM or also CAN bus i think.
This choice is due to the fact that the joints cannot rotate more than 180 degree more or less, due to the limbs DoF and for the safety mechanical end stop (and also by software). Moreover the output speed is very low and the position requirements is not strict.
So the question is: in your opinion sound reasonable to use the genericSensor class? and there is a way to link to the velocity loop only the hall sensor and pass the custom position sensor only to the position loop?
If it is not possible i was thinking to use the same structure used for the PID of the position in SimpleFOC (PID library of arduino?) and close the loop “externally” in the void loop() by passing the genericSensor object created, it make sense?
