My car
-
- Posts: 125
- Joined: 29 Sep 2010, 18:07
- Contact:
My car
Hey there, I have a wonderful idea that's been in my head for awhile. I just recently started building it, and it's almost finished (well, at least half of it is).
I am working on a remotely controlled NXT car. The controller is a second NXT, with two Forward/Backward joysticks on either side. I have built the car, but the programming is nowhere near being finished. The controller is nowhere near being finished, but the programming is (almost) done.
Currently, I have the basic program setup worked out, and I have a even more basic build design, I'm still working on that in my head. However, it's this particular aspect of the controller's joysticks that I need help programming.
My idea is to feed two motor's rotation vales (one on the left, one on the right) as the Joystick values, thus creating two Forward/Backward sticks, not a Throttle/Steering setup (ugh). I was planning on having it set up so that when the stick is pointing straight up, it's at the neutral position. Then, it could recognize forward and backward commands, on each stick. However, I wanted to ensure that the stick returned to the neutral position, so that if you pushed up on the stick and then let go, it would drop back down. This could easily be accomplished by springs, but if it was accomplished via programming, then you could apply it elsewhere. (Not to mention, the NXT doesn't come with springs.)
Currently I am attempting a setup where the Controller reads a motor's rotation value in degrees (as a variable), reduces it some, and then tells the motor to move the opposite direction with the variable going to the power input. This seems to be causing many problems, however. If anyone can help me, I would be delighted. I can send whatever I need to send to you (screenshots, program itself, etc.), just ask and you shall receive. (I would post it here, but I have no idea how.) Thanks in advance!
- Stryker
I am working on a remotely controlled NXT car. The controller is a second NXT, with two Forward/Backward joysticks on either side. I have built the car, but the programming is nowhere near being finished. The controller is nowhere near being finished, but the programming is (almost) done.
Currently, I have the basic program setup worked out, and I have a even more basic build design, I'm still working on that in my head. However, it's this particular aspect of the controller's joysticks that I need help programming.
My idea is to feed two motor's rotation vales (one on the left, one on the right) as the Joystick values, thus creating two Forward/Backward sticks, not a Throttle/Steering setup (ugh). I was planning on having it set up so that when the stick is pointing straight up, it's at the neutral position. Then, it could recognize forward and backward commands, on each stick. However, I wanted to ensure that the stick returned to the neutral position, so that if you pushed up on the stick and then let go, it would drop back down. This could easily be accomplished by springs, but if it was accomplished via programming, then you could apply it elsewhere. (Not to mention, the NXT doesn't come with springs.)
Currently I am attempting a setup where the Controller reads a motor's rotation value in degrees (as a variable), reduces it some, and then tells the motor to move the opposite direction with the variable going to the power input. This seems to be causing many problems, however. If anyone can help me, I would be delighted. I can send whatever I need to send to you (screenshots, program itself, etc.), just ask and you shall receive. (I would post it here, but I have no idea how.) Thanks in advance!
- Stryker
-
- Posts: 26
- Joined: 12 Oct 2010, 08:19
Re: My car
Here's a couple of ideas for the stick centering:I wanted to ensure that the stick returned to the neutral position, so that if you pushed up on the stick and then let go, it would drop back down. This could easily be accomplished by springs, but if it was accomplished via programming, then you could apply it elsewhere.
1) Have the sticks centered by using a low power setting. -So low that finger pressure can push them off center.
2) Mount a touch sensor at the upper ends of the sticks. Press the touch sensor to move the sticks, When the touch sensor is unpressed, the sticks return to center.
What kind of problems is it causing?Currently I am attempting a setup where the Controller reads a motor's rotation value in degrees (as a variable), reduces it some, and then tells the motor to move the opposite direction with the variable going to the power input. This seems to be causing many problems,
Dave
-
- Posts: 103
- Joined: 29 Sep 2010, 17:14
- Location: US
Re: My car
I have run into this same exact problem. The best solution I can think of is creating stages to each section of the motor rotation. For example, when motor degreese (md) is 10>md<20 the power level (pl) would be 10. and for 20<md>30, pl=20; 30<md>40, pl=30 and so on. What programming language are you using?
fuzzball27 >>-->
-
- Posts: 125
- Joined: 29 Sep 2010, 18:07
- Contact:
Re: My car
I had initially considered this, but I wanted a smoother amount of resistance; also, I wanted it to be adaptable for different devices.I have run into this same exact problem. The best solution I can think of is creating stages to each section of the motor rotation. For example, when motor degrees (md) is 10>md<20 the power level (pl) would be 10. and for 20<md>30, pl=20; 30<md>40, pl=30 and so on.
NXT-G. Sadly, I haven't made the time to learn C or C++, so I can't really do NXC.What programming language are you using?
I am attempting to accomplish Idea #1. Idea #2 is great, but that only works for up/down (logic signals), not values (amounts of) "up/down-ness" (aka, degrees). The idea I'm trying to get at is that it pushes back harder the farther you push, not "push all the way and then let it reset" (although that can be useful in some situations).Here's a couple of ideas for the stick centering:
1) Have the sticks centered by using a low power setting. -So low that finger pressure can push them off center.
2) Mount a touch sensor at the upper ends of the sticks. Press the touch sensor to move the sticks, When the touch sensor is unpressed, the sticks return to center.
Stuff like, the motors lock up, or they turn the wrong way, or the resistance doesn't change, etc.What kind of problems is it causing?
- Stryker
- Stryker AKA Jordan
http://nxtbystryker.wordpress.com
http://nxtbystryker.wordpress.com
-
- Posts: 13
- Joined: 10 Oct 2010, 18:49
- Location: Ohio
- Contact:
Re: My car
You could have the levers as pedals with touch sensors which would speed the robot up gradually.
-Ryan
-Ryan
I reject your reality and substitute my own. - Adam Savage
-
- Posts: 103
- Joined: 29 Sep 2010, 17:14
- Location: US
Re: My car
Do you mean using the touch sensor raw values? Because NXT-g cannot read raw values.You could have the levers as pedals with touch sensors which would speed the robot up gradually.
fuzzball27 >>-->
-
- Posts: 13
- Joined: 10 Oct 2010, 18:49
- Location: Ohio
- Contact:
Re: My car
No
Have the robot add power as the length of time that the touch sensor is held increase
Equation: s = seconds p = power
10s=p
Example:
The touch sensor is held down for 10 seconds.
10x10=100
Over a period of ten seconds the robot will be at 100 power
-Ryan
Have the robot add power as the length of time that the touch sensor is held increase
Equation: s = seconds p = power
10s=p
Example:
The touch sensor is held down for 10 seconds.
10x10=100
Over a period of ten seconds the robot will be at 100 power
-Ryan
I reject your reality and substitute my own. - Adam Savage
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: My car
What version? I just checked to be sure, and NXT-G 2.0 allows it.fuzzball27 wrote:... NXT-g cannot read raw values.
Edit: Are you referring to the INability to detect pressure with the touch sensor? This is a mechanical limitation of the NXT touch sensor. The NXT Touch sensor either returns 0 (1023) or 1 (18x). The RCX touch sensor changes resistance with force applied. Unlike the NXT Touch sensor, the RCX Touch sensor is NOT a switch, but rather a variable resistor. The values range from ~55-1022* as being pressed, and 1023 and not being pressed.
*I know that the software/firmware returns a boolean value of 1 or 0, with a threshold of somewhere in the 460ish range.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
-
- Posts: 13
- Joined: 10 Oct 2010, 18:49
- Location: Ohio
- Contact:
-
- Posts: 103
- Joined: 29 Sep 2010, 17:14
- Location: US
Re: My car
Thanks, nice to know. Is that with the advanced programming expansion pack?
Any progress on the car?
Any progress on the car?
fuzzball27 >>-->
Who is online
Users browsing this forum: No registered users and 2 guests