Unfortunately I can’t get the problems with the limit switches under control, but I want to make progress in the project. So I ask myself, if I should switch to the standard firmware of the main branch and not use the limit switches with Odrive anymore.
But then I ask myself, how do you others do your projects (e.g. robot arms) without limit switches? Somehow almost every application needs some kind of limit switches???
You could try to use ODrive in combination with Arduino, I think this will make things easyer for you, there’s is a library for ODrive so you can just read the limit switches with the Arduino and you can also use Arduino with the xsimulator software so I would suggest you try that.
I second the idea of using the Arduino instead of the ODrive to read the limit switches. If you do that, it may be a good idea to use absolute encoders or hall sensors on the motors so that way they don’t have to calibrate on startup, as you wouldn’t want the motor to accidentally crash the actuator into an end stop during calibration.
That’s along the lines of how I’m doing it in my project, but instead of the Arduino reading limit switches on startup, it reads a secondary absolute encoder at the output of the gearbox on each motor, and uses that initial position to be able to know the robot’s state before having to make any movements at all.
My racesim uses the endstop branch and what I’m doing is: calibration -> homing -> offset to the middle of the actuator, this is because the flypt software sends positive and negative position so the middle off the actuator should be 0.
I will send you the file this weekend, help me remember please.
I do have some startup problems, when I try to fire up an ODrive, sometimes the motor jumps to another position and doesn’t do anything after that. But then I just rotate the motor a little bit and try again.
Hi Stijn,
In my design I have multiple odrives connected to a single computer running python scripts. In this case, would I connect the Arduino to the odrives or to the single computer?
Thanks for the reply. So I will first make my PC run the homing sequence, use the Arduino to read the states of the limit switches, have the Arduino continuously send the states to my PC, and have my PC continuously monitor the Min’s and Max’s of the actuator. Is it possible to do it this way? And If I do it this way, would I even need to use the OdriveArduino library?
Im still a little confused. Why would i need to use the ArduinoOdrive library? Wouldn’t the arduino just need to perform DigitalRead() on the limit switches?
Sorry for all the questions.
I’m not sure. I didn’t think I would need to connect the arduino to the odrives because my main PC is the main computer running the python scripts to control the motors. So the PC will be the master and the Arduino/Odrives will be acting as the slaves. Is there something wrong with this design?
Nevermind. I figured out what I am going to do. I flashed the Endstop branch from github on my Odrive. Do you have to configure the endstop parameters before anything else because only one motor will do the Full calibration sequence?
Ik don’t understand what you’re saying, when you enable and cofigure the endstops, it will do this in the correct order so that when you start up the ODrive, it calibrates -> goes into closed loop -> homes -> does offset -> sets position to 0