Command library for the Roboteq SDC21XX serie of DC Motor drivers, using CANopen Interface. This library replicates the CANopen commands detailled in the User's Manual for the SDC21XX Serie, Section 14 CANopen Interface. Please refer to this document for more details about the use of any of the commands.
Fork of Roboteq_SDC_serie by
Revision 7:9a17b688dd59, committed 2016-07-11
- Comitter:
- kkoichy
- Date:
- Mon Jul 11 10:33:59 2016 +0000
- Parent:
- 6:bd10b47f59d2
- Commit message:
- Added comments
Changed in this revision
Roboteq.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Roboteq.h Thu Jun 16 12:30:29 2016 +0000 +++ b/Roboteq.h Mon Jul 11 10:33:59 2016 +0000 @@ -1,14 +1,27 @@ -/* Example programm for Nucleo F446RE : + +/**************************************************/ +/* Roboteq class : inherits from CANopen_node + - Contains : node-id, identifier of the node to communicate with, range from 1 to 127 + can, pointer to the CAN instance used to communicate with the node + + - Methods : 2 constructors, 1 of them setting the frequency of the CAN bus + Getters and setters for every variable + Send SDO up- and download, to send and receive basic messages over CANopen protocol + Every commands detailled in the SDC21XX serie documentation under the title Object Dictionnary + A SetParameters method, allowing to set acceleration, deceleration and velocity for one of the two channels of the motor controller +*/ +/**************************************************/ + +/**************************************************/ +/* Example programm Two motors are connected to 2 SDC21XX controllers, both on channel 1. When pressing the user button, 2 CANopen frames are sent, setting the motors to go to the position referred to as +/- 1000 - ************************************************************ #include "mbed.h" #include "Roboteq.h" -#include "CAN.h" -InterruptIn Button(PC_13); +InterruptIn Button(p28); Serial pc(USBTX,USBRX); -CAN Can(PA_11, PA_12); +CAN can(p30, p29); Roboteq Robot_Moteur1(4, &Can); Roboteq Robot_Moteur2(5, &Can); int i = 0, j = 1; @@ -28,8 +41,6 @@ pc.printf("\n\rdebut prog"); Button.fall(&send); - - while(1) {