programming problem

Well guys I wrote this programme and it made those motors not work well.they seems to be jammed, I mean when I push joysticks up or down, motors run Intermittently with strange sound.
I am using EasyC for VEX 2.0.Here is the screenshot and the chassis.
Is it a bug or something wrong with my programme, or I have to get EasyC Pro?
Any suggestion would be grateful.

http://i191.photobucket.com/albums/z13/kongjw_1993/IMAG0112.jpg
Anarkia_dual_chassis_v0.2.zip (939 Bytes)

It looks like you are driving the SAME motors with two DIFFERENT sets of controls.

One drive the motors from ch 2, 3 the other drives the motors from ch5.

The software shown reads ch2,3 then applies the values to the motors, but then the very next line cancels that and tries to drive the motors from ch5.

Then the loop repeats and the lines continue to cancel each other so the motors never do anything.

Delete the second Tank4 line and it should work fine (using ch 2,3)

  • Rick

A pretty good piece of advice to everyone – no matter which programming language you are using, if your motors seem to be twitching or reversing direction really quickly, you are (99.9% of the time) sending conflicting motor speed commands from your program. I see this frequently (and students always start by blaming the VEX controller :slight_smile: ).

If a motor is running constantly regardless of inputs from the program, you probably have a PWM cable plugged in backwards.

I’ve changed the program and it’s controlling only one motor by each channel from 1 to 4 but it’s hard (or strange) to operate and that let our operator speechless.

So is it possible to use channel 3 and 2 to let the motors on the same side to run and channel 5 for turning, or it will work if I use robotC?

Yeah i would try something like this. What you need to do if get Rx five to store it’s information in a variable. Using the Rx Input block so you could make it so Rx channel five returns it’s info and stores it as a variable called CH_5

If CH_5 == 127
Inset you arcade drive of the robot here something where ch 1 controls the sideways wheels (The ones on the longer pieces of the chassis) and ch 2 controls the wheels that are forwards and back. so if you push the joystick forward you go forward. If you push it back you will go back and if you go side to side you will go side to side.

You can do this using the Motor Module Rx block so that Ch 2 controls the forward and back motors and ch1 controls the side to side motors.

If Ch_5 == 255
Set all the motors to turn at full speed as to spin the robot clockwise

You can use the Motor Module block that is under outputs to do this

If Ch_5 == 0
Set all the motors to turn at full speed as to spin the robot anticlockwise

You can use the Motor Module block that is under outputs to do this

Could you please tell us which motors are plugged into which ports it would make it a bit easier for us to help you this way. Thanks
~DK

thanks for that and here is the programme modified.

The purpose is to use channel 3 and 2 for normal moving and channel 5 for turning.

There are the motor installation and a screenshot of the programme.Thanks for the notice DK lol.

So will it work or any setting should be changed? Thanks for your advice.

http://i191.photobucket.com/albums/z13/kongjw_1993/chassis.gif?t=1267809924
Anarkia_dual_chassis_v0.21.zip (1.53 KB)

It looks fine from what i have seen except for one thing i would put the Tank4 block inside a loops so that you will only be able to do that if ch 5 is not being pushed at all. This way you will not set compromising signals to the motors which will cause them to twitch.

Why do you want to use ch 2 and 3 to control this thing. It just seems awkward because you will be pushing ch 2 forward on you controller to get the robot to move sideways. It is just a driver thing whatever they prefer. If it were me driving that may be a bit confusing.

~DK

Well thanks for that.

So could you check this setting?

Channel 3 ---- Motor1

Channel 2 ---- Motor2

Channel 5 ---- Motor 3&4 (sideway movement)

Channel 6 ---- all motor for turning

I would make it something like this

Ch 2 Controls motors 1 and 2 for forward and back movement
Ch 1 Controls motors 3 and 4 for side to side movement

Ch 5 all motors for spinning

This just seems to make since.

To do this i would use the Motor Module Rx block instead of a Tank 4 Motor block. This way you could get it to run smoothly.

~DK

I will try both of them tomorrow morning and post our operator’s feedback.

You are familar with this setting? We always use channel 2&3 for those motors.

Nice of you to make me understand the way to use Rx input.lol

and just to be sure you added in a loop that says IF a==127 and you put you standard (not spinning) code in there? correct. If you do not do this then you may sent conflicting signals to the motor.

~DK

thanks for the notice, but I thought that it’s not necessery because there is no command to motor when a==127. Well I will make sure there is a command when a==127.

It may not be necessary but it is a good precaution.

~DK

Well when I fisrt download the proramme my bot is able to spin only clockwise when I press button of Ch5.

Then I set ch5 for clockwise spinning and ch6 for anticlockwise, and it couldn’t spin at all,though normal movement is OK.

Hard for me to identify which step was wrong. Here is screen and the programme.

http://i191.photobucket.com/albums/z13/kongjw_1993/untitle-2.jpg?
Anarkia_dual_chassis_v0.4.zip (22 KB)

did you all forget about smartkid’s holonomic drive tutorial?
i think you can just download the code there
because i think its more complicated than the code you posted
(you needed to change numbers, and then change them back, and do a bunch of checks)
and i think another user uploaded your “+” holonomic code in his thread as well
btw your drive chassis looks pretty sweet ^^

Here is a programme bsed on smartkid’s tutorial but not working correctly.

Method:
part1: RxInput ch2 —> x axis
part2: RxInput ch3 —> y axis
part3: RxInput ch4 —> spinning

I’ve downloaded it and only signal from ch3 worked.

If I only use any one of those parts it would work properly, but when I join them together only the first part in programme would work.

Seems that this program still has mistakes but I could not to find out.
Anarkia_dual_chassis_v0.6.zip (2.85 KB)

Try this.

Since you have Ch3 for Forwards/Backwards, Ch2 for Right/Left, and Ch5 for turning, all you need is two arcade drive commands:

Arcade2 ( 0 , 3 , 5 , 1 , 2 , 0 , 0 ) ;
Arcade2 ( 0 , 2 , 5 , 3 , 4 , 0 , 0 ) ;

You may need to choose to invert some motor movements, alter the radio controls, etc. to make it work, but for a plus-shaped holonomic that’s all you need. One channel will control all turning, and the other two individual channels work the linear motion. If you turn while moving or you roll the non-turning joystick around you’ll get drifting and one-sided turning.

Hope this helps!

Hey Anarkia i just emailed you some code (tested and working). i never figured out how to attach code on this forum.

~DK

Your code works properly DK thanks.

Maybe my code would work when those motors are not running in the same speed.lol

When you Quote a Message or Start a New Message, there is a Box, below the Editing Box that says “Additional Options”. The Second Section says “Attach Files”, click the “Manage Attachments” Button, and when the Pop Up Window appears, Click the “Browse” Button to find the file you want to attach to the Message… Find your File and click the “Open” Button, after selecting that File. Don’t forget to click the “Upload” Button after each file you Browse and Open…