HiTechnic motor controller doesn't work as I want
Page 1 of 1

Author:  dumpledore [ Thu Apr 12, 2012 8:42 am ]
Post subject:  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++)

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

Thx for the help

Author:  maths222 [ Thu Apr 12, 2012 7:06 pm ]
Post subject:  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.

Author:  dumpledore [ Sun Apr 15, 2012 1:57 pm ]
Post subject:  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

Author:  maths222 [ Mon Apr 16, 2012 8:53 am ]
Post subject:  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

Author:  dumpledore [ Wed Apr 18, 2012 10:02 am ]
Post subject:  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[1] = 0x02;
HiT_I2Cmessage[2] = Motor_1_mode;
HiT_I2Cmessage[3] = 0x00;
sendI2CMsg(S1, HiT_I2Cmessage[0],1);
// Setting Motor_1_power
HiT_I2Cmessage[1] = 0x02;
HiT_I2Cmessage[2] = Motor_1_power;
HiT_I2Cmessage[3] = 0x3;
sendI2CMsg(S1, HiT_I2Cmessage[0],1);

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

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group