PLC to Odrive, by hook or by crook

i’ve got a little project where i need to take a PLC and talk to an odrive…

now the odrive is playing up a bit… and i’m going around in circles…

when my Odrive arrived i plugged it in … did all the anaconda stuff did a few command line bits and bobs… saw the motor spinning… and ticked it off as working but felt it was a bit long winded…

fast forward to more recent times where i needed too a bit of positional work on a oddball machine i’m working on … so my first idea was talk to the odrive directly… tried that… seems puking out ascii from the PLC didn’t seem to be an option…

so next idea… bang an arduino in the mix… yell Modbus down the ethernet from the PLC and get the arduino to do the talking… (not pretty but it aint stupid if it works as someone once said)

so off we go… i get all the bits together… arduino mega… ethernet gubbins… wires… and being a bit of a wally… i start simple… let get a demo sketch on the mega. and lets see the odrive doing something…

and so far… i’ve not really got further than that… and i’ve tried… so i’m using a demo sketch… it all compiles… i’ve got all the libraries… ive put my logic doofer on the pins and i can see data… and every now and again when the wind is blowing in the right direction it’ll allow me to hit zero in the serial terminal, and it’ll do what looks like a calibration… so i’m thinking the wiring cant be very wrong…

so then i was wondering if i had managed to re configure the settings when i first played with it… so i looked for a reset option… and well then it dawned on me… is the firmware uptodate…

so i got it plugged into the computer it had worked on when i first got it… and i started the process of updating the firmware…

then i got the error about the USB stm bootloader… so off i go and i do the old switch-a-roo… but after playing about to get it to start the upgrade… i get one run through where it erases the sectors 0-6 and then when it starts to writ them it bombs out… errors up the wazoo… and now if it try and do it again it fails at the erase stage… :frowning:

i’ve tried adding pictures and helpful stuff but this just aint my day…

so what are my options on getting this drive working again … ???.. remember speak slow… i’m at the limit of my experience here…

additional… i’ve just been looking through the other posts… and thing that are helpful will be things like i’m using windows 10, ive got a board with V3.6 on it… and the firmware did say it was 4.11 dev… and then told me i was upgrading to 4.11 (but without the dev bit maybe)

thanks

Pb

1 Like

Hi Patrick, I wish I could help! unfortunately I’m not that bright; however looking at your inquiry for help, I’m thinking maybe you should have been a writer! and maybe for kids books as I think you would be a great one! :slightly_smiling_face:

Please consider the above drivel as a compliment :smiley:

Kind Regards Jerry.

Hey Pb, have you tried just using the Arduino to get it working?

wayneStock

Hi WayneStock…

i’ve got too the point now where i’ve tried everything… USB… Arduino… and its just not playing ball…

i’m slightly worried that the failed Firmware update has bricked the whole unit… now that said i know there is an option to use an external programmer… but i’m not sure i’ve got my big boy trousers on when it comes to things like that…

so there is two questions… one … what was my issue when i was trying to command it from arduino… (any ideas???)

