My roboclaw/pololu based segway is working well now with the new motors. I have closed the attitude loop with the gyros and the EKF pitch estimate. I will soon close the position loop with the encoders.

Views: 1781

Comment by Muhammad Al-Rawi on November 4, 2013 at 7:05am

Fist-bump robot.

Comment by Harry on November 4, 2013 at 9:10am

Very Cool!  I'm curious about these self balancing types. 

Comment by James Goppert on November 4, 2013 at 10:30am

The current source code is here if anyone is interested. Hopefully it will be merged with PX4 master soon.

We are going to use this as part of an undergraduate aero/astro engr. controls lab at Purdue. Closing the position loop with the encoders should be fairly trivial at this point and then it should be very fun integrating manual rc control and gps waypoint following which should also be trivial using the PX4 firmware.

Comment by Jason Short on November 4, 2013 at 3:52pm

Your welcome to play around with my rollerbot code

I found the control loops need more than PIDs can deliver.

check out 

static int16_t
    //cliSerial->printf_P(PSTR("ws:%d, se:%d\n"), wheel.speed, speed_error);
    return g.p_vel * (float)wheel.speed; /// 1.8
This will make it so you can navigate and respond to outside impulses. 

Comment by James Goppert on November 4, 2013 at 4:55pm

Hey thanks Jason! I have a full simulation in scilab with PIDs working for position control but agree that it is difficult especially with a short robot. I started with a  robot about the same size as the arduroller ( but changed to this new taller design to make the system naturally more stable. When I had the really short robot it creates an extremely fast unstable pole out that is hard to drag back to stability with the zero from the PD controller. Another trick that I found is that putting the PD controller in the feedback loop instead of the feedforward loop eliminates a closed loop zero that can be nasty when closing the position loop. I'm actually playing around with this as part of a system id course and am using an EKF online to estimate the mass and position of the pendulum. My goal is to use a linear quadratic gaussian (LQG) controller to stabilize the system with the estimated mass and length of the pendulum. It has been really challenging so far, but fun. All of my source code will be part of the PX4 firmware. I will have code for identifying the motor transfer function as well which should be useful.

Comment by James Goppert on November 5, 2013 at 12:41am

Jason, if you were referring to not numerically taking the derivative of the pitch signal, I'm not. I'm using the pitch rate from the gyros for the D term. I am not using the encoder wheel speed, but I get the same effect.

Comment by Jack Crossfire on November 5, 2013 at 1:53am

Someone should work on indoor mapping via rover.


You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service