|
View previous topic :: View next topic
|
| Author |
Message |
limor Savvy Roboteer


Joined: 11 Oct 2004 Posts: 1295 Location: London, UK
|
Posted: Fri Jul 13, 2007 7:39 pm Post subject: Bioloid and Matlab Simulink |
|
|
In case you missed the announcement:
http://robosavvy.com/forum/viewtopic.php?t=1514
Pedro (rustyarmor) is putting together a summary of some of the work done at IST humanoid robot lab (in cooperation with RoboSavvy .
http://humanoids.dem.ist.utl.pt
Please feel free to post any questions on this forum.
The lab is looking for Masters students for next year to research humanoid robot control. Erasmus students from other EC member states are welcome. So if you know someone who is a fan of wind/kite surfing and a roboteer in 3rd-4th year mechanical/Electrical engineering.. Lisbon's IST humanoid robotics lab should be a fun place to spend the next year.
The site (which may eventually be updated an maintained here at RoboSavvy for posterity) will include:
1) Full in-depth identification of all mechanical parts of the Bioloid including a very precise 3D model.
2) Matlab Simulink linked with Sim-Mechanics for precise offline simulation and visualization.
3) Matlab Simulink Real-time-windows target (*) serial driver implementing a proprietary simple protocol with the CM5 for control-loop (PC sends speed controls to Bioloid servos, Bioloid responds with current servo positions.)
4) Matlab Simulink EZPhysics target - to test the control loop algorithm to a physics enabled simulation of Bioloid
5) Matlab Simulink Gumstix target - to dump the control loop algorithm to a Gumstix for on-board control of the Bioloid. The gumstix will connect to the Bioloid bus using the RoboStix daughter board.
(*) RTWT - is a way to run the control loop algorithm on a Windows PC in real-time. The algorithm real-time higer priority than the Windows O/S and hence runs with a real-time clock. The disadvantage is that there are hardly any I/O drivers supported in this mode. A serial driver had to be written in order to communicate with the CM5. |
|
| Back to top |
|
 |
Biodog Robot Builder

Joined: 14 Mar 2007 Posts: 17
|
Posted: Mon Jul 16, 2007 2:14 pm Post subject: |
|
|
I fit can help I may give you my SolidWorks 2005 parts model (I know Rustyarmor gave a full modelisation, but I couldn't use it), knowing the fact that it's my first experience in SW so there might be mistakes/approximations.
I'm actually in Master in France and I'd be quite interested to go to Lisbon (even if I don't speak portuguese!) but it's too late, I've signed for my M2 this morning by the way, I'll look forward your progress! |
|
| Back to top |
|
 |
srobot Savvy Roboteer


Joined: 10 Dec 2006 Posts: 397 Location: Deep in robot parts
|
Posted: Wed Jul 18, 2007 9:27 pm Post subject: |
|
|
Lovely!
What software are you using?
Is that
1 Screen) Sim
2 Screen) Graph
3 Screen) Background
I'd love any links you may have to software.
--srobot _________________ Dell Latitude D520, Windows XP, 4 GB RAM, 80 GB HDD, Intel Core 2 Duo. The power that's needed!
RIBO Labs, Springing Robotic Development to a New Level |
|
| Back to top |
|
 |
Dimitris Savvy Roboteer


