ROBOTC.net forums
http://robotc.net/forums/

Inner Workings of RobotC Mindstorms + Tetrix
http://robotc.net/forums/viewtopic.php?f=1&t=7394
Page 1 of 1

Author:  ScannerNewScanner [ Mon Dec 02, 2013 3:47 pm ]
Post subject:  Inner Workings of RobotC Mindstorms + Tetrix

I am working to build a library to extend RobotC's functionality with servos, but documentation runs a little thin on how the language actually communicates with the servo controllers internally, in terms of how the compiled code manages the bit banging. Could anyone provide a little input?

Author:  MHTS [ Mon Dec 02, 2013 4:24 pm ]
Post subject:  Re: Inner Workings of RobotC Mindstorms + Tetrix

Our FTC team has developed a robotics library for RobotC. Servo is one of the modules. It would be nice to know the internals of RobotC but it is not necessary for writing library modules. What functions do you have in mind for your servo library? Why do you need to understand the communication between RobotC and the servo motor controllers. Servo motor controllers are connected to the NXT via I2C bus. If you dig around the HiTechnics site you may be able to find the I2C commands to talk to the servo controller. But again, why re-inventing it if it's already done for you unless there is something you need to do and the existing support can't do it.

Author:  ScannerNewScanner [ Mon Dec 02, 2013 4:31 pm ]
Post subject:  Re: Inner Workings of RobotC Mindstorms + Tetrix

If you've tried out the new quarterscale servos from Tetrix, you'll see that they don't exactly behave. They use a different PWM scheme from that used by the Tetrix standard and continuous servos. I am writing an extension for controlling quarterscale servos.

Author:  MHTS [ Mon Dec 02, 2013 4:50 pm ]
Post subject:  Re: Inner Workings of RobotC Mindstorms + Tetrix

ScannerNewScanner wrote:
If you've tried out the new quarterscale servos from Tetrix, you'll see that they don't exactly behave. They use a different PWM scheme from that used by the Tetrix standard and continuous servos. I am writing an extension for controlling quarterscale servos.

I am not familiar with the differences of the quarterscale servos. In that case, you probably need to write your own "driver". A quick google on "HiTechnic servo controller commands" gave me some links:
http://www.legoeducation.us/etc/support ... efv1.3.pdf
http://www.education.rec.ri.cmu.edu/pre ... ntable.pdf

The first link is closer to what you want except it is for the HiTechnic motor controller not the servo controller. I don't have time to search exhaustively but you may want to google it some more.

Author:  tfriez [ Tue Dec 03, 2013 5:05 pm ]
Post subject:  Re: Inner Workings of RobotC Mindstorms + Tetrix

ROBOTC doesn't generate the servo pulse itself. It simply sends a I2C byte to the Servo Controller, which in turn takes that position and generates the servo timing (0.75ms to 2.25ms per 18ms cycle). From the HiTechnic specification:

Quote:
The Servo 1/2/3/4/5/6 position fields will accept a value between 0 – 255 to set the PWM output from 0.75 – 2.25mS. Note that some servos may hit their internal mechanical limits at each end of this range causing them to consume excessive current.


So other than simply writing a library to adjust the scale (i.e. add a bias or offset) there isn't much else we can do :-/

Author:  MHTS [ Tue Dec 03, 2013 5:24 pm ]
Post subject:  Re: Inner Workings of RobotC Mindstorms + Tetrix

tfriez wrote:
ROBOTC doesn't generate the servo pulse itself. It simply sends a I2C byte to the Servo Controller, which in turn takes that position and generates the servo timing (0.75ms to 2.25ms per 18ms cycle). From the HiTechnic specification:

Quote:
The Servo 1/2/3/4/5/6 position fields will accept a value between 0 – 255 to set the PWM output from 0.75 – 2.25mS. Note that some servos may hit their internal mechanical limits at each end of this range causing them to consume excessive current.


So other than simply writing a library to adjust the scale (i.e. add a bias or offset) there isn't much else we can do :-/

I swear I have seen a PDF about the I2C commands for the servo controller long time ago when I googled it because I remember seeing the Servo 1/2/3/4/5/6 fields. I can't seem to find it any more. Do you have a pointer to it?
Thanks.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/