Anyone success using the new homing feature in 0.5.1.1 released? Setup the min_endstop and and enable axis to closed loop control. When try to trigger homing using “AXIS_STATE_HOMING” that put the control_mode to 11, nothing happen.
Hi @skyice, I just tested the Homing feature and it seems to work ok. I fixed a small bug but it behaves. You may want to try increasing your
vel_integrator_gain, or possibly
torque_limit if the motor isn’t able to turn at a low speed . You can also increase
axis.homing_speed (default is 0.25 turns / sec, which is quite low)
Hi @Wetmelon, thanks for responding. I still struggle to get homing to work, some how some way I was able to get it to run homing once during reboot. I am trying to find out what I did incorrectly. First, may be you can help me find out if I did my wiring correctly (I am a mechanical guy trying to do electrical guy work here). I use 3.3v and 5v power source from Odrive itself to the endstop switch. I was able to get this to behave and work, with pullup enable or not. I was able to get this work with and without external pullup/pulldown 10k resistor. I was able to get the end stop switch to trigger just fine without external resistor so I wonder is the external resister even necessary.
I was able to observe one weird behavior some how when i set the endstop is_active_high=True, pullup=False and wire the 3.3V to the N.O switch to gpio_num 5. While the axis current state = 1 (IDLE), I can manually trigger the switch and get the “MIN_ENDSTOP_PRESSED”. But somehow, if I send in request to change axis state to ‘Closed Loop control’, I immediately get the “MIN_ENDSTOP_PRESSED” triggered. Seem like there is some noise voltage that causing this.
When using get_adc_voltage(5), i always get around 1.5V. Is that normal? Even when I apply 3V to gpio 5 it still read around 1.5V. get_adc_voltage from 0 to 4 is around 0.6 to 0.8. I am somewhat confuse now with the get_adc_voltage function. What is the correct integer let say for gpio 5?
My guess i got some issue with my wiring, but cannot see where. Can you share what wiring set up you do to make it work?
That is not normal. You should try putting a multimeter on it and measure the actual voltage…
I use a cheap 3D printer endstop like these (not an endorsement, first thing on google). Connect 5V and GND, then signal goes to one of the GPIO pins. They’re wired as in configuration 4 - Normally open, active low, with a pull-up resistor.
Thanks! I will give it a try.
Just for clarification, to read gpio 5, using “get_adc_voltage(5)” is the right command? this function return all value for address 0 all the way to 128 or more, just confuse what voltage it actually returning. Even when I get the end stop to trigger, get_adc_voltage still give me the same reading.
If I measure the GPIO with multimeter, I got 0V when disable the pullup, and 3.3 when enabled pullup. Seem to be normal there.
Discover something but not sure if this is the expected behavior with gpio and get_adc_voltage. I change the endstop gpio to other number than 5 and reboot odrive. Connected GND to gpio 5 and get_adc_voltage will return 0.00V, connected 3.3V to gpio5 then get_adc_voltage will return 3.26V. It appear that the get_adc_voltage function only working when the gpio is not assigned to endstop. I did save config and reboot after changing the configuration.
When I put 5V to gpio 3,4,5, get_adc_voltage only return 2.4V. Is that what expected?
Update on homing.
I am able to get homing working now. I decided to use gpio 6 and 7 and stay away from 5 as for some reason it has a floating voltage of around 1.5V. **not sure about 6 & 7 as get_adc_voltage return ‘non’
Below is the setup I used, gpio_num = 6 and 7, offset =-0.5, is_active_high=False, pullup=False, debounce_ms=50. I am using automation direct limit switch https://www.automationdirect.com/adc/shopping/catalog/sensors_-z-_encoders/limit_switches/metal_compact_limit_switches/metal_plunger_with_roller_actuator/aem2g14x11-3
Add external 5V and wired the ground to odrive ground. I am using NC contact from the limit switch, so 5VDC will alway be feeding to gpio 6/7. When the switch trigger, it will be 0VDC (measured with mutimeter at gpio connection point). I do not add any external pullup/pulldown resistor.
Now i can request the axis to home using command .requested_state=11.
Notice that if I am using gpio pin 5, min_endstop will sometime randomly trigger especially when switch the axis from idle to close loop. May be because of the floating voltage of 1.5V? I try to add an external pull down resistor but still same result. Only thing that help is making the debounce longer.
I love to hear from any other users that had try the endstop and homing.
Many thanks to @Wetmelon for the comment and suggestion.