New motor control board. Uses teensy 4.1 to provide control of three dc brushed motors using DRV8874 motor drivers, 8 servos, and 3 limit switches. I have one motor and one servo connected in the picture. The connectors on the ‘bottom’ are for additional encoders in the event I put encoders on the output shaft of the motor gearboxes. The motors have encoders on the motor shaft and are fed in by the same cable that controls the power. I managed to get the motor control portion working to provide position, velocity, and acceleration control:
Good news, bad news… and an observation about the universe.
TL;DR, Broke something. Fixed something and came out on top. No matter how bad things seem to be here, just remember, its probably much worse in other universes.
Good news:
But the motors seemed too weak. A bit disappointing so I tested feeding them 24V, figuring that if I burnt out the motors I would just buy 24V ones as replacement as the 12V motors aren’t of much use if I can’t actually use them. It definitely ran better… stronger… at 24V but something went wrong with the encoder and the main arm kept moving and slammed into the front of Floyd’s torso and kept trying to run… then there was the snap…
Bad news: Broken Arm Member
An observation about the universe (sorry longer than I intended):
Sometimes a setback gives you an opportunity to take a big step forward. I decided to tear down the arm to extract the 12V motors and try some bench testing with them to see how they ran at 24V without risk of destroying Floyd. Turned out they ran really crappy.
The TI motor drivers I use have configurable over-current protection where it can be set to ‘chop’ the output if current exceeds a certain level. You feed the chip with a reference voltage (I use a pwm pin of my teensy 4.1 through an RC circuit to generate the voltage) and its used by the driver as a point of comparison to its built in current sensing circuit. The sense current is also sent to an output pin in which you can convert to a voltage with a resistor to ground (remember this resistor for later) so you can read it on the mcu. The chip also drives a fault pin to ground when it enters current-limiting mode. I had included all these pins in the pcb design, so I added their monitoring to the firmware and noticed I was regularly getting faults coming in even when current limit is set to a high level and testing was done at slow speeds with no load… not many faults… 1 out of 20 samples… but regularly like clockwork. I put an oscilloscope on the fault line and the output to the motor and noticed the faults coincided with the leading edge of the PWM pulses sent to the motor… and occasionaly on the trailing edge as well. I then switched the probe to the current sensing pin and saw spikes that seemed to coincide with transitions of the PWM signal:
Those spikes were apparently high enough to exceed the reference voltage and kick in the chopping mode… and when I tried to run the motor at full speed I noticed even more spikes and faults… the current wasn’t near the limit and it was just the transients were tricking the driver to think it was. If I couldn’t run the controller at a decent current level because of these spikes, I was screwed.
Reading through TI’s datasheet I spot a statement to the effect that if the current sensing built-in deglitcher doesn’t work well enough, to put a 10nf cap on the line to smooth it out. Obviously, I didn’t want to spend money on another set of boards just to squeeze in a single cap… I already had to fix an issue and get a new batch a few weeks ago and didn’t want to spend the money yet again. While staring at the board to see if I could somehow bodge a cap to ground in the very, very impossibly tight space, I remembered the resistor I mentioned earlier… a 0603 1.5K ohm resistor to ground on the same line… so I did “something crazy enough that it might just work” and soldered a 0603 10nf cap on top of it. To my surprise, not only was I able to do it as my soldering skills are fairly weak, but it actually worked.
Of course that begs the question as to whether or not the motors are actually too weak and perhaps it was just the current limiting cutting in. Regardless, I now have a MUCH better motor controller and perhaps only because I broke Floyd’s arm.
I mentioned this particular controller was from the second batch. On the first batch, I was trying to wrangle a board into a case I printed and somehow pushed too hard against a cap and it popped off and took one of the pads with it (the one that ties the cap to ground). I tried to resolder it but couldn’t… I kept scrapping around the pad to find the ground plane only to discover the entire top layer ground plane was missing. Somehow between running my last DRC and generating the gerbels, I managed to delete the ground plane. I had been using a mouse with a left button issue and when I was readding the ground plane, I ended up deleting it again… so I put the mouse in recycling and got a new one. With that said, had that cap not popped off, I might have never realized the ground plane was missing.
…and finally the observation:
To put things in perspective, I very well could have been banging my head for weeks trying to figure why the motor controller wasn’t working… either with the first batch (nothing would have worked without that ground plane) or the second batch trying to figure out the right PID settings only to be confused by current limiting kicking in erroneously and not noticing it. If the multiverse theory is correct, I suspect I would be doing just that in a vast majority of them. So, to me, I’m pretty damn lucky to be living in this particular universe. First, I pop a cap and learn the motor controller didn’t have a ground plane and second, I break Floyd’s arm and realize I had transients that were causing the controller not to put out full power. Both issues could have been a source of endless frustration.
What’s the odds that two specific failures happen that fortuitously lead to discovery? Pretty slim… my suspicion is that most all universes suck and this is one of the rare good ones.
PS: There’s probably some other universe out there where I’m typing this message talking about how lucky I am to be in a universe where I accidentally discovered three issues with the motor controller and how fortunate I am not to be stuck in a crappy one where I only discovered two of them. Though it would be nice to live in that one, maybe in that universe everything is on a cob.
So today I was approached by the boss. They are looking at these "MARC’ carts from multechnologies. They want 15k per cart. After watching the video I wanted to try making one and found ROS.org. I then remembered this post. So I now see you used Ros. How did you get started? I have been watching youtubes all day and really want to do this!
I have been working in autonomous ground robotics since 2006 (which is a long time for that kind of thing, there weren’t a lot of companies working on it then). I can honestly say that $15k is a bargain for that cart. If you wanted to hire someone to work on building your own solution, it would cost a lot more, and that doesn’t even include the hardware costs, which are considerable.
The only way a DIY solution would be preferable is if they really didn’t work well, and you were willing to pay a lot more in non recurring engineering to do a better job. I don’t see any reason why they wouldn’t work well though. The details are all in the software and their resilience to being beat up, and put in a dynamic environment.
BTW, the company I work for made a promo video today. This has ROS and a bunch of my code running on it:
I guess i pointed more at @madgrizzle as it looked he learned by doing. That thing is badass though!!!
So in your opinion is this worth 15 k?
It does nothing but store presets and run them.
$15K , maybe it’s using a bunch of elusive Raspberry PIs? Or pricey lidar sensor(s)?
When i saw it, my mind said 5k they would be making a ton of money!!
@RockinRiley do you want to move stuff, or just create “digital twin” for surveying/sentry/inventory/inspection/etc… ? I literally bumped into a zippedi at home depot yesterday, which had a bunch of 3D printed parts… Zippedi robots digitize inventory for last-mile delivery
It’s been a long and very rewarding process. This very long thread details what I went through to get to where I am today. ROS is not trivial to learn and you have to be pretty adapt at programming. I never did any of the tutorials and jumped right in with using linorobot (linorobot · GitHub) as the foundation. From there, I rebuilt Floyd a few times, added some things, removed things, etc. I’ve since migrated to ROS2 and use a bit of linorobot2 (the ROS2 version of linorobot) still to help me get it going (mostly the launch scripts at this point… I’ve redone practically everything else). I’d be happy to answer any questions.
@jeffeb3 knows much more about this than I do, but I think for autonomous ‘vehicles’ the actual hardware cost is relatively small portion of the overall cost. I think for that cart my semi-educated guess (what it would cost for me to build one DIY) is maybe $1,500 (see below) in parts (two depth cameras, motors, batteries, lidar, proximity sensors, cpu and then a specialized control panel that you have to build since it’s not COTS)… I’ve spent more than that just building Floyd. If you compare it to a Turtlebot that sells for $1500 with maybe $300-$400 in parts and all it can do is roam around your floor and get stuck under furniture (after you program it to do that) you’ll see the turtlebot is not a great deal. The value in the MARC, I believe, is in the software that lets you push a few buttons and get it up and running in 15 minutes. It’s easy to say (because I have before) that it costs nothing to load software into a computer, but all the vendors I deal with still want to charge $100K for a single license of something because they spent a lot of money to develop the niche software.
The $1,500 is the diy price with mostly inexpensive parts. They certainly are using industrial parts on it which will drive the price up.
But it would be a cool project to do nevertheless. Are you looking to build it for your company or just something to do on the side?
Move. We are looking at robotics to move inventory!
Well, i have (since the army). Lived by adapt and overcome. I am a network admin. I was a mechanic in the army and thought i could maybe make those carts, especially after seeing what ROS could do. But now i think i cannot. This would have been for work. I think i may have to try something for myself though now!
It’s 100% doable just unlikely to be economical (or timely) for a company to develop/build one versus buying something… certainly so at $15K. If you like robots, then this seems like a cool project if you have some where you could use it (too big for me to use in my house).
The funny thing about software is, when your first write it, it is very expensive. But the second user uses it in a completely different way. The third is a little better, but it still needs some updates for those corner cases…
By the time you have 10k users, it works pretty well for everyone, but you’ve spend 10x more than the first version. Once you get to a million users, the software is free.
Robotics software is hard. I could make one of these work in my own house/garage for about $15k (at a low hourly rate). But as soon as my kids left lego all over the floor, it would stop working. If someone wanted a fleet of 5-10 of these in a specific warehouse, I would estimate it would be over $1M, easy, before we could just trust they would work without an engineer watching them. If you wanted them to be strong enough that they could hurt someone, that would easily be $10M. Making it into a product that can go into 99% of all warehouses is a lot more.
I am not an expert at business. But I bet they are losing VC money to get those out the door at $15k. They are probably banking on a larger customer base scaling fast enough to turn a profit.
But “is it worth it?” Is really two parts. Can you make a robot that cheap? And, is this going to save my company money? If it works flawlessly for a year, would it make a $40k/yr employee work 40% faster?
I would never pay $15k of my money on one of these things. But I would happily spend someone elses.
What about a reduced-requirements version? Say $1k for the robot and it is blind and only follows lines on the floor and pauses if it hits something. It has one button that says “next station”. Maybe also an E-stop that also serves to disengage so the cart can be moved manually.
If the hardware requirements are cheap enough and the software is simple enough, it might not be terrible as an open source project.
Bonus points if it makes sounds like a choo-choo train.
The lego really put a thought in my head. These would be in a factory, where there usually parts of wood skids all over the floor!
Thanks for the thoughts! Both @jeffeb3 and @madgrizzle
I built a rudimentary model of Floyd’s robot arm (haven’t finished modelling the gripper) for display in RVIZ (ROS’s visualization tool). I have a program that publishes pre-programmed JointTrajectory messages that instruct the motor controller how to move the motors and servos (position, velocity, acceleration). While the controller is moving the motors/servos, it is also publishing JointState messages (based upon the feedback from the motor encoders) that indicates the angles of each of the arms joints. RVIZ subscribes to these messages and automatically updates the positions of the joints based upon these messages. This way the model tracks the position the the arm in real time. This is the first step to using a motion planner like Moveit to actually control the position of the arm rather rather than rolling my own motion controller.
Yeah I subscribed to what i thought was a free 5 day ros course and it introduced Rviz! That whole ros thing is awesome! I will have some sort of bot yet!!!
I really like this one. Building a ROS Robot for Mapping and Navigation #1 - YouTube
The 3d printer rotary encoders so it can use any type of motor! And I see lidar has a 99 dollar entry now!
This is a discord forum I post to as well. They aren’t heavy into ROS, but the post links to an autonomous cart project using ROS that one of the members is working on. He refers to linorobot but that’s just a premade setup of ros to help people get going.