kubabuda / ecat_servo

Open EtherCAT CiA402 servo drive implementation
GNU General Public License v2.0
164 stars 50 forks source link

Canbus/CanOpen CIA402 for Odrive/SimpleFOC Arduino. #1

Closed MatthewReed303 closed 2 years ago

MatthewReed303 commented 3 years ago

Hi there,

I'm quite interested in your project. I'm wondering if there is a way to use the Canbus which is already built into the Odrive and then use the CIA402 stack on the Odrive or SimpleFOC. I'm currently using SimpleFOC https://github.com/simplefoc/Arduino-FOC https://simplefoc.com/ on custom Odrive based hardware. The Odrive uses the STM32F405 and I see you have been using the STM32F103 (Bluepill)

I would like to use the Odrive and SimpleFOC with Industrial software such as CodeSys and use PLC Open Motion Control. You can see my post regarding this on the CodeSys forum and posted on reddit PLC https://forge.codesys.com/forge/talk/Motion/thread/d7a02bdcc7/ and https://www.reddit.com/r/PLC/comments/p38o1s/plc_open_motion_control_axis_ref_structure_codesys/ Note: CodeSys supports CIA402 via CANopen and Ethercat. Similar to Beckhoff Twincat. What are your thoughts on getting this to work with CANOpen and Arduino framework?

Thanks, Matthew

kubabuda commented 3 years ago

Hi, if you have a look at sources I have been using F407, not that it makes difference here.

What you want should not be too hard. There is a few steps to follow.

You can do it all with Arduino for convinience, though not sure how much overhead will it bring over ST libs. You want your industrial comms to be as fast as possible, and CANopen is not the fastest car in town to begin with. CANopen profile specifications are paywalled but older versions one can google for free on some french dude page. It is only <100 pages for CiA402 and better have it at hand. Goodspeed.