View unanswered posts | View active topics It is currently Fri Oct 31, 2014 1:49 am






Reply to topic  [ 5 posts ] 
HiTechnic motor controller doesn't work as I want 
Author Message
Rookie

Joined: Thu Apr 12, 2012 8:26 am
Posts: 3
Post HiTechnic motor controller doesn't work as I want
Hy! I'm new in this forum and I started this topic, because I couldn't find a solution to my problem. I'm in the middle of a project for a fast Segway. I heard that the HiTechnic DC Motor controller is a good powerlink when using motors that are more powerful than the lego standard. So I bought one of these controllers, but it doesn't really do what I need.

The first problem is, that the output voltage from the controller hasn't a linear increase. I made a few measurements increasing constantly (by one) the variable "motor[motorD]" and I got these voltage values: [0,0.05,0.2,3.35,6.33,8.52,10,11.1,11.87,12.43,12.88,13.23,13.5,13.74,13.9,14.05,14.18,14.25,14.35,14.44,14.52,14.58,14.62,14.7,14.76,14.8...].
This is the code I used:

task main()
{
for(int i=0;i<=100;i++)
{
motor[motorD]=i;
wait1Msec(500);
}
}

Do you know any reason why the output voltage acts so strange and has no linear increase?

Thx for the help


Thu Apr 12, 2012 8:42 am
Profile
Rookie
User avatar

Joined: Wed Dec 01, 2010 5:15 pm
Posts: 31
Post Re: HiTechnic motor controller doesn't work as I want
From what I understand, changing the power does not change the voltage. Instead, it changes the frequency of pulses of full voltage followed by pulses of no voltage. Someone please correct me if I am wrong.


Thu Apr 12, 2012 7:06 pm
Profile
Rookie

Joined: Thu Apr 12, 2012 8:26 am
Posts: 3
Post Re: HiTechnic motor controller doesn't work as I want
Sure you're right. So works the NXT Brick. Out of the motor ports comes a PWM. Out of the controller comes the analog signal (like the arithmetic average of the PWM). I suppose the PIC microcontroller of the HiTechnic generates a PWM that gets filtered (probably with some sort of RC-filter) and amplified with the battery voltage.
I've measured also the arithmetic voltage of the PWM from the NXT Brick and the duty cycle. The increments were always linear (like it should be). But with the controller it's not. I think there is a configuration that is wrong. Do you know how to change the registers from the controller with I2C commands?

Thx for the help


Sun Apr 15, 2012 1:57 pm
Profile
Rookie
User avatar

Joined: Wed Dec 01, 2010 5:15 pm
Posts: 31
Post Re: HiTechnic motor controller doesn't work as I want
Here is a document about the motor controllers, including i2c addresses: hitechnic motor controller brief v1.3.pdf


Mon Apr 16, 2012 8:53 am
Profile
Rookie

Joined: Thu Apr 12, 2012 8:26 am
Posts: 3
Post Re: HiTechnic motor controller doesn't work as I want
I've written this code for writing to the registers:


#define Motor_1_mode 0x44
#define Motor_1_power 0x45
#define Motor_2_mode 0x46
#define Motor_2_power 0x47
#define Motor_Enc_1 0x4C /*!<Motor 1 current encoder value*/
#define Motor_Enc_2 0x50 /*!<Motor 2 current encoder value*/

task main(){
//Arrays to hold the I2C message sent toslave and response
sbyte HiT_I2Cmessage[4]; /*!< Array to hold I2C command data */
sbyte HiT_I2Creply[1]; /*!< Array to hold I2C reply data */

// Configure port S1 to be a low speed I2C sensor
SetSensorType(S1, sensorI2CCustomFast);
// Setting Motor_1_mode at 0 (runs with power control only)
HiT_I2Cmessage[0]=3;
HiT_I2Cmessage[1] = 0x02;
HiT_I2Cmessage[2] = Motor_1_mode;
HiT_I2Cmessage[3] = 0x00;
sendI2CMsg(S1, HiT_I2Cmessage[0],1);
wait1Msec(2000);
// Setting Motor_1_power
HiT_I2Cmessage[0]=3;
HiT_I2Cmessage[1] = 0x02;
HiT_I2Cmessage[2] = Motor_1_power;
HiT_I2Cmessage[3] = 0x3;
sendI2CMsg(S1, HiT_I2Cmessage[0],1);
wait1Msec(5000);
}

Unfortunately I get the same output voltage as before. :breakcomputer:


Wed Apr 18, 2012 10:02 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.