View unanswered posts | View active topics It is currently Mon Feb 27, 2017 12:13 pm

Reply to topic  [ 3 posts ] 
A command of motor[]=80 gives a motorPWMLevel[] = 100 
Author Message

Joined: Wed Jan 23, 2013 6:16 pm
Posts: 7
Post A command of motor[]=80 gives a motorPWMLevel[] = 100
I am trying to understand the dynamics of Tetrix motors using RobotC for FTC hardware environment.

I have a simple testbed with (3) Tetrix motors I'm trying to sync. Note: the motors have no load on them.
I want to be able to sync the motors as fast as possible and am trying to develope a control scheme. I've tried testing with and without PID attribute.

I've tried using encoder position error alone to feedback motor control, but without success. I'm now trying to also use the PWM level to help identify if I should increase the slow motor(s) or decrease fast one(s).

However, it seems I need a motor command below 80 in order to see a PWMlevel below 100. Below is a code snippet to see where I'm drawing my conclusions. the "xMotorPower is assigned to each respective motor.

// Print the debug data every 1 second
if ((time100(T1) >= 10) && (errorHasOccurred == false))

writeDebugStream("Bow position = %d\n", bowPosition);
writeDebugStream("Port position = %d\n", portPosition);
writeDebugStream("Starbord position = %d\n", starboardPosition);


writeDebugStream("Bow commanded power = %d\n", bowMotorPower);
writeDebugStream("Port commanded power = %d\n", portMotorPower);
writeDebugStream("Starbord commanded power = %d\n", starboardMotorPower);


writeDebugStream("Bow PWM actual power = %d\n", motorPWMLevel[bow]);
writeDebugStream("Port PWM actual power = %d\n", motorPWMLevel[port]);
writeDebugStream("Starbord PWM actual power = %d\n", motorPWMLevel[starboard]);

Is the motorPWMLevel[] accurate?

Should I use motorPWMLevel[] to make motor control decisions?

Sat Feb 02, 2013 10:58 am
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 271
Location: Olympia, WA
Post Re: A command of motor[]=80 gives a motorPWMLevel[] = 100
I believe this is cause by the `motorPWMLevel[]` "command". This is because technically that is a VEX command, so I don't think it would work for TETRIX. It is not a documented function either.

EDIT: I looked into RobotCIntrinsics.h, and it is in there, and it should work... Anyone else? It seems like this would be a nice function to have, if it worked. Then again, they might have yet to implement it, which is why your code is breaking.

FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!

Sat May 18, 2013 2:52 pm
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 620
Post Re: A command of motor[]=80 gives a motorPWMLevel[] = 100
The motorPWMLevel command applies for the NXT platform and motors as ROBOTC has control of the PID algorithm for these motors.

For the TETRIX system, we have no way of getting feedback from the Motor Controller to make a determination of PID status/speed. We simply enable a "PID bit" and the controller does the work itself.

You'll notice in the NXT Devices debugger window, the value returned by "motorPWMLevel" is listed under the PID column, but for TETRIX motors it'll list "N/A" under the PID column.

Timothy Friez
ROBOTC Developer - SW Engineer

Mon Jul 15, 2013 5:00 pm
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.