element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Vintage Turntable repair: Can I fix a Perpetuum Ebner from 1958 - part 4 - Hercules LaunchPad Enhanced PWM try-out
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 25 Feb 2015 10:02 PM Date Created
  • Views 1125 views
  • Likes 5 likes
  • Comments 1 comment
  • hercules_launchpad
  • audio
  • hack
  • vintage
  • turntable
  • texas_instrutments
  • internet_of_things
  • arm_cortex
  • motor_control_kit
  • motor_control
  • shield
  • motor
  • arduino
  • streaming
Related
Recommended

Vintage Turntable repair: Can I fix a Perpetuum Ebner from 1958 - part 4 - Hercules LaunchPad Enhanced PWM try-out

Jan Cumps
Jan Cumps
25 Feb 2015

What happened before:

 

For almost a year I have a vintage turntable from Perpetuum Ebner at home.

It's not mine. It belongs to someone that asked me to fix it. And it turned out that fixing the motor would cost too much.

I asked the owner to collect the tt. That hasn't happened yet and the machine is collecting dust at my home.

 

So I'll take the freedom to attempt a non-intrusive repair with modern components. I'm also thinking about making it an Enchanted Objects Design Challenge.

 

In post 1 I present the turntable, talk about my previous repair attempts and brainstorm on some modding ideas.
In post 2 I'm measuring up the different gears, pulleys and wheels, and I calculate the speed of the original motor.

Post 3 is the first post on motor control. I'm reviewing the operation of the Infineon DC Motor Control Shield.

 

In this post I'm using the enhanced PWM module of my The specified item was not found. Hercules LaunchPad to test drive the motor.

 

image

 

Enhanced PWM module

This module on the Hercules microcontroller is new to me. My previous one didn't have it.

And that's why I'm using it here to drive the motor shield: for my own education and entertainment.

 

This video is unavailable.
You don't have permission to edit metadata of this video.

 

I'm going to use the module as a straightforward PWM generator running at a fixed frequency. The only thing I want to drive from my code is the duty cycle.

I'm going to use that mechanism later to control the motor speed of my turntable.

I first studied the example that's available in the help files of the Hercules configuration application HALCoGen (covered in the video above).

Once I understood that, I as ready to choose my own signal frequency. And I knew how to manipulate the duty cycle from within the firmware.

 

When you use HALCoGen to configure the PWM module, it generates the correct registry initialization code for you.The only thing you have to do in firmware is call that initialization.

The controller will immediately start generating the PWM as defined in the configuration.

At run-time, you can then change the duty cycle  with another single line of code.

 

HALCoGen initialization

 

All configuration is done by selecting the right properties for the ePWM module.

I'm configuring a 25 kHz (40000ns) signal with 80% duty cycle in the screen captures below.

 

First step is to enable it:

image

Next, we configure the settings of our PWM channel:

image

image

 

 

And finally, pin-multiplexing and clock synchronisation:

image

 

 

 

That's it. HALCoGen creates your application framework, the APIs for the activated modules, and the initialization code based on these settings.

 

Start PWM and change Duty Cycle from Firmware

 

The source code for the firmware is extremely simple. The first call starts PWM as defined by HALCoGen.
The second call immediately switches the duty cycle to 40%.

void main(void)
{
/* USER CODE BEGIN (3) */
  etpwmInit();
etpwmSetCmpA(etpwmREG1, 1600); // set duty cycle to 40%


    while(1);
/* USER CODE END */
}

 

Hardware setup

The setup is straightforward. The only 'smart' connection is the PWM signal. It's going from the PMW output LaunchPad to the input of the first half H-bridge on the infineon shield.

There's also a semi-smart output in my demo setup: the inhibit pin of the firts half H-bridge is pulled high to make it active.

image

The motor is wired between the output of that first half H-bridge and ground (I'm only controlling the speed in this demo, not the direction).

The Hercules LaunchPad only needs a 5V dc supply, I'm using the USB connector for that. The motor driver is powered by my bench power supply at 12V.

 

signalLaunchPadMotor ShieldMotor
groundJ11.2 (GND)GND (any)
half H-bridge 1 InhibitJ11.3 (+3.3V)DIGITAL 12 (INH_1)
PWM control signalJ11.16 (EPWM1A)DIGITAL 3 (IN_1)
motor PWM signalOUT1motor wire 1
motor groundGNDmotor wire 2
motor power supply +12V from desk power supplyVBAT
motor power supply ground from desk power supplyGND
LaunchPad power supply 5V from computer USBUSB

 

image

I've recorded the PWM input and motor output signal for 25%, 50% and 75% duty cycle at 25 kHz.

imageimageimage

I'm still worried about noise in the audio range. The FFT analysis of the motor signal shows that there's things happening under the 20 kHz range.

Tests will have to show if there is audible interference on the turntable's output.

image

I don't know yet what the subject of the next blog post is going to be.

 

 

Related posts
Vintage Turntable repair: Can I fix a Perpetuum Ebner from 1958 - part 1
Vintage Turntable repair: Can I fix a Perpetuum Ebner from 1958 - part 2 - Calculating the Motor Speed
Vintage Turntable repair: Can I fix a Perpetuum Ebner from 1958 - part 3 - Infineon Motor Driver shield
Vintage Turntable repair: Can I fix a Perpetuum Ebner from 1958 - part 5 - Yes I Can
Vintage Turntable repair: Can I fix a Perpetuum Ebner from 1958 - part 6 - Speed Adjustment with Variable Duty Cycle
Vintage Turntable repair: Can I fix a Perpetuum Ebner from 1958 - part 7 - Make Speed Sensor from Scrap Parts
Vintage Turntable repair: Can I fix a Perpetuum Ebner from 1958 - part 8 - Sample the Motor Speed with Microcontroller
  • Sign in to reply
  • Jan Cumps
    Jan Cumps over 11 years ago

    Spoiler for the next part (15 seconds, no sound yet):

    This video is unavailable.
    You don't have permission to edit metadata of this video.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube