View unanswered posts | View active topics It is currently Mon Dec 22, 2014 1:03 pm






Reply to topic  [ 6 posts ] 
Inner Workings of RobotC Mindstorms + Tetrix 
Author Message
Rookie

Joined: Thu Nov 28, 2013 1:09 am
Posts: 3
Post 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?


Mon Dec 02, 2013 3:47 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1372
Post 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.


Mon Dec 02, 2013 4:24 pm
Profile
Rookie

Joined: Thu Nov 28, 2013 1:09 am
Posts: 3
Post 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.


Mon Dec 02, 2013 4:31 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1372
Post 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.


Mon Dec 02, 2013 4:50 pm
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 616
Post 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 :-/

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Tue Dec 03, 2013 5:05 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1372
Post 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.


Tue Dec 03, 2013 5:24 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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.