-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
777 additions
and
103 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,52 @@ | ||
# ProjectTemplate | ||
|
||
This repository contains a basic ClearCore project that can be used as a template for new application development. | ||
Place this repository rooted in the same parent directory as libClearCore and LwIP to properly find include files and libraries. | ||
Place this repository rooted in the same parent directory as libClearCore and LwIP to properly find include files and libraries. | ||
|
||
## Requirements: | ||
|
||
### ETHERNET COMMUNICATION: | ||
1. The PC should be running software capable of sending and receiving UDP | ||
packets. See `udp_client.py` for simple testing. | ||
|
||
|
||
### MOTOR: | ||
1. A ClearPath motor must be connected to Connector M-0. | ||
2. The connected ClearPath motor must be configured through the MSP software | ||
for Manual Velocity Control mode (In MSP select Mode>>Velocity>>Manual | ||
Velocity Control, then hit the OK button). | ||
3. In the MSP software: | ||
Define a Max Clockwise and Counter-Clockwise (CW/CCW) Velocity (On the | ||
main MSP window fill in the textboxes labeled "Max CW Velocity (RPM)" | ||
and "Max CCW Velocity (RPM)"). Any velocity commanded outside of this | ||
range will be rejected. | ||
Set the Velocity Resolution to 2 (On the main MSP window check the | ||
textbox labeled "Velocity Resolution (RPM per knob count)" 2 is | ||
default). This means the commanded velocity will always be a multiple | ||
of 2. For finer resolution, lower this value and change | ||
velocityResolution in the sketch below to match. | ||
Set Knob Direction to As-Wired, and check the Has Detents box (On the | ||
main MSP window check the dropdown labeled "Knob Direction" and the | ||
checkbox directly below it labeled "Has Detents"). | ||
On the main MSP window set the dropdown labeled "On Enable..." to be | ||
"Zero Velocity". | ||
Set the HLFB mode to "ASG-Velocity w/Measured Torque" with a PWM carrier | ||
frequency of 482 Hz through the MSP software (select Advanced>>High | ||
Level Feedback \[Mode\]... then choose "ASG-Velocity w/Measured Torque" | ||
from the dropdown, make sure that 482 Hz is selected in the "PWM Carrier | ||
Frequency" dropdown, and hit the OK button). | ||
|
||
### LIMIT SWITCHES: | ||
1. Negative and Positive Limit switches should be connected to the DI-7 and DI-8 inputs on the controller, respectively. | ||
|
||
|
||
### EMERGENCY STOP: | ||
1. Emergency stop should be connected to the DI-6 input on the controller. | ||
|
||
Links: | ||
ClearCore Documentation: https://teknic-inc.github.io/ClearCore-library/ | ||
ClearCore Manual: https://www.teknic.com/files/downloads/clearcore_user_manual.pdf | ||
|
||
|
||
Copyright (c) 2020 Teknic Inc. This work is free to use, copy and distribute under the terms of | ||
the standard MIT permissive software license which can be found at https://opensource.org/licenses/MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit! | ||
################################################################################ | ||
|
||
SHELL := cmd.exe | ||
RM := rm -rf | ||
|
||
USER_OBJS := | ||
|
||
LIBS := | ||
PROJ := | ||
|
||
O_SRCS := | ||
C_SRCS := | ||
S_SRCS := | ||
S_UPPER_SRCS := | ||
OBJ_SRCS := | ||
ASM_SRCS := | ||
PREPROCESSING_SRCS := | ||
OBJS := | ||
OBJS_AS_ARGS := | ||
C_DEPS := | ||
C_DEPS_AS_ARGS := | ||
EXECUTABLES := | ||
OUTPUT_FILE_PATH := | ||
OUTPUT_FILE_PATH_AS_ARGS := | ||
AVR_APP_PATH :=$$$AVR_APP_PATH$$$ | ||
QUOTE := " | ||
ADDITIONAL_DEPENDENCIES:= | ||
OUTPUT_FILE_DEP:= | ||
LIB_DEP:= | ||
LINKER_SCRIPT_DEP:= | ||
|
||
# Every subdirectory with source files must be described here | ||
SUBDIRS := \ | ||
../Device_Startup/ \ | ||
../include \ | ||
../src | ||
|
||
|
||
# Add inputs and outputs from these tool invocations to the build variables | ||
C_SRCS += \ | ||
../Device_Startup/startup_same53.c \ | ||
../src/ClearPathMC.cpp \ | ||
../src/EthUDP.cpp \ | ||
../main.cpp | ||
|
||
|
||
PREPROCESSING_SRCS += | ||
|
||
|
||
ASM_SRCS += | ||
|
||
|
||
OBJS += \ | ||
Device_Startup/startup_same53.o \ | ||
src/ClearPathMC.o \ | ||
src/EthUDP.o \ | ||
main.o | ||
|
||
OBJS_AS_ARGS += \ | ||
Device_Startup/startup_same53.o \ | ||
src/ClearPathMC.o \ | ||
src/EthUDP.o \ | ||
main.o | ||
|
||
C_DEPS += \ | ||
Device_Startup/startup_same53.d \ | ||
src/ClearPathMC.d \ | ||
src/EthUDP.d \ | ||
main.d | ||
|
||
C_DEPS_AS_ARGS += \ | ||
Device_Startup/startup_same53.d \ | ||
src/ClearPathMC.d \ | ||
src/EthUDP.d \ | ||
main.d | ||
|
||
OUTPUT_FILE_PATH +=ClearCoreVelocityController.elf | ||
|
||
OUTPUT_FILE_PATH_AS_ARGS +=ClearCoreVelocityController.elf | ||
|
||
ADDITIONAL_DEPENDENCIES:= | ||
|
||
OUTPUT_FILE_DEP:= ./makedep.mk | ||
|
||
LIB_DEP+= \ | ||
C:/Users/lukes/Documents/Atmel\ Studio/7.0/libClearCore/Release/libClearCore.a \ | ||
C:/Users/lukes/Documents/Atmel\ Studio/7.0/LwIP/Release/libLwIP.a | ||
|
||
LINKER_SCRIPT_DEP+= \ | ||
../Device_Startup/flash_with_bootloader.ld \ | ||
../Device_Startup/flash_without_bootloader.ld | ||
|
||
|
||
# AVR32/GNU C Compiler | ||
Device_Startup/startup_same53.o: ../Device_Startup/startup_same53.c | ||
@echo Building file: $< | ||
@echo Invoking: ARM/GNU C Compiler : 6.3.1 | ||
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe$(QUOTE) -x c -mthumb -D__SAME53N19A__ -DNDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME53_DFP\1.1.118\include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\4.5.0\CMSIS\Include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\5.4.0\CMSIS\Core\Include" -O3 -ffunction-sections -fdata-sections -Wall -mcpu=cortex-m4 -c -std=gnu11 --param max-inline-insns-single=50 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" | ||
@echo Finished building: $< | ||
|
||
|
||
src/ClearPathMC.o: ../src/ClearPathMC.cpp | ||
@echo Building file: $< | ||
@echo Invoking: ARM/GNU C Compiler : 6.3.1 | ||
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-g++.exe$(QUOTE) -mthumb -D__SAME53N19A__ -DNDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\4.5.0\CMSIS\Include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME53_DFP\1.1.118\include" -I"../../libClearCore/inc" -I"../../LwIP/LwIP/src/include" -I"../../LwIP/LwIP/port/include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\5.4.0\CMSIS\Core\Include" -O3 -ffunction-sections -fno-rtti -fno-exceptions -Wall -mcpu=cortex-m4 -c -std=gnu++11 -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" | ||
@echo Finished building: $< | ||
|
||
|
||
src/EthUDP.o: ../src/EthUDP.cpp | ||
@echo Building file: $< | ||
@echo Invoking: ARM/GNU C Compiler : 6.3.1 | ||
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-g++.exe$(QUOTE) -mthumb -D__SAME53N19A__ -DNDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\4.5.0\CMSIS\Include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME53_DFP\1.1.118\include" -I"../../libClearCore/inc" -I"../../LwIP/LwIP/src/include" -I"../../LwIP/LwIP/port/include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\5.4.0\CMSIS\Core\Include" -O3 -ffunction-sections -fno-rtti -fno-exceptions -Wall -mcpu=cortex-m4 -c -std=gnu++11 -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" | ||
@echo Finished building: $< | ||
|
||
|
||
./main.o: .././main.cpp | ||
@echo Building file: $< | ||
@echo Invoking: ARM/GNU C Compiler : 6.3.1 | ||
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-g++.exe$(QUOTE) -mthumb -D__SAME53N19A__ -DNDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\4.5.0\CMSIS\Include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAME53_DFP\1.1.118\include" -I"../../libClearCore/inc" -I"../../LwIP/LwIP/src/include" -I"../../LwIP/LwIP/port/include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\5.4.0\CMSIS\Core\Include" -O3 -ffunction-sections -fno-rtti -fno-exceptions -Wall -mcpu=cortex-m4 -c -std=gnu++11 -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -MMD -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" | ||
@echo Finished building: $< | ||
|
||
|
||
|
||
|
||
|
||
# AVR32/GNU Preprocessing Assembler | ||
|
||
|
||
|
||
# AVR32/GNU Assembler | ||
|
||
|
||
|
||
|
||
ifneq ($(MAKECMDGOALS),clean) | ||
ifneq ($(strip $(C_DEPS)),) | ||
-include $(C_DEPS) | ||
endif | ||
endif | ||
|
||
# Add inputs and outputs from these tool invocations to the build variables | ||
|
||
# All Target | ||
all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES) | ||
|
||
$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP) | ||
@echo Building target: $@ | ||
@echo Invoking: ARM/GNU Linker : 6.3.1 | ||
$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-g++.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -mthumb -Wl,-Map="ClearCoreVelocityController.map" --specs=rdimon.specs -Wl,--start-group -lm -larm_cortexM4lf_math -lClearCore -lLwIP -Wl,--end-group -L"..\\Device_Startup" -L"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\arm\CMSIS\4.5.0\CMSIS\Lib\GCC" -L"C:\Users\lukes\Documents\Atmel Studio\7.0\libClearCore\Release" -L"C:\Users\lukes\Documents\Atmel Studio\7.0\LwIP\Release" -Wl,--gc-sections -mcpu=cortex-m4 -Tsame53n19a_flash.ld -mfloat-abi=hard -mfpu=fpv4-sp-d16 | ||
@echo Finished building target: $@ | ||
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-objcopy.exe" -O binary "ClearCoreVelocityController.elf" "ClearCoreVelocityController.bin" | ||
"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-size.exe" "ClearCoreVelocityController.elf" | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# Other Targets | ||
clean: | ||
-$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES) | ||
-$(RM) $(C_DEPS_AS_ARGS) | ||
rm -rf "ClearCoreVelocityController.elf" "ClearCoreVelocityController.a" "ClearCoreVelocityController.hex" "ClearCoreVelocityController.bin" "ClearCoreVelocityController.lss" "ClearCoreVelocityController.eep" "ClearCoreVelocityController.map" "ClearCoreVelocityController.srec" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
################################################################################ | ||
# Automatically-generated file. Do not edit or delete the file | ||
################################################################################ | ||
|
||
Device_Startup\startup_same53.c | ||
|
||
src\ClearPathMC.cpp | ||
|
||
src\EthUDP.cpp | ||
|
||
main.cpp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.