erlerobot / smart_motor

4 stars 2 forks source link

OpenServo prototype #29

Open jlamperez opened 8 years ago

jlamperez commented 8 years ago

Here we have a video of our first OpenServo prototype functioning: https://www.youtube.com/embed/2pDjEooNM00

Here a screenshot of the orders, seek position and the measured position using a raspberry pi. 2016-02-01 19 38 47

Characteristics of this prototype:

#! /bin/bash

clear
echo "sudo i2cset -y 1 0x20 0x21 0x01 0x06 0x00 0x0c 0x00 i";  # set pid values
sudo i2cset -y 1 0x20 0x21 0x01 0x06 0x00 0x0c 0x00 i;
sleep 3;
echo "sudo i2cset -y 1 0x20 0x10 0x00 0x60 i";  # set seek position to 0x0060 (minimum value)
sudo i2cset -y 1 0x20 0x10 0x00 0x60 i;
sleep 2;
sudo i2cget -y 1 0x20 0x08 w;  # potentiometer position register
sudo i2cget -y 1 0x20 0x10 w;  # seek position
sleep 2;
echo "sudo i2cset -y 1 0x20 0x10 0x01 0x50 i";  # set seek position to 0x0150
sudo i2cset -y 1 0x20 0x10 0x01 0x50 i;
sleep 2;
sudo i2cget -y 1 0x20 0x08 w;
sudo i2cget -y 1 0x20 0x10 w;
sleep 2;
echo "sudo i2cset -y 1 0x20 0x10 0x02 0x50 i"; # set seek position to 0x0250
sleep 2;
sudo i2cget -y 1 0x20 0x08 w;
sudo i2cget -y 1 0x20 0x10 w;
sleep 2;
echo "sudo i2cset -y 1 0x20 0x10 0x03 0x50 i";  # set seek position to 0x0350 (almost maximum value 0x3A0)
sudo i2cset -y 1 0x20 0x10 0x03 0x50 i;
sleep 2;
sudo i2cget -y 1 0x20 0x08 w;
sudo i2cget -y 1 0x20 0x10 w;
sleep 2;
echo "sudo i2cset -y 1 0x20 0x10 0x00 0x00 i";  # set seek position to 0x0000 (minimum value is 0x0060)
sudo i2cset -y 1 0x20 0x10 0x00 0x00 i;
sleep 2;
sudo i2cget -y 1 0x20 0x08 w;
sudo i2cget -y 1 0x20 0x10 w;
sleep 2;
echo "sudo i2cset -y 1 0x20 0x10 0x01 0xff i";  # set seek position to 0x01ff
sudo i2cset -y 1 0x20 0x10 0x01 0xff i;
sleep 2;
sudo i2cget -y 1 0x20 0x08 w;
sudo i2cget -y 1 0x20 0x10 w;
sleep 300;
vmayoral commented 8 years ago

Well done! Bring over the prototype this week, we'd love to see it.

jlamperez commented 8 years ago

Here a video of the RPI Servo. https://www.youtube.com/watch?v=n5Lf27Ok5-U

For now it has the basic, the adc and the h-bridge. The PID values also need a look but the prototype is taking shape. Here somo photos of the prototype and commands used. prototype2

2016-03-26 00 13 01

vmayoral commented 8 years ago

@jlamperez thanks for sharing, the video seems to be private. Can you change the permissions to "hidden" so that we can see it?

jlamperez commented 8 years ago

Done, I have changed it to hidden. Sorry @vmayoral.

vmayoral commented 8 years ago

Looks Good! Well done. The positiong seems to have a bit of overshooting. Maybe the PID adjustments? El 26/3/2016 9:50 a. m., "Jorge" notifications@github.com escribió:

Done, I have changed it to hidden. Sorry @vmayoral https://github.com/vmayoral.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/erlerobot/smart_motor/issues/29#issuecomment-201735528

jlamperez commented 8 years ago

Yes you are right, I have to tune up the PID values to achive better response. For this video I only consider the proportional part.

vmayoral commented 8 years ago

@jlamperez can you bring back the Dynamixel Motors that we provided next meeting (at least those that are still functional)?.

jlamperez commented 8 years ago

Hi @vmayoral I don't have the Dynamixels here in Pamplona it would be a drawback if I bring them back another day?

vmayoral commented 8 years ago

No problem. Bring them next time.

2016-03-30 12:05 GMT+02:00 Jorge notifications@github.com:

Hi @vmayoral https://github.com/vmayoral I don't have the Dynamixels here in Pamplona it would be a drawback if I bring them back another day?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/erlerobot/smart_motor/issues/29#issuecomment-203361167

jlamperez commented 8 years ago

I have built two prototypes fully working with the new ordered parts.

Next week I will start to do some more intensive testing to see if I can reduce the error in the position measurements. Now this error seems to be aleatory and the worst case I have observerd is 10º of error. I think that it could be because the time sampling in position.

If I bring you one prototype with raspberry pi 1 I will need another one for testing. Have you got another one?

About the % of use of the CPU I attached an image where we can see a total 87% of use CPU(I have also come to see 93%) in the raspberry pi 1. The use of the SmartServo application is 58.9%. top_one

Also I talked with the tutor about printing the PCB and he told me that it was not any problem and nobody would use the design again, so I sent him the gerbers and I am waiting for the PCB now.

jlamperez commented 8 years ago

An image of how is the prototype:

prototype

imuguruza commented 8 years ago

I think there's no more Rpi1...