BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Sun Nov 19, 2017 11:35 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: RoboClaw 2x15A, command 65 Speed, Accel, Deccel and Position
PostPosted: Thu Nov 06, 2014 2:47 pm 
Offline
New User

Joined: Thu Nov 06, 2014 11:51 am
Posts: 2
Hi,

I've a problem with the command : Drive M1 with signed Speed, Accel, Deccel and Position.
My problem is when I program and execute this command (with Qt creator), the seccond LED of RoboClaw turn on but the motor doesn't run. In addition, when I get a pulse on the motor with my hand, the motor do something strange, He turns like He was in step by step and I don't understand why he move like that.

I try to send the command with serial_port->putChar(); and serial_port->write , with the same result.

I attach my Qt code for is command and I apologize for my bad english.

Best regards,


Attachments:
Qt.txt [2.28 KiB]
Downloaded 235 times
Top
 Profile  
 
 Post subject: Re: RoboClaw 2x15A, command 65 Speed, Accel, Deccel and Posi
PostPosted: Mon Nov 10, 2014 8:09 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
My first question is have you sent other simpler commands and did they work? If not please start with a simpler command. Make sure the motors can be driven with simple duty cycle commands before jumping into the encoder based commands. If you have done this please describe in your nexzt post everything you have done.

The speed commands need to have the velocity variables set up(QPPS, Kp,Ki and Kd) for them to work correctly.
The position commands(the one you are trying to use) need to also have the position variables setup(position Kp,Ki,Kd, Kimax,deadzone and min and max as well as atleast the velcity QPPS variable).

If these variables are not set to appropriate values your motor may not turn at all. For example if min and max are not set correctly any position value outside of the min and max settings are ignored).

You can either set these from your program(which you dont do in your example) or you can set them(and tune your PID) using the IonMotion software and then save those settings to non-volatile memory on the roboclaw so you dont have to set them in your QT code.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: RoboClaw 2x15A, command 65 Speed, Accel, Deccel and Posi
PostPosted: Wed Nov 12, 2014 11:15 am 
Offline
New User

Joined: Thu Nov 06, 2014 11:51 am
Posts: 2
I can send a simple command like backward, forward, and the motor turn correctly.

However, when I try send a command for read the value of encoder and the speed, the checksum that I recieves is different that the checksum I calculed. ( Checksum = data_receives[3] + data_receives[2] + data_receives[1] + data_receives[0] + data_receives [4], like described in the datasheet of roboclaw ).
I try to send the commande Velovity_PID, but the result is the same. But I don't understand, if you want use the accel,speed,deccel,position, you need to send before the PID Constants (command 61 datasheet roboclaw) then you don't need to sent the velocity ?
In addition I put a min at -99999999999 and max at 9999999999, then I don't think I have a problem with this. I think is How I sent the command because when I test which a Arduino Mega 2560 the command of Acc, speed, deccel and position, this command work in using the Roboclaw and BMSerial librairies.

I attach the totality of my Qt code.

Thx for the help, sorry for my english


Attachments:
RoboClaw_test.rar [7.16 KiB]
Downloaded 258 times
Top
 Profile  
 
 Post subject: Re: RoboClaw 2x15A, command 65 Speed, Accel, Deccel and Posi
PostPosted: Sat Nov 29, 2014 6:33 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
The checksum calculation must be & with 0x7F to create the actual checksum. You dont have that in the code you show.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO