go_away

Author Topic: Axon 1 and SyRen 25  (Read 1359 times)

0 Members and 1 Guest are viewing this topic.

Offline CaiTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Axon 1 and SyRen 25
« on: December 14, 2009, 08:35:02 PM »
Hey,

I've just bought a SyRen 25 motor controller and I own an Axon.

I've been using this page as documentation for the SyRen 25 : http://www.dimensionengineering.com/datasheets/SyRen10-25.pdf

I'm using the SyRen 25 in simple serial mode with braud rate 38400. I'm using the UART2 pins on the Axon and have connected the T-pin to the SyRen's S1 pin and the Axon's G-pin to the SyRen's 0V pin. At the other end, I have the motor connected to the M1 and M2 pins and a battery connected to the B+ and B- pins. The Axon also has a battery connected to it.

My problem is that I'm confused about how to send messages to the motor controller in my code. I found the admin's little method for the controler : syren(int m1) and have been using that. However, how should this be used?

My control.m file currently looks like this :
Code: [Select]
void control(void) {
//Deal with user commands  (currently only through the hardware button)
while(button_pressed()) {
LED_on();
                delay_ms(1000)
syren(255);
delay_ms(10000);
syren(0);
delay_ms(500);
LED_off();
}
}

I was expecting this to make the motor run forward for 10 seconds then stop. But this makes the motor move slightly in one direction and stops then moves slightly in other direction. This suggests that the SyRen needs to be constantly sent the command to keep it running at the required speed. So I changed my code to this

Code: [Select]
void control(void) {

//Deal with user commands (currently only through the hardware button)
while(button_pressed()) {
syren(255);
}

}

Which I expect to mean that the motor will only run when the button is pressed. However the motor is off until i press the button, it then stays on until i remove power from the Axon. Also when i remove the power from the Axon (but not the SyRen) the motor

So where am i going wrong and which is the right way to use it?

Thanks
« Last Edit: December 14, 2009, 08:36:49 PM by Cai »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots
Re: Axon 1 and SyRen 25
« Reply #1 on: December 18, 2009, 03:11:23 AM »
The problem you mentioned in your first set of code sounds more like a low battery problem.

For your second set of code, you have nothing to change the motor state when the button isn't pushed. Change your code to this:

Code: [Select]
void control(void) {

//Deal with user commands (currently only through the hardware button)
while(button_pressed()) {
syren(255);
}
syren(127);

}

 


Get Your Ad Here

data_list