Joined: 29 Jun 2006 Posts: 49 Location: Greece or UK
|
Posted: Thu Jan 17, 2008 12:24 am Post subject: |
|
|
Hi,
Has anyone tried to run this matlab interface? I followed all the steps and I'm oonly stuck at the end when building the simulink model
Error ../PC_code.c: 110 undeclared identifier `t'
Warning ../PC_code.c: 110 Statement has no effect
Error ../PC_code.c: 110 syntax error; found `counter' expecting `;'
Warning ../PC_code.c: 109 possible usage of t before definition
Warning ../PC_code.c: 137 unreachable code
Initially I got the above error, which seemed to be due to a random 't' at the end of a loop, which must have been a typo. So I remove it and re-build and end up with this error:
pc_code.obj .text: undefined reference to '_outp'
pc_code.obj .text: undefined reference to '_inp'
gmake: *** [../diagram.exe] Error 0x10
gmake: *** Deleting file `../diagram.exe'
### Real-Time Workshop build procedure for model: 'diagram' aborted due to an error.
... and the error message dialog gives:
Error using ==> RTW.genMakefileAndBuild
Anyone any ideas??? _________________ Sign Language Glove
-====-
Homepage |
|
| Back to top |
|
 |
Dimitris Savvy Roboteer


Joined: 29 Jun 2006 Posts: 49 Location: Greece or UK
|
Posted: Thu Jan 17, 2008 2:31 am Post subject: |
|
|
-- _________________ Sign Language Glove
-====-
Homepage
Last edited by Dimitris on Sat Jan 19, 2008 5:26 am; edited 2 times in total |
|
| Back to top |
|
 |
limor Savvy Roboteer


Joined: 11 Oct 2004 Posts: 1295 Location: London, UK
|
Posted: Fri Jan 18, 2008 12:09 am Post subject: |
|
|
Hi Dimitris,
I will ask Pedro to respond to your query. |
|
| Back to top |
|
 |
rustyarmor Robot Builder


Joined: 20 Oct 2006 Posts: 19
|
Posted: Sat Jan 19, 2008 1:28 am Post subject: |
|
|
Hi Dimitris,
The code should work. The tutorial has been tested successfully, so no reasons to worry, you will have matlab controlling the servo.
For what you say, the problem seems to be inside the PC_code.c. Copy again all the code and verify that matlab doesn't split lines. The code has been tested and it really should work.
If, after doing this, the problem maintains, try to use then, the original PC_code.c . See the following file:
http://robosavvy.com/site/Builders/rustyarmor/Application.rar
Pedro |
|
| Back to top |
|
 |
Dimitris Savvy Roboteer


Joined: 29 Jun 2006 Posts: 49 Location: Greece or UK
|
Posted: Sat Jan 19, 2008 5:42 am Post subject: |
|
|
Hi,
Thanks for the code! I spotted a small difference in the code you gave me, which has a 'mux1' instead of a 'mux' simulink block, but I don't think that has any significance. Anyway I used the downloaded diagram and it built successfully!
I also noticed that the CM5 code chose servo id as 16 instead of 1, but in both cases what I got as a scope output was unfortunately a servo position (violet line) which did not follow the input but just stayed fixed at 65535
:S _________________ Sign Language Glove
-====-
Homepage |
|
| Back to top |
|
 |
rustyarmor Robot Builder


Joined: 20 Oct 2006 Posts: 19
|
Posted: Sat Jan 19, 2008 12:45 pm Post subject: |
|
|
Hi Dimitris,
mux1 or mux are just names for the block. So don’t worry about their names.
In order to work it is necessary only to change the id of the servo that you are using in the mcu code.
| Code: |
/**************************************
* code to be inserted *
**************************************/
//servo to be used
bID = 1;
|
65535 as the step response means that it has occurred an error in reading the servo. Therefore try to redo this:
Before testing the application, verify if the CM5 is plugged to the PC and if it is OFF.
Then, attach your servo to the CM5.
Finally, turn on the CM5 and then press the play button.
If everything went right you must see something similar to the next graph. The initial position of the servo is in 800 encoders (violet line) and it can be seen its response to a step (yellow line).
The reason you only see the violet line, is because it is a constant value at 65535 which is much higher than 800 (the step value). To see the step zoom it.
Hope it helps,
Pedro |
|
| Back to top |
|
 |
Dimitris Savvy Roboteer


Joined: 29 Jun 2006 Posts: 49 Location: Greece or UK
|
Posted: Sat Jan 19, 2008 6:00 pm Post subject: |
|
|
Hi,
This is the code I'm currently using.
http://robosavvy.com/Builders/Dimitris/Application.zip
It's the code you recommended downloading, I've changed servo ID to 1, rebuilt everything and also made sure that my servo has id 01 and is working properly. I downloaded the code to the cm5 and made sure I disconnected after.
I also made sure cm5 was off and plugged in to pc (why is this?) while attaching servo. Also had disconnected all other servos. Then I turned on the cm5 power. Next before pressing play on the simulink I have to click 'Connect to target' button right next to 'play' before this becomes enabled. Then I can see the step (yellow line) but the servo response remains at 65535. _________________ Sign Language Glove
-====-
Homepage |
|
| Back to top |
|
 |
rustyarmor Robot Builder


Joined: 20 Oct 2006 Posts: 19
|
Posted: Sat Jan 19, 2008 6:19 pm Post subject: |
|
|
Hi,
Did the servo reacts, moves to any direction? |
|
| Back to top |
|
 |
Dimitris Savvy Roboteer


Joined: 29 Jun 2006 Posts: 49 Location: Greece or UK
|
Posted: Sat Jan 19, 2008 6:35 pm Post subject: |
|
|
No movement at all! but led flashes when cm5 is turned on. Plus I just tested that the servo works fine with other programs. And its Id is definitely 01. _________________ Sign Language Glove
-====-
Homepage |
|
| Back to top |
|
 |
rustyarmor Robot Builder


Joined: 20 Oct 2006 Posts: 19
|
Posted: Sat Jan 19, 2008 7:13 pm Post subject: |
|
|
Hi Dimitris,
Try with servo 18. (Change the mcu code)
and try this:
1 disconect the com after changing the mcu code.
2 turn off cm5 and plug the servo 18.
3 in simulink press Incremental build button to build the model and wait until the play button becomes enable
4 turn on cm5
5 press the play button
The error maintains, no servo response?? |
|
| Back to top |
|
 |
Dimitris Savvy Roboteer


Joined: 29 Jun 2006 Posts: 49 Location: Greece or UK
|
Posted: Sat Jan 19, 2008 7:54 pm Post subject: |
|
|
yeah, same results. But the play button is not enabled immediately after the incremental build, as I first have to click 'connect to target'. I'm using 'external' simulation mode as in the tutorial. _________________ Sign Language Glove
-====-
Homepage |
|
| Back to top |
|
 |
rustyarmor Robot Builder


Joined: 20 Oct 2006 Posts: 19
|
|
| Back to top |
|
 |
|