Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

Here's Friday's video, early for Patrons only. Pretty happy with how this one is going!

Files

Previews only

XRobots - Star Wars BB-8 Droid *VERSION 3 PART 12*, STABILITY UPDATE & Head

Help me make more AWESOME projects, and get exclusive REWARDS with Patreon!*** : http://www.patreon.com/XRobots This video shows a massive stability update since the previous parts in the series now that the ball is smooth and I can see what's going on.

Comments

Anonymous

Great progress James! Something is confusing me about your tilt code. You're using the IMU as an input and the current tilt of the counterweight as a setpoint to generate an output for a 2nd PID that uses that output as the setpoint and the joystick as the input. I always assume the input would be the IMU, the setpoint would be the desired angle, and the output would be for the motor to achieve the setpoint. Could you explain the process you are using and how it would differ if you were using a servo (which has it's own PID) as that may help make it easier to understand. Thanks!

PatchBOTS

Hi James, I'm excited for your DualExtruder sessions tomorrow, but I'm also hoping you can take some time to talk about your method in tuning the PID code. I think everyone's droid is going to be a bit different with regard to the weights in the head and style of skins etc etc. It would be nice to have an idea of what you are doing so we can apply the method to our code rather than using the code tuned to a different droid. This video was great. Your BB-8 is looking awesome. Love the cutaway.

XRobots

There are two PIDs. The first one is turning the motor and pot into a servo with the desired angle as setpoint. The second PID is driving the desired angle into the first one by using the stick and IMU. If you were using a servo that's already got it's own internal PID/feedback loop then you only need the second PID in your code to drive it's angle from the stick and IMU. I drew a diagram in one of the earlier videos: <a href="https://youtu.be/7WoyZh6ikf4?t=1417" rel="nofollow noopener" target="_blank">https://youtu.be/7WoyZh6ikf4?t=1417</a>

XRobots

Basically it was a lot of trial and error to balance P and D to the correct amounts while watching the droid to see what it does. I've probably re-flashed that Arduino 60 or 70 times.

Anonymous

The part I don't understand is using the current angle of the trousers as the setpoint. I see Patrick else asked for some PID talk in your live broadcast, so i'll just throw a +1 at that please :) Could you make your live broadcasts available after the fact, maybe upload to youtube as unlisted for patreons?

Anonymous

No PID expert here, but I set all 3 to zero then raised P until it ocellated, when it did that I reduced P by 40% then raised I until it stopped improving then raised D.... then tweaked them all. What did help was Serial printing out the IMU's angle and then putting that into a spreadsheet and graphing it, I was then able to see the impact of my changes and if the change was positive or negative. I would tilt the body to a set angle then release, this is the graph: <a href="http://i.imgur.com/uAQEnwO.png" rel="nofollow noopener" target="_blank">http://i.imgur.com/uAQEnwO.png</a> Grey = no PID Blue = best I could do before I thought of graphing the data Red = best I could do after using graphs to tweak the values

PatchBOTS

Thanks David. That's an awesome approach. I mmmmaayyyy have to get in touch with you when the time comes for a little extra guidance if that's okay. James, I betcha I beat you on total number of Arduino flashes. hah

Anonymous

Also, while not strictly around the topic of 3D printing, I'd love it if you could go over some of the hardware you've used when assembling BB-8 - I know you use a lot of 6mm and 8mm studding, but things like screws, bolts, nuts and washers - I'd like to do good shop to get a lot of the little bits and pieces ready :)

Anonymous

Hi James. I just thought you could possibly improve the head turning movement by not accelerating and braking that hard. Just add a speed-variable between your stick inputs and the actual actuator. The speed-variable then has to be raised or lowered according to your Stick Inputs. But it can only be raised for a certain amount per tick. So for example, your stick inputs are say 20. In the first tick your program sees that and adds 2 to the turning-speed-variable. The Moter starts turning with the speed 2. Next Tick it raises to 4 and so on. Until the variable ist the same as your stick input. And the opposite on the other side of course. Just as an Idea.

Anonymous

Hi James- Unfortunately, I will not be able to attend the live broadcast tomorrow but I did have a couple of questions which perhaps you could answer for when I review the recorded session later on Monday... 1) You mentioned the tremendous power requirements. If you had to do it over, would you do anything different with the power subsystem? I ask because I've just begun putting together a BOM for all those components and was thinking that now is the time to modify if I'm going to, and 2) You mentioned in a previous video that you were considering swapping the poles on one of the three magnet sets to help with stability on the head. Did that help? Cheers! Darrin

XRobots

yes I am already thinking of more efficient designs so I can talk about that a little

XRobots

thanks, yes - I think there is a lot of coding that could be done now that the main stability is working.