and B… how do i get it to flash the firmware and reset to the default… (remember it was fine… and then it became all flakey… didnt want to do anything… (its like it was in its teenage years… )

ok… the final option… anyone want to buy my slightly used Odrive 3.6 board???

When you try USB and boot up anaconda, are you not getting an ODrive response at all now?

wayneStock

Lol I’d be happy to buy your board but let’s see if we can help you fix it first :wink:
Is your board working at all now? If not let’s try to get that fixed then I can try to help with the PLC connection.

So first off, I haven’t played with the USB firmware update option too much but flashing with the STLINK (the external programmer) is actually quite easy. Did your board come with one? If so I can guide you on how to recover things using that.

Also, have you gone to Device Manager on Windows to see if the device shows up at all? If the ODrive isn’t there then you’ll have to use the STLINK to recover it.

Finally, if you could post pictures of your errors that would be extremely helpful, otherwise I just have to guess…

Hope this help!

Good Morning / Afternoon Kedvall…

thanks for your assistance… and i’m pretty sure there is a solution out there… as none of the magic smoke has gotten out… and its been sat for the weekend on the healing bench, and thats worked before…

so i’m going for a slightly different setup … so hopefully i can get the screenshots into the posts… so i’m just about to get the odrive plugged in and on a power supply… and go through installing the tools and seeing if i can connect… i’ll keep you posted…

ok.

so done all the anaconda gubbins…

run the pip install for the Odrive… and its all good…

next stage is checking its picked it up on USB…

but when using Zadig tool… its not showing up… and i dont get a musical bump-do-da-bimp noise when i plug it in :frowning:

now i would upload a picture… but i allways get… undefined method `original_sha1=’ for #uncategorized
so thats another issue… (maybe browser… i’ll play about with that… )

ok… i’ll go and see if ive got a programmer…

So programmer wise … I’ve got this selection…

Ah… So seems even from my phone I can’t upload pictures… :frowning:

Anyway both are generic Chinese usb-ttl converters,

One called betemcu, and has a little 3.3 volt 5 volt switch

And the other is a usb-stc-isp neither have any pins marked SWD or swc but I do have rx, tx and gnd up the Ying Yang…

:blush:

ok … just tried the upload from MS Edge… (which I feel close 2… think about it… yep… there you go… )

and still no worky…. :frowning:

Hmmm this is going to be rather difficult with no pictures. I get the same error when trying to directly upload a picture but you can post to something like Imgur then link it: https://imgur.com/a/HiD8AcK

So a USB-TLL converter won’t work for this, you need something that supports SWD specifically. The STLINK V2 is one example, probably the most popular.

I thought Oskar ships an STLINK V2 with the boards, no? Or maybe he stopped now that USB firmware upgrades are possible…
Anyways, you need to get something like this STLINK V2. They are just a few dollars on eBay, I think still < $10 on Amazon.

Hi Patrick,

The issue with the picture uploads is the same with me, where I had to put the pics on my website and linked to those (a picture hosting website should work for you if you need to show pics). Hopefully, the error on here will be resolved at some point.

I can’t help much at all with the firmware upgrade/samegrade but have a video on installing and setting up the ODrive 3.6 on Windows 10 if that helps any.

Tis here: https://youtu.be/pveDogUebT8

Hope you get it sorted soon.

Kind Regards,

Neil.

Hi kedvall,

My v3.6 wasn’t shipped with one either, I believe this to be because of the USB upgrades too.

I would of thought the board is recoverable quite easily with the STLINK V2 as there is a lot of past information on it here.

Good luck.

Thanks Neil,

Ive orderd a programmer and im sat looking longingly at the door as we speak, so i’m going to find out if its is possable to recover hopfully next week sometime

Now ive been following your build on youtube, and im super intrested as to how you are going 2 do the cnc to gcode side of things as ive got an idea for something and id like to be able to make programming it as easy as possable …

Anyway… watch this space for firmware update news

Thanks

Pb

ODrive supports CAN with the RazorsEdge branch. Perhaps try that?

Good Morning (i know i could be addressing anywhere in the world… but for me its morning)
today i have one task… take the newly arrived ST-Link V2 and learning how too do a firmware upgrade / re-flash / and all that good stuff…

so like a lot of things… i’m sure the info is out there… but where to start looking…

i’ll get a idea of the tools i need, get them and report back…

message id 9:30 good.tens.caller

Ok… with only limited time today i’ve only managed to get to the stage of installing Visual Studio… installing Linux gubbins in windows…
adding the enviroment variable… (which i didnt twig for ages was the Windows Enviroment, doh…)
I then got a clone of the git for the Odrive, and opened the Workspace in Visual Studio… (i added all the required bits and the suggested plugin’s )

So that made a nice looking workspace of intresting files and stuff all looking like firmware stuff… and when following the instructions it then tells you too do a :Run Build Task,

But i’ve done that and i must be missing something as im getting an error… now i dont have the details of the error… but i will try and put it in the post tomorrow… :frowning:

But i think i’ve made progress…

Happy odriving.

1 Like

Hey @patrick_brown, did you get this working?

Couple things. Compiling the master branch shouldn’t give any errors. If you are getting some, likely your setup is incorrect. Maybe post your errors?

On a different note, you don’t actually need to compile the firmware yourself unless you want to make edits. You can download the precompiled firmware releases here and flash them to your board. Just make sure to select the right varient.

Hope this helps

well… thanks for your nudge…

see whats happend… life, pretty much… (and i’m not even going to say the C word as thats would be just too easy)

So i’m planning on getting a chance to look at this very soon… its almost on my desk…now as far as the urgency goes… as i’ve got other servo hardware i can use… i’ve just deployed one of them… but i do want to get the odrive working… as i’ve got lots of projects this would be good for… 3d printer upgrade, co2 laser upgrade… robot lawnmower… etc… etc…

but as of now… i’ve not done anything apart from move it around … and tut every-time i see it… thinking i need to get on with that…

thanks for your concern… and i’ll keep you posted…

Pb

I thought I’d put this video here as it relates to this feed, along with many others.

I have recently re-flashed an ODrive v3.6 and made a video of it so that others could follow the steps, hopefully this will help anyone that needs to re-flash the ODrive.

I have tried to be as broad as possible and cover most questions that people have on this topic, so please let me know if I have missed something and I’ll add it to the videos description.

Happy ODriving,

Neil.

2 Likes