# Help needed regarding motors

I need to specify the maximum value for the drive motors to be a 100 instead of 127. Considering that all these motors are on the analog output on the joystick, how do you do it in easy c?

Remember that the maximum motor value that can be assigned to a motor is 127 while the highest speed of a motor is 100 rpm. The relationship between motor value and motor speed is logarithmic. Refer to this graph for more information:
https://vexforum.com/showpost.php?p=303628&postcount=7
In easy c, the way i would do it is to get the joystick input analog value, and multiply that value by 100/127, and assign the calculated value to the motor. However according to the graph this will cause a wider deadzone for your joysticks.

And also may i ask, why would you like to do this? Since the faster the motors spin, the more power they put out. If you want the base to be slower, you can totally gear it down to gain more torque.

The motors run at the same speed at 127 power and at 100 power. This has been established through experiments. Our drive was kicking out with 127, it does not with 100.

Okay, i see. According to the graph i posted above, yes, 127 is actually not much different from 100 for three wire ports. But what does it mean “drive kicking out”?

Also if you don’t want to expand the deadzone of the joystick, then get the joystick analog value, if value is larger than 100, set motor value equal to 100. If value is smaller than -100, set motor value to -100. Else set motor value equal to joystick value. That should handlen the task better.

I tried doing exactly that but I could not get the analog value for the joystick. I gave it a command for getjoystickanalog but did not know what values it was giving me

Okay. First make sure you make a variable for the specified joystick analog channel. Then make sure you place the getjoystickanalog command block inside the infinite while loop, i assume you are making a driver control program. Then go back and check the controller number, joystick channel and the variable are all set up correctly in the getjoystickanalog block.
If the issue still exists, try placing a print to screen block in the while loop , print to screen the joystick value and set up wireless download and see what the feedback is from the joystick. That is the general method i would use to approach this issue. Hope your program will work fine soon.

This depends on whether you are using one of the 3-wire or 2-wire ports. The three wire ports output a pwm (pulse width modulated) signal that varies between 0.8mS and 2.1mS with a duty cycle of approximately 18mS. A control value of -100 corresponds to a width of 1mS, a value of 0 to 1.5mS and +100 to 2mS. This is “classic” RC servo control that has been used for years. The MC29 accepts these values and turns them into the actual motor control. We did some experiments almost two years ago that showed when using a MC29 a control value of about 84 caused the motor to run at maximum speed. The reason for this is to allow some tolerance on the control, the pwm pulses go slightly below and above the theoretical maximum and minimum values, the MC29 want’s to make sure that the motor reaches full speed and does this before the limit of the pwm pulse is reached. There is more information on the pwm signals here.

https://vexforum.com/showpost.php?p=302026&postcount=1

Motor ports 1 & 10 work in a different way and are under direct control of the user program. There are no intermediate stages and the program’s control values are used directly to control the internal H-Bridges. A control value of 100 will result in less motor power and, potentially, less change of tripping the PTC.

To be completely accurate, a motor will produce the most power when running at half speed, see the graph here.

https://vexforum.com/showpost.php?p=310291&postcount=2

Do you mean motor ports 1 & 10? The motors in the 2 wire ports that are controlled with internal motor controllers.

Oops, yes, edited post.

I guess 10 is sort of 2

Must have assumed 1 and 10 was written in binary.

Off topic but where are you working at worlds?

Inspection on Wednesday (or perhaps ROBOTC tech support) then Arts division, field tech.

Ooh good! I’ll try and get in your inspection line. Now I want to be in the arts division