Controlling speed in DC motors and position in servomotors with KSDK [FTM + GPIO]

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Controlling speed in DC motors and position in servomotors with KSDK [FTM + GPIO]

Controlling speed in DC motors and position in servomotors with KSDK [FTM + GPIO]

Hello community,

 

This document is the continuation of the document Line scan camera with KSDK [ADC + PIT + GPIO] which shows the ease of use of the peripheral drivers from Kinetis SDK applied to the Freescale Cup smart car. This time I bring to you a document which explains how to control the speed in DC motors and the position in servomotors with KSDK step-by-step. This document is intended to be an example for the TPM and the GPIO peripheral drivers usage.

 

The required material to run this project is:

  • A Servomotor (the project supports up to two servomotors, one servomotor is included in the smart car kit).
  • Two DC motors (included in the smart car kit).
  • FRDM-KL25Z based on the Kinetis Microcontroller KL25Z.
  • FRDM-TFC shield.
  • Mini-USB cable.

 

This material can be bought in The Freescale Cup Intelligent Car Development.

 

76908_76908.pngpastedImage_6.png    76907_76907.pngpastedImage_5.png

 

The document Create a new KSDK 1.2.0 project in KDS 3.0.0 explains how to create a new KSDK project for the KL25Z MCU. The result of this document is the project BM-KSDK-FRDM_KL25Z.

