Rcx control by ev3
Hello, I liked your idea to control rcx by ev3
I have few questions though...
- Can you use serial tower by using serial to usb interface instead of usb tower ?
- Can you elaborate on packet protocol of rcx and how it is implemented in your code ?
- Can the tower.send work for sending custom int values to RCX Lejos?
- I know it's possible to use a serial tower, but I'm not sure if my code would just "work" on it. In theory, you could just point my code to
/dev/ttyAMA0(or wherever it shows up as) and everything would work as normal, but on a serial tower. - The RCX packet protocol is still a bit sketchy to me, but there's a short writeup here: http://www.mralligator.com/rcx/protocol.html
As for the opcodes it's sending to the RCX, those are defined here http://www.mralligator.com/rcx/opcodes.html
The code2185sends the opcode0x21, meaning "turn on or off motors" with the argument0x80 | 0x1 | 0x4, which means "turn on A and C" - I'm sure it's possible, but I've never used LeJOS for RCX.
Also, here are some videos of my RCX controlling code at work:
https://www.youtube.com/watch?v=t4EUzCGEUEI
https://www.youtube.com/watch?v=AtdG0gXhS0A
I wish to make an arduino based bluetooth to ir relay (bidirectional if possible) for rcx....mainly for following reasons
- It will be possible to connect rcx to ev3 or nxt or an android phone via bluetooth 2.Eg Rcx can act as locomotion base for an android phone doing object tracking and other heavy lifting tasks
- It will be cool and challenging project!!!
Any thoughts??
Very thanks
In my experience the RCX is not well suited to precise or difficult tasks. The motors have no tachometers in them for positional or correctional feedback, which often results in very inaccurate movements. Also the motors are not well suited to heavy tasks, they have very little torque unless you gear them down to a quite slow speed. You might try a worm gear. The LEGO building bricks don't hold together well under heavy weight, but good building technique can help avoid this problem.
The RCX doesn't work too well at long-range from the IR tower, so attaching the tower to the bot may be required for best accuracy. I have put my phone onto the RCX before, with a live-streaming IP camera app on it. It worked pretty well, actually, but for some reason my phone appears to emit a constant "0xFF" from its IR blaster as of android 4.4.4, and it was interfering with the RCX. If your phone has a working IR blaster, you might experiment with controlling the RCX with it, though I can't say for sure if the IR blaster on a phone can generate the required frequency of flashes.
All good points
the relay will always be in front of rcx..just like the tower you mounted on the robot. Yes, rcx does not have tacho, but android smartphone has plethora of imu sensors like gyros and accelerometers which can be used to get the current heading and acceleration
The only paramater that has to be passed to rcx is the speed of both the motors and polarity (eg for a single motor ranging from -100% to 100%)...here -ve sign indicates reversed polarity
for a pair of motors forward is (100,100) backward is (-100,-100) left is (-100,100) arc left(-50,100) and so on
these parameters can be given by an android app which implements PID controller based on its imu sensors
I'm not quite sure how well the feedback thing would actually work, since as far as my tests have gone there's a slight "cooldown" period between when it allows you to send commands..
The "Set motor power" opcode only allows you to set power as values 0 through 7. 13050203 would
- set the power of
13 - motors A and C
05 - to the value of
02 - 3
03