scout/chip updates: WE ARE STANDING - we've changed the name back to CHIP [updates]
the background on this interesting post:
OKAY SO EXCITING DAY TODAY! This evening what we are going to do is get the robot to stand on its own four legs. The plan is simple, put the legs into the appropriate positions and send 0-velocity commands to the motors. If time, we will implement some 2D kinematics and watch the legs move a bit!
I've employed a free friends to help me with this:
Other friends showed up as well...
How did I get some people to come help me? Well the bunch of us all live on the same floor in Simmons Hall at MIT, and coming up soon at MIT is CPW (the pre-freshman event for considering students). So we thought wouldn't it be great that for that event we could have a walking robot dog running around our dorm?
So we made a group chat! Make the puppy walk by CPW...
Ronal knows a lot of WPILib programming that I don't, especially now that we are using Java. Fischer does a lot of electronics and robotics stuff. Hannah and Summer are lovely smart people along for the ride.
The plan is to grab the Shop Crane from MIT's N51 building (special shoutout to [anonymous] for letting us use it). We will tie the robot to the crane with ratchet straps and hoist it so he doesn't fall if the legs don't work, give way, move to the wrong position, etc.
On the software side, the plan is to send 0-Velocity commands to all the motors see if the dog stands and etc. And then if that works we will start implementing the inverse-kinematic models for each leg that were designed.
That's the plan...
acquiring a shop crane:
So we need a shop crane for this because we need something to safely hoist the robot with so it doesn't fall in the process of us doing this...
Yes... for many minutes we did this...
now the actual robotics stuff, we setup our floor lounge as a robotics space:
So all of us being robot nerds, we decided it was finally time to setup some space in the lounge for some robot nerd stuff...
As you can see, we setup the shop-crane, power-supply, and some other robotics equipment in the lab. There's mostly everything we need in this place to make a full-fledged lab. There's a really EE lab a few floors down.
We've also elected to change the name of this robot from scout, to CHIP. Because we love the name chip. Now it's time to hoist the robot...
So we tried to pull this robot in through the straps. And hold the robot up. We succeeded after many tries of shifting the straps to get this thing working. After some time shifting, we succeeded.
He's hanging!!! Ready to start programming. The power supply is plugged in and we are ready to go!
actually programming chip:
So Ronak's gotten WPILib installed with the SparkMAX library as well. We're going to get the project setup - the screenshot is below. Since the robot is named chip, the program is named salsa. So we are going to use two computers, one Windows computer with an ethernet cable to that for control with the driver station. And we will use a USB cable to upload code from Ronak's laptop.
Here is project creation - in summary: timed robot template and that's really it. Timed robot just means it just executes the control loop as opposed to all the other types of control. You just need to have it enabled in Teleop mode (check out the FRC control system for more knowledge on this).
So now what we are going to do is setup the project and some git inits so we can push to GitHub. Now there's a new GitHub for this project as well since the old one used ODrives: https://github.com/Chip-V2-Open-Source-Robot-Dog/chipv2
So what Ronak did is add the import the SparkMAX library and built the project and it built. So what we're going to do next is figure out how to set all the motors to 0-Velocity using the SparkMAX CAN Library (PID).
(Side note, the power wires popped out the back and Fischer is going to fix it and he did, will be fixed to be better in the next version or later).
We've also started a board with TODOs, the inverse kinematic equations, and some other important details. Here's also a nice picture of the back-side of the robot that we've never gotten to see.
So now we're just setting up the CAN_IDs and etc. We also came up with a convention for naming the leg motors here they are. We're also creating a leg class that allows us to use each leg as a proper object. It will have methods to manipulate this leg and etc.
An now.. we're ready for tuning!!! So we aren't going to tune the PIDs yet, first we're just going to start with random gains of .001, 0, 0 for everything else for the motor. Run all the motors at the 0-velocity, and then basically put the robot down and see if he stands.
Turns out we also need a static IP... Ronak's doing that. Everything we are doing will be on Github and is all standard FRC stuff you can find using the WPILib stuff.
The good news about CHIP is that the leg design can be symmetric or asymmetric meaning the leg angles can point in the opposite or the same direction. For now we're going to do the opposite of what all the pictures have been showing (we have been showing asymmetric, we will do a symmetric for now). The symmetric is beneficial because it's a little more stable in the sense for geometry it's easier to keep the center of mass within the contact points.
Okay - we're coded and deploying! And we are installing FRC Driver Station on the windows computer. That means installing FRC Game Tools.
test one: hand moving the joints to test the PID Control
So we've created and deployed code, we're going to keep the robot suspended and move the joints by hand.
test two: hand moving the joints to test the PID Control
So we've created and deployed code, we're going to keep the robot suspended and move the joints by hand. Last time we think the issue is the code was written in the wrong block for RoboRIO enabling (we didn't put the code in the TeleOP section). We're also printing velocities to the smart dashboard.
test three: hand moving the joints to test the PID Control
So we've created and deployed code, we're going to keep the robot suspended and move the joints by hand. Last time we think the issue is the code was written in the wrong block for RoboRIO enabling (we didn't put the code in the TeleOP section). We're also printing velocities to the smart dashboard. So we also think that the SparkMAXs aren't getting a signal, their LEDs aren't changing. Using some debug print statements to console in the time-being.
Okay... never mind... we didn't change the robot main class. Let's try this.
That worked, now we are getting the print message but also CAN errors, let's see what's going on there.
So it can't get the device ID of 6, 7, 8 --> none of the CAN IDs are loading, let's re-flash the firmware.
So now upon plugging in the SparkMAXs to the client, it seems 1-4 is being picked up when we plug into 1, and 6-12 are being picked up when plugged into 7, so we think the issue is SparkMAX number 5. We're going to re-flash that. Yes, CAN_ID 5 has an older firmware... oops. It might work now!
We also suspect CAN_ID 4 could be an issue. We're just going through controller by controller. We're going to be playing with the CAN bus for a while. So we could go through all the issues in detail, the main idea is that some of the SparkMAXs were on different firmwares. Now its time to run test 3. No real code changes, no error messages, AND WE ARE GETING VELOCITIES ON THE SMART DASH BOARD.
test four: hand moving the joints to test the PID Control
Okay test four, because I think we forgot to comment or uncomment things in the code, the code crashed, we fixed it maybe, here we go.
OMG OMG OMG WE HAVE MOSTLY 0 VELOCITIES ON ALL EXCEPT TWO MOTORS.
test five: hand moving the joints to test the PID Control
Okay test five, we need to fix some things in the code.
test six: hand moving the joints to test the PID Control
Okay test six, we need to fix some more things in the code, run some more tests. So the encoder wires are an issue. Encoder wiring problems are becoming a trend with this robot.
And in conclusion: we still have much work to do but he sort of stands!!! We just need to decide things like optimal standing angles and things like that. Math needs to happen and some more PID control tuning.