The document Controlling speed in DC motors and position in servomotors with the FRDM-KL25Z and the Kinetis SDK [... explains how to implement an application to control the motors. The result of this document is the project BM-KSDK-FRDM_KL25Z_LINE_SCAN_CAMERA-SERVO-DC_MOTORS.

 

If you are interested in participate in the Freescale Cup you could take a look into the groups University Programs, The Freescale Cup Technical Reports TFC - Mexico, TFC - Brazil, TFC - China, TFC - Malaysia, TFC - Japan, TFC - North America, TFC - India, TFC - Taiwan, The Freescale Cup EMEA.

 

Best regards,

Earl Orlando Ramírez-Sánchez

Technical Support Engineer

Freescale Semiconductor

Labels (1)
Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-1104477%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EControlling%20speed%20in%20DC%20motors%20and%20position%20in%20servomotors%20with%20KSDK%20%5BFTM%20%2B%20GPIO%5D%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1104477%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20community%2C%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20document%20is%20the%20continuation%20of%20the%20document%20%3CA%20_jive_internal%3D%22true%22%20data-containerid%3D%2211234%22%20data-containertype%3D%2214%22%20data-objectid%3D%22106079%22%20data-objecttype%3D%22102%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-106079%22%20target%3D%22_blank%22%3ELine%20scan%20camera%20with%20KSDK%20%5BADC%20%2B%20PIT%20%2B%20GPIO%5D%3C%2FA%3E%20which%20shows%20the%20ease%20of%20use%20of%20the%20peripheral%20drivers%20from%20Kinetis%20SDK%20applied%20to%20the%20Freescale%20Cup%20smart%20car.%20This%20time%20I%20bring%20to%20you%20a%20document%20which%20explains%20how%20to%20control%20the%20speed%20in%20DC%20motors%20and%20the%20position%20in%20servomotors%20with%20KSDK%20step-by-step.%20This%20document%20is%20intended%20to%20be%20an%20example%20for%20the%20TPM%20and%20the%20GPIO%20peripheral%20drivers%20usage.%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20required%20material%20to%20run%20this%20project%20is%3A%3C%2FP%3E%3CUL%3E%3CLI%3EA%20Servomotor%20(the%20project%20supports%20up%20to%20two%20servomotors%2C%20one%20servomotor%20is%20included%20in%20the%20smart%20car%20kit).%3C%2FLI%3E%3CLI%3ETwo%20DC%20motors%20(included%20in%20the%20smart%20car%20kit).%3C%2FLI%3E%3CLI%3E%3CA%20class%3D%22jive-link-external-small%22%20data-content-finding%3D%22Community%22%20href%3D%22http%3A%2F%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DFRDM-KL25Z%26amp%3Blang_cd%3Den%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EFRDM-KL25Z%3C%2FA%3E%20based%20on%20the%20%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fcommunity%2Fkinetis%22%20target%3D%22_blank%22%3E%20Kinetis%20Microcontroller%3C%2FA%3E%20%3CA%20class%3D%22jive-link-external-small%22%20data-content-finding%3D%22Community%22%20href%3D%22http%3A%2F%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DKL2x%26amp%3Blang_cd%3Den%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EKL25Z%3C%2FA%3E.%3C%2FLI%3E%3CLI%3EFRDM-TFC%20shield.%3C%2FLI%3E%3CLI%3EMini-USB%20cable.%3C%2FLI%3E%3C%2FUL%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20material%20can%20be%20bought%20in%20%3CA%20class%3D%22jive-link-external-small%22%20data-content-finding%3D%22Community%22%20href%3D%22http%3A%2F%2Fwww.freescale.com%2Fwebapp%2Fsps%2Fsite%2Fprod_summary.jsp%3Fcode%3DTFC-KIT%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EThe%20Freescale%20Cup%20Intelligent%20Car%20Development%3C%2FA%3E.%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2276908_76908.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2276908_76908.png%22%20style%3D%22width%3A%20460px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117086i27CC0E1798B6DF96%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2276908_76908.png%22%20alt%3D%2276908_76908.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_6.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_6.png%22%20style%3D%22width%3A%20460px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111739iE59BC8B224B5030D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_6.png%22%20alt%3D%22pastedImage_6.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2276907_76907.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2276907_76907.png%22%20style%3D%22width%3A%20486px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117087iCBF63317A79B612E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2276907_76907.png%22%20alt%3D%2276907_76907.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_5.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_5.png%22%20style%3D%22width%3A%20486px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111740iD1A1DB10F4BA5AF5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_5.png%22%20alt%3D%22pastedImage_5.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20document%20%3CA%20_jive_internal%3D%22true%22%20data-containerid%3D%2211234%22%20data-containertype%3D%2214%22%20data-objectid%3D%22328007%22%20data-objecttype%3D%22102%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fservlet%2FJiveServlet%2Fdownload%2F106079-5-298196%2FCreate%20a%20new%20KSDK%201.2.0%20project%20in%20KDS%203.0.0.pdf%22%20target%3D%22_blank%22%3E%3CSPAN%3E%3CSPAN%3ECreate%20a%20new%20KSDK%201.2.0%20project%20in%20KDS%203.0.0%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FA%3Eexplains%20how%20to%20create%20a%20new%20KSDK%20project%20for%20the%20KL25Z%20MCU.%20The%20result%20of%20this%20document%20is%20the%20project%20%3CA%20_jive_internal%3D%22true%22%20data-containerid%3D%2211234%22%20data-containertype%3D%2214%22%20data-objectid%3D%22328007%22%20data-objecttype%3D%22102%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fservlet%2FJiveServlet%2Fdownload%2F106079-5-298197%2FBM-KSDK-FRDM_KL25Z.zip%22%20target%3D%22_blank%22%3EB%3CSPAN%3E%3CSPAN%3EM-KSDK-FRDM_KL25Z%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%20class%3D%22defaultSkin%22%3E%3CSPAN%20class%3D%22j-attachment-name-chop%22%3E.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20document%20%3CA%20_jive_internal%3D%22true%22%20data-containerid%3D%2211234%22%20data-containertype%3D%2214%22%20data-objectid%3D%22328007%22%20data-objecttype%3D%22102%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fservlet%2FJiveServlet%2Fdownload%2F328007-2-361962%2FControlling%20speed%20in%20DC%20motors%20and%20position%20in%20servomotors%20with%20the%20FRDM-KL25Z%20and%20the%20Kinetis%20SDK%20%5BFTM%20%2B%20GPIO%5D.pdf%22%20target%3D%22_blank%22%3EControlling%20speed%20in%20DC%20motors%20and%20position%20in%20servomotors%20with%20the%20FRDM-KL25Z%20and%20the%20Kinetis%20SDK%20%5BFTM%20%2B%20GPIO%5D%3C%2FA%3E%3CSPAN%20class%3D%22defaultSkin%22%3E%3CSPAN%20class%3D%22j-attachment-name-chop%22%3E%20explains%20how%20to%20implement%20an%20application%20to%20control%20the%20motors.%20The%20result%20of%20this%20document%20is%20the%20project%20%3CA%20_jive_internal%3D%22true%22%20data-containerid%3D%2211234%22%20data-containertype%3D%2214%22%20data-objectid%3D%22328007%22%20data-objecttype%3D%22102%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fservlet%2FJiveServlet%2Fdownload%2F328007-2-361963%2FBM-KSDK-FRDM_KL25Z_LINE_SCAN_CAMERA-SERVO-DC_MOTORS.zip%22%20target%3D%22_blank%22%3E%3CSPAN%3E%3CSPAN%3EBM-KSDK-FRDM_KL25Z_LINE_SCAN_CAMERA-SERVO-DC_MOTORS%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FA%3E.%3CSPAN%20class%3D%22defaultSkin%22%3E%3CSPAN%20class%3D%22j-attachment-name-chop%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22jive-video-view%20jive-content-video%22%20data-browse-id%3D%22219677%22%20data-object-id%3D%22106079%22%20data-object-type%3D%22102%22%20data-video-id%3D%223391%22%3E%3CP%3EIf%20you%20are%20interested%20in%20participate%20in%20the%20Freescale%20Cup%20you%20could%20take%20a%20look%20into%20the%20groups%20%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fcommunity%2Fuvp%22%20target%3D%22_blank%22%3EUniversity%20Programs%3C%2FA%3E%2C%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-community-small%22%20data-containerid%3D%2211378%22%20data-containertype%3D%2214%22%20data-objectid%3D%2211379%22%20data-objecttype%3D%2214%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fcommunity%2Fuvp%2Fprojects-documentation%2Fthe-freescale-cup-technical-reports%2Factivity%22%20target%3D%22_blank%22%3EThe%20Freescale%20Cup%20Technical%20Reports%3C%2FA%3E%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-socialgroup-small%22%20data-containerid%3D%2217%22%20data-containertype%3D%22-2%22%20data-objectid%3D%222403%22%20data-objecttype%3D%22700%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgroups%2Ftfc-mexico%22%20target%3D%22_blank%22%3ETFC%20-%20Mexico%3C%2FA%3E%2C%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-socialgroup-small%22%20data-containerid%3D%2217%22%20data-containertype%3D%22-2%22%20data-objectid%3D%224249%22%20data-objecttype%3D%22700%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgroups%2Ftfc-brazil%22%20target%3D%22_blank%22%3ETFC%20-%20Brazil%3C%2FA%3E%2C%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-socialgroup-small%22%20data-containerid%3D%2217%22%20data-containertype%3D%22-2%22%20data-objectid%3D%2251374%22%20data-objecttype%3D%22700%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgroups%2Ftfc-china%22%20target%3D%22_blank%22%3ETFC%20-%20China%3C%2FA%3E%2C%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-socialgroup-small%22%20data-containerid%3D%2217%22%20data-containertype%3D%22-2%22%20data-objectid%3D%226486%22%20data-objecttype%3D%22700%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgroups%2Ftfc-malaysia%22%20target%3D%22_blank%22%3ETFC%20-%20Malaysia%3C%2FA%3E%2C%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-socialgroup-small%22%20data-containerid%3D%2217%22%20data-containertype%3D%22-2%22%20data-objectid%3D%2243345%22%20data-objecttype%3D%22700%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgroups%2Ftfc-japan%22%20target%3D%22_blank%22%3ETFC%20-%20Japan%3C%2FA%3E%2C%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-socialgroup-small%22%20data-containerid%3D%2217%22%20data-containertype%3D%22-2%22%20data-objectid%3D%226179%22%20data-objecttype%3D%22700%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgroups%2Ftfc-usa%22%20target%3D%22_blank%22%3ETFC%20-%20North%20America%3C%2FA%3E%2C%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-socialgroup-small%22%20data-containerid%3D%2217%22%20data-containertype%3D%22-2%22%20data-objectid%3D%223628%22%20data-objecttype%3D%22700%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgroups%2Ftfc-india%22%20target%3D%22_blank%22%3ETFC%20-%20India%3C%2FA%3E%2C%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-socialgroup-small%22%20data-containerid%3D%2217%22%20data-containertype%3D%22-2%22%20data-objectid%3D%2251422%22%20data-objecttype%3D%22700%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgroups%2Ftfc-taiwan%22%20target%3D%22_blank%22%3ETFC%20-%20Taiwan%3C%2FA%3E%2C%20%3CA%20_jive_internal%3D%22true%22%20class%3D%22jivecontainerTT-hover-container%20jive-link-socialgroup-small%22%20data-containerid%3D%2217%22%20data-containertype%3D%22-2%22%20data-objectid%3D%2215351%22%20data-objecttype%3D%22700%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fgroups%2Ftfc-emea%22%20target%3D%22_blank%22%3EThe%20Freescale%20Cup%20EMEA%3C%2FA%3E.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3EEarl%20Orlando%20Ram%C3%ADrez-S%C3%A1nchez%3C%2FP%3E%3CP%3ETechnical%20Support%20Engineer%3C%2FP%3E%3CP%3EFreescale%20Semiconductor%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1104477%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EGeneral%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
No ratings
Version history
Last update:
‎09-17-2015 01:25 PM
Updated by: