Hello, everyone. We just finished our first project with the Odrive. So, I figured I would share it here.
The project is a skittle sorting machine using the Odrive to control two axis.
You can watch our video series on the project here:
The Odrive worked pretty well for us. The only thing we really had to work around was the lack of serial communication. First we tried to just connect our microcontroller to the Odrive as a slave on the spi bus. Initially this worked, but had inconsistent issues with the internal buffers in the Odrive. Not wanting to debug that deeply into the ST micro, we ended up switching to using the gpio pins as a type of parallel communication. This gave us 8 commands that we could send in one clock, which was enough for this application.
So, the Odrive has hard coded motion profiles for the feedwheel and one of the parallel commands is “go/stop.”
Then, there are 5 commands to tell the bottom servo motor to go to the position associated with each color of skittle.
The hole position are hardcoded offsets from the first hole. There is a command that allows you to set the position of the first hole.
The last command is used to home the bottom servo motor to the index on the encoder.
It was a fun project, and I am glad to finally see something like the Odrive being developed.
I like those hollow shaft encoders you have. Do you know where to get them retail/what they cost retail?
Is that the PSoC 4 or 5LP? Nice little micro, but getting going is quite a bit more difficult than with "Genuino"s. Especially if you want bootloading or serial comms (not to mention the IDE is C only, no C++). Poisonally, for super quick projects I use a PJRC Teensy 3.2, which is an ARM Cortex M4 that is Arduino compatible. I turn to the PSoC if I need the analog handling or the UDBs.
Can’t beat the price on those PSoC dev kits though, especially if you get a Cy8ckit-059 and get BOTH processors programmed up for the $10 they cost.
I can definitely agree with the getting started issues. (I came from starting in arduino) The documentation is thorough but it is very much made for engineers. So, it is a case of: no one can find the information except those who already know where it is. Now that I happen to know where everything is, setting up comms and other peripherals is “drag-and-drop.”
You actually can use C++ in a PSoC, you just have to let the compiler know what you are doing. No one really teaches these things though. (Not very clearly anyway) Maybe I should make some videos on the subject.
Yeah, I love the little stick dev kits. the kit costs less than the microcontroller in one-off costs. And, once you have one, you can break off the programmer and use that as your USB programmer for future PSoC projects.
I can exercise the UART branch! Any tips on where to start? Do I just need to send the same string commands as the USB interface? e.g. can I send g commands to get params and set setpoints with s v and c?